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,
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
*
*/