struct dict_fixup_s {
char *filename; //!< where the "enum" was defined
int line; //!< ditto
- fr_dlist_t entry; //!< linked list of fixups
+ dict_fixup_t *next; //!< Next in the linked list of fixups.
dict_fixup_type_t type; //!< type of the fixup
fr_dict_attr_t const *parent; //!< Parent namespace.
TALLOC_CTX *fixup_pool; //!< Temporary pool for fixups, reduces holes
- fr_dlist_head_t fixups; //! various fixups
+ dict_fixup_t *fixups; //! various fixups
fr_dict_attr_t *ext_fixup; //!< Head of a list of attributes to apply fixups to.
} dict_tokenize_ctx_t;
}
fixup->line = ctx->stack[ctx->stack_depth].line;
- /*
- * Do ENUMs before CLONE.
- */
- if (type == DICT_FIXUP_ENUM) {
- fr_dlist_insert_head(&ctx->fixups, fixup);
- } else {
- fr_dlist_insert_tail(&ctx->fixups, fixup);
- }
-
+ fixup->next = ctx->fixups;
+ ctx->fixups = fixup;
return fixup;
}
static int fr_dict_finalise(dict_tokenize_ctx_t *ctx)
{
- dict_fixup_t *fixup;
+ dict_fixup_t *fixup, *next;
+
+ for (fixup = ctx->fixups; fixup != NULL; fixup = next) {
+ next = fixup->next;
- for (fixup = fr_dlist_head(&ctx->fixups);
- fixup != NULL;
- fixup = fr_dlist_next(&ctx->fixups, fixup)) {
switch (fixup->type) {
case DICT_FIXUP_ENUM: {
fr_dict_attr_t *da;
} /* switch over fixup type */
} /* loop over fixups */
- fr_dlist_init(&ctx->fixups, dict_fixup_t, entry);
+ ctx->fixups = NULL;
if (ctx->ext_fixup) {
fr_dict_attr_t *da;
*
* @todo - make a nested ctx?
*/
- if (!ctx->fixup_pool) {
- ctx->fixup_pool = talloc_pool(NULL, DICT_FIXUP_POOL_SIZE);
- fr_dlist_init(&ctx->fixups, dict_fixup_t, entry);
- }
+ if (!ctx->fixup_pool) ctx->fixup_pool = talloc_pool(NULL, DICT_FIXUP_POOL_SIZE);
// check if there's a linked library for the
memset(&ctx, 0, sizeof(ctx));
ctx.dict = dict;
ctx.fixup_pool = talloc_pool(NULL, DICT_FIXUP_POOL_SIZE);
- fr_dlist_init(&ctx.fixups, dict_fixup_t, entry);
ctx.stack[0].dict = dict;
ctx.stack[0].da = dict->root;
ctx.stack[0].nest = FR_TYPE_MAX;