summaryrefslogtreecommitdiff
path: root/src/include/lib/dllist.h
diff options
context:
space:
mode:
authorBruce Momjian1997-09-07 05:04:48 +0000
committerBruce Momjian1997-09-07 05:04:48 +0000
commit1ccd423235a48739d6f7a4d7889705b5f9ecc69b (patch)
tree8001c4e839dfad8f29ceda7f8c5f5dbb8759b564 /src/include/lib/dllist.h
parent8fecd4febf8357f3cc20383ed29ced484877d5ac (diff)
Massive commit to run PGINDENT on all *.c and *.h files.
Diffstat (limited to 'src/include/lib/dllist.h')
-rw-r--r--src/include/lib/dllist.h98
1 files changed, 51 insertions, 47 deletions
diff --git a/src/include/lib/dllist.h b/src/include/lib/dllist.h
index 4c4534b974c..15a18d88c6f 100644
--- a/src/include/lib/dllist.h
+++ b/src/include/lib/dllist.h
@@ -1,32 +1,32 @@
/*-------------------------------------------------------------------------
*
* dllist.h--
- * simple doubly linked list primitives
- * the elements of the list are void* so the lists can contain
- * anything
- * Dlelem can only be in one list at a time
- *
+ * simple doubly linked list primitives
+ * the elements of the list are void* so the lists can contain
+ * anything
+ * Dlelem can only be in one list at a time
*
- * Here's a small example of how to use Dllist's :
- *
- * Dllist *lst;
- * Dlelem *elt;
- * void *in_stuff; -- stuff to stick in the list
- * void *out_stuff
*
- * lst = DLNewList(); -- make a new dllist
- * DLAddHead(lst, DLNewElem(in_stuff)); -- add a new element to the list
- * with in_stuff as the value
- * ...
- * elt = DLGetHead(lst); -- retrieve the head element
- * out_stuff = (void*)DLE_VAL(elt); -- get the stuff out
- * DLRemove(elt); -- removes the element from its list
- * DLFreeElem(elt); -- free the element since we don't
- * use it anymore
+ * Here's a small example of how to use Dllist's :
+ *
+ * Dllist *lst;
+ * Dlelem *elt;
+ * void *in_stuff; -- stuff to stick in the list
+ * void *out_stuff
+ *
+ * lst = DLNewList(); -- make a new dllist
+ * DLAddHead(lst, DLNewElem(in_stuff)); -- add a new element to the list
+ * with in_stuff as the value
+ * ...
+ * elt = DLGetHead(lst); -- retrieve the head element
+ * out_stuff = (void*)DLE_VAL(elt); -- get the stuff out
+ * DLRemove(elt); -- removes the element from its list
+ * DLFreeElem(elt); -- free the element since we don't
+ * use it anymore
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dllist.h,v 1.4 1997/08/19 21:38:28 momjian Exp $
+ * $Id: dllist.h,v 1.5 1997/09/07 04:58:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -38,32 +38,36 @@
struct Dllist;
struct Dlelem;
-typedef struct Dlelem {
- struct Dlelem *dle_next; /* next element */
- struct Dlelem *dle_prev; /* previous element */
- void *dle_val; /* value of the element */
- struct Dllist *dle_list; /* what list this element is in */
-} Dlelem;
+typedef struct Dlelem
+{
+ struct Dlelem *dle_next; /* next element */
+ struct Dlelem *dle_prev; /* previous element */
+ void *dle_val; /* value of the element */
+ struct Dllist *dle_list; /* what list this element is in */
+} Dlelem;
+
+typedef struct Dllist
+{
+ Dlelem *dll_head;
+ Dlelem *dll_tail;
+} Dllist;
-typedef struct Dllist {
- Dlelem *dll_head;
- Dlelem *dll_tail;
-} Dllist;
-
-extern Dllist* DLNewList(void); /* initialize a new list */
-extern void DLFreeList(Dllist*); /* free up a list and all the nodes in it*/
-extern Dlelem* DLNewElem(void* val);
-extern void DLFreeElem(Dlelem*);
-extern Dlelem* DLGetHead(Dllist*);
-extern Dlelem* DLGetTail(Dllist*);
-extern Dlelem* DLRemTail(Dllist* l);
-extern Dlelem* DLGetPred(Dlelem*); /* get predecessor */
-extern Dlelem* DLGetSucc(Dlelem*); /* get successor */
-extern void DLRemove(Dlelem*); /* removes node from list*/
-extern void DLAddHead(Dllist* list, Dlelem* node);
-extern void DLAddTail(Dllist* list, Dlelem* node);
-extern Dlelem* DLRemHead(Dllist* list); /* remove and return the head */
+extern Dllist *DLNewList(void);/* initialize a new list */
+extern void DLFreeList(Dllist *); /* free up a list and all the
+ * nodes in it */
+extern Dlelem *DLNewElem(void *val);
+extern void DLFreeElem(Dlelem *);
+extern Dlelem *DLGetHead(Dllist *);
+extern Dlelem *DLGetTail(Dllist *);
+extern Dlelem *DLRemTail(Dllist * l);
+extern Dlelem *DLGetPred(Dlelem *); /* get predecessor */
+extern Dlelem *DLGetSucc(Dlelem *); /* get successor */
+extern void DLRemove(Dlelem *); /* removes node from list */
+extern void DLAddHead(Dllist * list, Dlelem * node);
+extern void DLAddTail(Dllist * list, Dlelem * node);
+extern Dlelem *DLRemHead(Dllist * list); /* remove and return the
+ * head */
-#define DLE_VAL(x) (x->dle_val)
+#define DLE_VAL(x) (x->dle_val)
-#endif /* DLLIST_H */
+#endif /* DLLIST_H */