llx: New macro LLX_INITIALIZER to initialize an llx list statically.
[pspp-builds.git] / src / libpspp / llx.h
index 6232f3967ce3bdd9b9495bbf0cf0fc3a34934a6f..23c3bdaf8ebd0d7ebd2b3741db12106ef38952de 100644 (file)
@@ -110,6 +110,12 @@ struct llx_list
     struct ll_list ll_list;     /* The list. */
   };
 
+/* Suitable for use as the initializer for a `struct llx_list'
+   named LIST.  Typical usage:
+       struct llx_list list = LLX_INITIALIZER (list);
+   LLX_INITIALIZER() is an alternative to llx_init(). */
+#define LLX_INITIALIZER(LIST) { LL_INITIALIZER ((LIST).ll_list) }
+
 /* Memory manager. */
 struct llx_manager
   {