]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add macro to create friendly type names for dlist head / entry structures
authorNick Porter <nick@portercomputing.co.uk>
Wed, 8 Mar 2023 10:38:01 +0000 (10:38 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 8 Mar 2023 16:05:06 +0000 (16:05 +0000)
src/lib/util/dlist.h

index f5e31966802d59b07ad1aa0c525fa016f66409e3..8f7253866e3948addd774fe51f49d9d8a2c30bf5 100644 (file)
@@ -1103,6 +1103,16 @@ static inline void fr_dlist_noop(void)
        typedef struct { fr_dlist_t entry; } FR_DLIST_ENTRY(_name); \
        typedef struct { fr_dlist_head_t head; } FR_DLIST_HEAD(_name); \
 
+/** Define friendly names for type specific dlist head and entry structures
+ *
+ * @param[in] _name    Prefix we add to type-specific structures.
+ * @param[in] _head    Name to use for head structure.
+ * @param[in] _entry   Name to use for entry structure.
+*/
+#define FR_DLIST_TYPEDEFS(_name, _head, _entry) \
+       typedef FR_DLIST_HEAD(_name) _head; \
+       typedef FR_DLIST_ENTRY(_name) _entry;
+
 /** Define type specific wrapper functions for dlists
  *
  * @note This macro should be used inside the source file that will use