From: Nick Porter Date: Wed, 8 Feb 2023 13:45:05 +0000 (+0000) Subject: Remove unused tmpl_pair_list_name() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb5a6152a3362963305dd3f44aff0866e28fedd7;p=thirdparty%2Ffreeradius-server.git Remove unused tmpl_pair_list_name() --- diff --git a/src/lib/server/tmpl.h b/src/lib/server/tmpl.h index 3eee2a34362..e7ee89d19e4 100644 --- a/src/lib/server/tmpl.h +++ b/src/lib/server/tmpl.h @@ -1080,8 +1080,6 @@ TALLOC_CTX *tmpl_list_ctx(request_t *request, fr_dict_attr_t const *list); fr_slen_t tmpl_attr_list_from_substr(fr_dict_attr_t const **da_p, fr_sbuff_t *in) CC_HINT(nonnull); -size_t tmpl_pair_list_name(fr_dict_attr_t const **out, char const *name, fr_dict_attr_t const *default_list) CC_HINT(nonnull(1,2)); - tmpl_t *tmpl_init_printf(tmpl_t *vpt, tmpl_type_t type, fr_token_t quote, char const *fmt, ...) CC_HINT(nonnull(1,4)); tmpl_t *tmpl_init_shallow(tmpl_t *vpt, tmpl_type_t type, fr_token_t quote, diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 29ffd129911..9186073c990 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -410,80 +410,6 @@ fr_slen_t tmpl_attr_list_from_substr(fr_dict_attr_t const **da_p, fr_sbuff_t *in return 0; } -/** Resolve attribute name to a #pair_list_t value. - * - * Check the name string for #pair_list_t qualifiers and write a #pair_list_t value - * for that list to out. This value may be passed to #tmpl_pair_list, along with the current - * #request_t, to get a pointer to the actual list in the #request_t. - * - * If we can't find a string that looks like a request qualifier, set out to def, and - * return 0. - * - * @note #tmpl_pair_list_name should be called before passing a name string that may - * contain qualifiers to #fr_dict_attr_by_name. - * - * @param[out] out Where to write the list qualifier. - * @param[in] name String containing list qualifiers to parse. - * @param[in] def the list to return if no qualifiers were found. - * @return 0 if no valid list qualifier could be found, else the number of bytes consumed. - * The caller may then advanced the name pointer by the value returned, to get the - * start of the attribute name (if any). - * - * @see pair_list - * @see tmpl_pair_list - */ -size_t tmpl_pair_list_name(fr_dict_attr_t const **out, char const *name, fr_dict_attr_t const *def) -{ - char const *p = name; - char const *q; - size_t ret = 0; - - /* - * Try and determine the end of the token - */ - for (q = p; fr_dict_attr_allowed_chars[(uint8_t) *q]; q++); - - switch (*q) { - /* - * It's a bareword made up entirely of dictionary chars - * check and see if it's a list qualifier, and if it's - * not, return the def and say we couldn't parse - * anything. - */ - case '\0': - ret = tmpl_attr_list_from_substr(out, &FR_SBUFF_IN(p, (q - p))); - if (ret > 0) return ret; - *out = def; - return 0; - - /* - * It may be a list qualifier delimiter - */ - case '.': - { - char const *d = q + 1; - - if (isdigit((uint8_t) *d)) { - while (isdigit((uint8_t) *d)) d++; - - if (!fr_dict_attr_allowed_chars[(uint8_t) *d]) { - *out = def; - return 0; - } - } - - ret = tmpl_attr_list_from_substr(out, &FR_SBUFF_IN(p, (q - p))); - if (ret == 0) return 0; - - return (q + 1) - name; /* Consume the list and delimiter */ - } - - default: - *out = def; - return 0; - } -} - /** Allocate a new request reference and add it to the end of the attribute reference list * */