aboutsummaryrefslogtreecommitdiff
path: root/src/include/lib
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-09-07 05:04:48 +0000
committerBruce Momjian <bruce@momjian.us>1997-09-07 05:04:48 +0000
commit1ccd423235a48739d6f7a4d7889705b5f9ecc69b (patch)
tree8001c4e839dfad8f29ceda7f8c5f5dbb8759b564 /src/include/lib
parent8fecd4febf8357f3cc20383ed29ced484877d5ac (diff)
downloadpostgresql-1ccd423235a48739d6f7a4d7889705b5f9ecc69b.tar.gz
postgresql-1ccd423235a48739d6f7a4d7889705b5f9ecc69b.zip
Massive commit to run PGINDENT on all *.c and *.h files.
Diffstat (limited to 'src/include/lib')
-rw-r--r--src/include/lib/dllist.h98
-rw-r--r--src/include/lib/fstack.h96
-rw-r--r--src/include/lib/hasht.h14
-rw-r--r--src/include/lib/lispsort.h10
-rw-r--r--src/include/lib/qsort.h20
-rw-r--r--src/include/lib/stringinfo.h31
6 files changed, 138 insertions, 131 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 */
diff --git a/src/include/lib/fstack.h b/src/include/lib/fstack.h
index de2868142a3..99f10b9006c 100644
--- a/src/include/lib/fstack.h
+++ b/src/include/lib/fstack.h
@@ -1,112 +1,114 @@
/*-------------------------------------------------------------------------
*
* fstack.h--
- * Fixed format stack definitions.
+ * Fixed format stack definitions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fstack.h,v 1.2 1996/10/31 09:48:46 scrappy Exp $
+ * $Id: fstack.h,v 1.3 1997/09/07 04:58:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Note:
- * Fixed format stacks assist in the construction of FIFO stacks of
- * fixed format structures. Structures which are to be stackable
- * should contain a FixedItemData component. A stack is initilized
- * with the offset of the FixedItemData component of the structure
- * it will hold. By doing so, push and pop operations are simplified
- * for the callers. All references to stackable items are pointers
- * to the base of the structure instead of pointers to the
- * FixedItemData component.
+ * Fixed format stacks assist in the construction of FIFO stacks of
+ * fixed format structures. Structures which are to be stackable
+ * should contain a FixedItemData component. A stack is initilized
+ * with the offset of the FixedItemData component of the structure
+ * it will hold. By doing so, push and pop operations are simplified
+ * for the callers. All references to stackable items are pointers
+ * to the base of the structure instead of pointers to the
+ * FixedItemData component.
*
*/
-#ifndef FSTACK_H
+#ifndef FSTACK_H
#define FSTACK_H
/*
* FixedItem --
- * Fixed format stackable item chain component.
+ * Fixed format stackable item chain component.
*
* Note:
- * Structures must contain one FixedItemData component per stack in
- * which it will be an item.
+ * Structures must contain one FixedItemData component per stack in
+ * which it will be an item.
*/
-typedef struct FixedItemData FixedItemData;
-typedef FixedItemData *FixedItem;
+typedef struct FixedItemData FixedItemData;
+typedef FixedItemData *FixedItem;
-struct FixedItemData {
- FixedItem next; /* next item or NULL */
+struct FixedItemData
+{
+ FixedItem next; /* next item or NULL */
};
/*
* FixedStack --
- * Fixed format stack.
+ * Fixed format stack.
*/
-typedef struct FixedStackData {
- FixedItem top; /* Top item on the stack or NULL */
- Offset offset; /* Offset from struct base to item */
+typedef struct FixedStackData
+{
+ FixedItem top; /* Top item on the stack or NULL */
+ Offset offset; /* Offset from struct base to item */
/* this could be signed short int! */
-} FixedStackData;
+} FixedStackData;
-typedef FixedStackData *FixedStack;
+typedef FixedStackData *FixedStack;
/*
* FixedStackInit --
- * Iniitializes stack for structures with given fixed component offset.
+ * Iniitializes stack for structures with given fixed component offset.
*
* Exceptions:
- * BadArg if stack is invalid pointer.
+ * BadArg if stack is invalid pointer.
*/
-extern void FixedStackInit(FixedStack stack, Offset offset);
+extern void FixedStackInit(FixedStack stack, Offset offset);
/*
* FixedStackPop --
- * Returns pointer to top structure on stack or NULL if empty stack.
+ * Returns pointer to top structure on stack or NULL if empty stack.
*
* Exceptions:
- * BadArg if stack is invalid.
+ * BadArg if stack is invalid.
*/
-Pointer FixedStackPop(FixedStack stack);
+Pointer FixedStackPop(FixedStack stack);
/*
* FixedStackPush --
- * Places structure associated with pointer onto top of stack.
+ * Places structure associated with pointer onto top of stack.
*
* Exceptions:
- * BadArg if stack is invalid.
- * BadArg if pointer is invalid.
+ * BadArg if stack is invalid.
+ * BadArg if pointer is invalid.
*/
-extern void FixedStackPush(FixedStack stack, Pointer pointer);
+extern void FixedStackPush(FixedStack stack, Pointer pointer);
/*
* FixedStackGetTop --
- * Returns pointer to top structure of a stack. This item is not poped.
+ * Returns pointer to top structure of a stack. This item is not poped.
*
* Note:
- * This is not part of the normal stack interface. It is intended for
- * debugging use only.
+ * This is not part of the normal stack interface. It is intended for
+ * debugging use only.
*
* Exceptions:
- * BadArg if stack is invalid.
+ * BadArg if stack is invalid.
*/
-extern Pointer FixedStackGetTop(FixedStack stack);
+extern Pointer FixedStackGetTop(FixedStack stack);
/*
* FixedStackGetNext --
- * Returns pointer to next structure after pointer of a stack.
+ * Returns pointer to next structure after pointer of a stack.
*
* Note:
- * This is not part of the normal stack interface. It is intended for
- * debugging use only.
+ * This is not part of the normal stack interface. It is intended for
+ * debugging use only.
*
* Exceptions:
- * BadArg if stack is invalid.
- * BadArg if pointer is invalid.
- * BadArg if stack does not contain pointer.
+ * BadArg if stack is invalid.
+ * BadArg if pointer is invalid.
+ * BadArg if stack does not contain pointer.
*/
-extern Pointer FixedStackGetNext(FixedStack stack, Pointer pointer);
+extern Pointer FixedStackGetNext(FixedStack stack, Pointer pointer);
-#endif /* FSTACK_H */
+#endif /* FSTACK_H */
diff --git a/src/include/lib/hasht.h b/src/include/lib/hasht.h
index 20f562e1136..1d28c2ca28f 100644
--- a/src/include/lib/hasht.h
+++ b/src/include/lib/hasht.h
@@ -1,23 +1,23 @@
/*-------------------------------------------------------------------------
*
* hasht.h--
- * hash table related functions that are not directly supported
- * under utils/hash.
+ * hash table related functions that are not directly supported
+ * under utils/hash.
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: hasht.h,v 1.2 1996/11/05 11:29:45 scrappy Exp $
+ * $Id: hasht.h,v 1.3 1997/09/07 04:58:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-#ifndef HASHT_H
+#ifndef HASHT_H
#define HASHT_H
#include <utils/hsearch.h>
-typedef void (*HashtFunc)();
+typedef void (*HashtFunc) ();
-extern void HashTableWalk(HTAB *hashtable, HashtFunc function, int arg);
+extern void HashTableWalk(HTAB * hashtable, HashtFunc function, int arg);
-#endif /* HASHT_H */
+#endif /* HASHT_H */
diff --git a/src/include/lib/lispsort.h b/src/include/lib/lispsort.h
index 872b14959a3..d4d074ba54d 100644
--- a/src/include/lib/lispsort.h
+++ b/src/include/lib/lispsort.h
@@ -1,16 +1,16 @@
/*-------------------------------------------------------------------------
*
* lispsort.h--
- *
+ *
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lispsort.h,v 1.2 1997/08/19 21:38:30 momjian Exp $
+ * $Id: lispsort.h,v 1.3 1997/09/07 04:58:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-#ifndef LISPSORT_H
-#define LISPSORT_H
+#ifndef LISPSORT_H
+#define LISPSORT_H
-#endif /* LISPSORT_H */
+#endif /* LISPSORT_H */
diff --git a/src/include/lib/qsort.h b/src/include/lib/qsort.h
index 3382d0b34e8..d321ed7fb2c 100644
--- a/src/include/lib/qsort.h
+++ b/src/include/lib/qsort.h
@@ -1,23 +1,23 @@
/*-------------------------------------------------------------------------
*
* qsort.h--
- *
+ *
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: qsort.h,v 1.2 1996/11/06 10:29:46 scrappy Exp $
+ * $Id: qsort.h,v 1.3 1997/09/07 04:58:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-#ifndef QSORT_H
-#define QSORT_H
+#ifndef QSORT_H
+#define QSORT_H
-extern void pg_qsort(void *bot,
- size_t nmemb,
- size_t size,
- int (*compar)(void *, void *));
+extern void
+pg_qsort(void *bot,
+ size_t nmemb,
+ size_t size,
+ int (*compar) (void *, void *));
-#endif /* QSORT_H */
-
+#endif /* QSORT_H */
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h
index 39863fcbcae..f127d8cdd01 100644
--- a/src/include/lib/stringinfo.h
+++ b/src/include/lib/stringinfo.h
@@ -1,12 +1,12 @@
/*-------------------------------------------------------------------------
*
* stringinfo.h--
- * Declarations/definitons for "string" functions.
+ * Declarations/definitons for "string" functions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: stringinfo.h,v 1.2 1996/10/31 09:48:52 scrappy Exp $
+ * $Id: stringinfo.h,v 1.3 1997/09/07 04:58:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,18 +16,19 @@
/*-------------------------
* StringInfoData holds information about a string.
- * 'data' is the string.
- * 'len' is the current string length (as returned by 'strlen')
- * 'maxlen' is the size in bytes of 'data', i.e. the maximum string
- * size (includeing the terminating '\0' char) that we can
- * currently store in 'data' without having to reallocate
- * more space.
+ * 'data' is the string.
+ * 'len' is the current string length (as returned by 'strlen')
+ * 'maxlen' is the size in bytes of 'data', i.e. the maximum string
+ * size (includeing the terminating '\0' char) that we can
+ * currently store in 'data' without having to reallocate
+ * more space.
*/
-typedef struct StringInfoData {
- char *data;
- int maxlen;
- int len;
-} StringInfoData;
+typedef struct StringInfoData
+{
+ char *data;
+ int maxlen;
+ int len;
+} StringInfoData;
typedef StringInfoData *StringInfo;
@@ -41,6 +42,6 @@ extern StringInfo makeStringInfo(void);
* appendStringInfo
* similar to 'strcat' but reallocates more space if necessary...
*/
-extern void appendStringInfo(StringInfo str, char *buffer);
+extern void appendStringInfo(StringInfo str, char *buffer);
-#endif /* STRINGINFO_H */
+#endif /* STRINGINFO_H */