]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move private macros to private header
authorAlan T. DeKok <aland@freeradius.org>
Sat, 26 Mar 2022 13:05:06 +0000 (09:05 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 28 Mar 2022 16:16:38 +0000 (12:16 -0400)
src/lib/server/cf_priv.h
src/lib/server/cf_util.h

index a6dcb7ed664dcb2679b220ad9230ff66d1efcc78..c6a8432a8801e7e9536e7cbf45488a7715dd48f5 100644 (file)
@@ -127,6 +127,25 @@ typedef struct {
        bool                    from_dir;       //!< was read from a directory
 } cf_file_t;
 
+/** Iterate over the contents of a list
+ *
+ * @param[in] _ci              to iterate over.
+ * @param[in] _iter            Name of iteration variable.
+ *                             Will be declared in the scope of the loop.
+ */
+#define cf_item_foreach(_ci, _iter) \
+       for (CONF_ITEM *_iter = fr_dlist_head(&(_ci)->children); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))
+
+/** Iterate over the contents of a list
+ *
+ * @param[in] _ci              to iterate over.
+ * @param[in] _iter            Name of iteration variable.
+ *                             Will be declared in the scope of the loop.
+ * @param[in] _prev            previous pointer
+ */
+#define cf_item_foreach_prev(_ci, _iter, _prev) \
+       for (CONF_ITEM *_iter = fr_dlist_next(&(_ci)->children, _prev); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))
+
 /** Check if the CONF_ITEM has no children.
  *
  *  Which is the common use-case
index c7620bb14133bf822885c0e4eaf4ed103875ef55..a8b4771d9610fb74e8ad12a7213adda3f1fe8604 100644 (file)
@@ -92,25 +92,6 @@ CONF_ITEM    *_cf_item_remove(CONF_ITEM *parent, CONF_ITEM *child);
 #define                cf_item_next(_ci, _prev) _cf_item_next(CF_TO_ITEM(_ci), _prev)
 CONF_ITEM      *_cf_item_next(CONF_ITEM const *ci, CONF_ITEM const *prev);
 
-/** Iterate over the contents of a list
- *
- * @param[in] _ci              to iterate over.
- * @param[in] _iter            Name of iteration variable.
- *                             Will be declared in the scope of the loop.
- */
-#define cf_item_foreach(_ci, _iter) \
-       for (CONF_ITEM *_iter = fr_dlist_head(&(_ci)->children); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))
-
-/** Iterate over the contents of a list
- *
- * @param[in] _ci              to iterate over.
- * @param[in] _iter            Name of iteration variable.
- *                             Will be declared in the scope of the loop.
- * @param[in] _prev            previous pointer
- */
-#define cf_item_foreach_prev(_ci, _iter, _prev) \
-       for (CONF_ITEM *_iter = fr_dlist_next(&(_ci)->children, _prev); _iter; _iter = fr_dlist_next(&(_ci)->children, _iter))
-
 #define                cf_root(_cf) _cf_root(CF_TO_ITEM(_cf))
 CONF_SECTION   *_cf_root(CONF_ITEM const *ci);