summaryrefslogtreecommitdiff
path: root/source3/ubiqx/ubi_dLinkList.h
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-07-24 07:39:14 +0000
committerChristopher R. Hertel <crh@samba.org>1998-07-24 07:39:14 +0000
commit5a9f14bca97a41c614dbc21707cfbaef7d626869 (patch)
treebea5959e42392c37b97703d6a08431c37167fec1 /source3/ubiqx/ubi_dLinkList.h
parent981e1b0f7e5d41b59785f03a2f32d601a4fe7e13 (diff)
downloadsamba-5a9f14bca97a41c614dbc21707cfbaef7d626869.tar.gz
samba-5a9f14bca97a41c614dbc21707cfbaef7d626869.tar.bz2
samba-5a9f14bca97a41c614dbc21707cfbaef7d626869.zip
To each list type, I added a macro that makes it easier to define and
initialize a list header. (This used to be commit 3c133778f13f690e70b8b5b923e10b5fe561c812)
Diffstat (limited to 'source3/ubiqx/ubi_dLinkList.h')
-rw-r--r--source3/ubiqx/ubi_dLinkList.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/ubiqx/ubi_dLinkList.h b/source3/ubiqx/ubi_dLinkList.h
index 9e2cb9c4d2..548f8e5200 100644
--- a/source3/ubiqx/ubi_dLinkList.h
+++ b/source3/ubiqx/ubi_dLinkList.h
@@ -26,7 +26,10 @@
*
* -------------------------------------------------------------------------- **
*
- * Log: ubi_dLinkList.h,v
+ * Log: ubi_dLinkList.h,v
+ * Revision 0.10 1998/07/24 07:30:20 crh
+ * Added the ubi_dlNewList() macro.
+ *
* Revision 0.9 1998/06/04 21:29:27 crh
* Upper-cased defined constants (eg UBI_BINTREE_H) in some header files.
* This is more "standard", and is what people expect. Weird, eh?
@@ -101,6 +104,13 @@ typedef ubi_dlList *ubi_dlListPtr;
/* ========================================================================== **
* Macros...
*
+ * ubi_dlNewList - Macro used to declare and initialize a new list in one
+ * swell foop. It is used when defining a variable of
+ * type ubi_dlList. The definition
+ * static ubi_dlNewList( gerbil );
+ * is translated to
+ * static ubi_dlList gerbil[1] = {{ NULL, NULL, 0 }};
+ *
* ubi_dlCount - Return the number of entries currently in the list.
*
* ubi_dlAddHead - Add a new node at the head of the list.
@@ -128,11 +138,12 @@ typedef ubi_dlList *ubi_dlListPtr;
* Add and Rem macros are nothing more than nice front-ends to the
* Insert and Remove operations.
*
- * Also note that there the First, Next and Last macros do no parameter
- * checking!
+ * Also note that the First, Next and Last macros do no parameter checking!
*
*/
+#define ubi_dlNewList( L ) ubi_dlList (L)[1] = {{ NULL, NULL, 0 }}
+
#define ubi_dlCount( L ) (((ubi_dlListPtr)(L))->count)
#define ubi_dlAddHead( L, N ) \