From: Alan T. DeKok Date: Tue, 27 Apr 2021 10:54:15 +0000 (-0400) Subject: remove fr_cond_from_map() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bd5191f97fc181c5f9e5a6d7dd2e7dfe5cdf8f2;p=thirdparty%2Ffreeradius-server.git remove fr_cond_from_map() it's not used by anyone --- diff --git a/src/lib/server/cond.h b/src/lib/server/cond.h index dbdca305a25..245edbf7214 100644 --- a/src/lib/server/cond.h +++ b/src/lib/server/cond.h @@ -103,8 +103,6 @@ ssize_t cond_print(fr_sbuff_t *out, fr_cond_t const *c); bool fr_cond_walk(fr_cond_t *head, bool (*callback)(fr_cond_t *cond, void *uctx), void *uctx); -int fr_cond_from_map(TALLOC_CTX *ctx, fr_cond_t **head, map_t *map); - void fr_cond_async_update(fr_cond_t *cond); #ifdef __cplusplus diff --git a/src/lib/server/cond_tokenize.c b/src/lib/server/cond_tokenize.c index 2f5cd0de51b..0697bf10436 100644 --- a/src/lib/server/cond_tokenize.c +++ b/src/lib/server/cond_tokenize.c @@ -1686,35 +1686,3 @@ void fr_cond_async_update(fr_cond_t *c) c = c->next; } } - -/** Convert a single map to a condition. - * - * @param ctx the talloc context where the condition is allocated - * @param[out] head the newly allocated condition. Should only be one! - * @param[in] map the map to convert. MAY be freed. - * @return - * - <0 on error "map" is untouched. - * - 0 on success - "map" MAY be freed - */ -int fr_cond_from_map(TALLOC_CTX *ctx, fr_cond_t **head, map_t *map) -{ - fr_cond_t *cond = talloc_zero(ctx, fr_cond_t); - - if (!cond) return -1; - - cond->type = COND_TYPE_MAP; - cond->data.map = map; - - if (cond_normalise(ctx, T_BARE_WORD, &cond) < 0) return -1; - - /* - * If the condition is still a MAP, then make the map - * owned by the condition. - */ - if (cond->type == COND_TYPE_MAP) { - (void) talloc_steal(cond, map); - } - - *head = cond; - return 0; -}