diff options
Diffstat (limited to 'utils/Burg/list.c')
-rw-r--r-- | utils/Burg/list.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/utils/Burg/list.c b/utils/Burg/list.c index d3eefa2..daa90cf 100644 --- a/utils/Burg/list.c +++ b/utils/Burg/list.c @@ -5,71 +5,71 @@ char rcsid_list[] = "$Id$"; IntList newIntList(x, next) int x; IntList next; { - IntList l; + IntList l; - l = (IntList) zalloc(sizeof(*l)); - assert(l); - l->x = x; - l->next = next; + l = (IntList) zalloc(sizeof(*l)); + assert(l); + l->x = x; + l->next = next; - return l; + return l; } List newList(x, next) void *x; List next; { - List l; + List l; - l = (List) zalloc(sizeof(*l)); - assert(l); - l->x = x; - l->next = next; + l = (List) zalloc(sizeof(*l)); + assert(l); + l->x = x; + l->next = next; - return l; + return l; } List appendList(x, l) void *x; List l; { - List last; - List p; + List last; + List p; - last = 0; - for (p = l; p; p = p->next) { - last = p; - } - if (last) { - last->next = newList(x, 0); - return l; - } else { - return newList(x, 0); - } + last = 0; + for (p = l; p; p = p->next) { + last = p; + } + if (last) { + last->next = newList(x, 0); + return l; + } else { + return newList(x, 0); + } } void foreachList(f, l) ListFn f; List l; { - for (; l; l = l->next) { - (*f)(l->x); - } + for (; l; l = l->next) { + (*f)(l->x); + } } void reveachList(f, l) ListFn f; List l; { - if (l) { - reveachList(f, l->next); - (*f)(l->x); - } + if (l) { + reveachList(f, l->next); + (*f)(l->x); + } } int length(l) List l; { - int c = 0; + int c = 0; - for(; l; l = l->next) { - c++; - } - return c; + for(; l; l = l->next) { + c++; + } + return c; } |