]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove fr_cond_from_map()
authorAlan T. DeKok <aland@freeradius.org>
Tue, 27 Apr 2021 10:54:15 +0000 (06:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 27 Apr 2021 10:54:15 +0000 (06:54 -0400)
it's not used by anyone

src/lib/server/cond.h
src/lib/server/cond_tokenize.c

index dbdca305a2533c54e505e5c4021e6673fa69fe9f..245edbf7214c78d1bab3a6f03ab14c53364fa135 100644 (file)
@@ -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
index 2f5cd0de51b65f65d6ad14377d1e247bc929ec92..0697bf10436706c17a8d46a232a6a1edd2903546 100644 (file)
@@ -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;
-}