From: Arran Cudbard-Bell Date: Tue, 6 Apr 2021 11:48:08 +0000 (+0100) Subject: Rename tmpl_cursor_init and tmpl_cursor_clear to tmpl_pair_cursor_init and tmpl_curso... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae4ebaef9f32e0b56e41983f67e321a227b715f5;p=thirdparty%2Ffreeradius-server.git Rename tmpl_cursor_init and tmpl_cursor_clear to tmpl_pair_cursor_init and tmpl_cursor_pair_clear --- diff --git a/src/lib/server/cond_eval.c b/src/lib/server/cond_eval.c index 8a0f2a1442..99cd5ab1cc 100644 --- a/src/lib/server/cond_eval.c +++ b/src/lib/server/cond_eval.c @@ -528,7 +528,7 @@ static int cond_compare_attrs(request_t *request, fr_value_box_t *lhs, map_t con rhs = NULL; /* shut up clang scan */ fr_value_box_clear(&rhs_cast); - for (vp = tmpl_cursor_init(&rcode, request, &cc, &cursor, request, map->rhs); + for (vp = tmpl_pair_cursor_init(&rcode, request, &cc, &cursor, request, map->rhs); vp; vp = fr_dcursor_next(&cursor)) { if (cond_realize_attr(request, &rhs, &rhs_cast, map->rhs, vp, da) < 0) { @@ -546,7 +546,7 @@ static int cond_compare_attrs(request_t *request, fr_value_box_t *lhs, map_t con if (rcode != 0) break; } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return rcode; } @@ -564,7 +564,7 @@ static int cond_compare_virtual(request_t *request, map_t const *map) rhs = NULL; /* shut up clang scan */ fr_value_box_clear(&rhs_cast); - for (vp = tmpl_cursor_init(&rcode, request, &cc, &cursor, request, map->rhs); + for (vp = tmpl_pair_cursor_init(&rcode, request, &cc, &cursor, request, map->rhs); vp; vp = fr_dcursor_next(&cursor)) { if (cond_realize_attr(request, &rhs, &rhs_cast, map->rhs, vp, NULL) < 0) { @@ -588,7 +588,7 @@ static int cond_compare_virtual(request_t *request, map_t const *map) if (rcode != 0) break; } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return rcode; } @@ -757,7 +757,7 @@ check_attrs: fr_assert(!lhs); - for (vp = tmpl_cursor_init(&rcode, request, &cc, &cursor, request, map->lhs); + for (vp = tmpl_pair_cursor_init(&rcode, request, &cc, &cursor, request, map->lhs); vp; vp = fr_dcursor_next(&cursor)) { fr_value_box_t lhs_cast; @@ -818,7 +818,7 @@ check_attrs: continue; } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); } break; diff --git a/src/lib/server/map.c b/src/lib/server/map.c index a8cb740e6b..cd7a71b111 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -1332,7 +1332,7 @@ int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t f * the dst_list and vp pointing to the attribute or the VP * being NULL (no attribute at that index). */ - dst = tmpl_cursor_init(NULL, tmp_ctx, &cc, &dst_list, request, map->lhs); + dst = tmpl_pair_cursor_init(NULL, tmp_ctx, &cc, &dst_list, request, map->lhs); /* * The destination is an attribute */ @@ -1630,7 +1630,7 @@ update: fr_assert(fr_pair_list_empty(&src_list)); finish: - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); talloc_free(tmp_ctx); return rcode; } diff --git a/src/lib/server/map_async.c b/src/lib/server/map_async.c index 849f4ffc9a..2a6b0b1640 100644 --- a/src/lib/server/map_async.c +++ b/src/lib/server/map_async.c @@ -552,7 +552,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, * Check we have pairs to copy *before* * doing any expensive allocations. */ - vp = tmpl_cursor_init(&err, request, &cc_attr, &from, request, mutated->rhs); + vp = tmpl_pair_cursor_init(&err, request, &cc_attr, &from, request, mutated->rhs); if (!vp) switch (err) { default: break; @@ -564,20 +564,20 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, * we should delete all LHS attributes. */ if (mutated->op == T_OP_SET) n = list_mod_delete_afrom_map(ctx, original, mutated); - tmpl_cursor_clear(&cc_attr); + tmpl_pair_cursor_clear(&cc_attr); goto finish; case -2: /* No matching list */ case -3: /* No request context */ case -4: /* memory allocation error */ RPEDEBUG("Failed resolving attribute source"); - tmpl_cursor_clear(&cc_attr); + tmpl_pair_cursor_clear(&cc_attr); goto error; } n = list_mod_generic_afrom_map(ctx, original, mutated); if (!n) { - tmpl_cursor_clear(&cc_attr); + tmpl_pair_cursor_clear(&cc_attr); goto error; } @@ -589,7 +589,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, attr_error: fr_dcursor_head(&values); fr_dcursor_free_list(&values); - tmpl_cursor_clear(&cc_attr); + tmpl_pair_cursor_clear(&cc_attr); goto error; } @@ -607,7 +607,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out, fr_dcursor_append(&values, n_vb); } while ((vp = fr_dcursor_next(&from))); - tmpl_cursor_clear(&cc_attr); + tmpl_pair_cursor_clear(&cc_attr); } break; @@ -1097,7 +1097,7 @@ int map_list_mod_apply(request_t *request, vp_list_mod_t const *vlm) * the list and vp pointing to the attribute or the VP * being NULL (no attribute at that index). */ - found = tmpl_cursor_init(NULL, request, &cc, &list, request, mod->lhs); + found = tmpl_pair_cursor_init(NULL, request, &cc, &list, request, mod->lhs); /* * The destination is an attribute @@ -1303,6 +1303,6 @@ int map_list_mod_apply(request_t *request, vp_list_mod_t const *vlm) } finish: - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return rcode; } diff --git a/src/lib/server/tmpl.h b/src/lib/server/tmpl.h index 597d45464b..ef92316a76 100644 --- a/src/lib/server/tmpl.h +++ b/src/lib/server/tmpl.h @@ -45,7 +45,7 @@ * functions which can be used to iterate over only the #fr_pair_t that match a * tmpl_t in a given list. * - * @see tmpl_cursor_init + * @see tmpl_pair_cursor_init * @see tmpl_cursor_next * * Or for simplicity, there are functions which wrap the cursor functions, to copy or @@ -715,17 +715,17 @@ void tmpl_verify(char const *file, int line, tmpl_t const *vpt); fr_pair_t *vp; // Iterate over all pairs in the request list - for (vp = tmpl_cursor_init(NULL, &cursor, request, &list); + for (vp = tmpl_pair_cursor_init(NULL, &cursor, request, &list); vp; vp = tmpl_cursor_next(&cursor, &list)) { // Do something } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); @endcode * * @param _request to locate the list in. * @param _list to set as the target for the template. - * @see tmpl_cursor_init + * @see tmpl_pair_cursor_init * @see tmpl_cursor_next */ #define tmpl_init_initialiser_list(_request, _list)\ @@ -983,11 +983,11 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out, fr_type_t dst_type) CC_HINT(nonnull (2, 3, 4)); -fr_pair_t *tmpl_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, +fr_pair_t *tmpl_pair_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, fr_dcursor_t *cursor, request_t *request, tmpl_t const *vpt); -void tmpl_cursor_clear(tmpl_cursor_ctx_t *cc); +void tmpl_pair_cursor_clear(tmpl_cursor_ctx_t *cc); int tmpl_copy_pairs(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, tmpl_t const *vpt); diff --git a/src/lib/server/tmpl_eval.c b/src/lib/server/tmpl_eval.c index 92166fbf98..51a4bb35aa 100644 --- a/src/lib/server/tmpl_eval.c +++ b/src/lib/server/tmpl_eval.c @@ -43,7 +43,7 @@ RCSID("$Id$") * name couldn't be resolved. * @return a pointer to the HEAD of a list in the #request_t. * - * @see tmpl_cursor_init + * @see tmpl_pair_cursor_init */ fr_pair_list_t *tmpl_list_head(request_t *request, tmpl_pair_list_t list) { @@ -1097,7 +1097,7 @@ fr_pair_t *_tmpl_cursor_eval(fr_dlist_head_t *list_head, fr_pair_t *curr, tmpl_c } static inline CC_HINT(always_inline) -void _tmpl_cursor_init(TALLOC_CTX *list_ctx, fr_pair_list_t *list, tmpl_attr_t const *ar, tmpl_cursor_ctx_t *cc) +void _tmpl_pair_cursor_init(TALLOC_CTX *list_ctx, fr_pair_list_t *list, tmpl_attr_t const *ar, tmpl_cursor_ctx_t *cc) { if (fr_dlist_next(&cc->vpt->data.attribute.ar, ar)) switch (ar->ar_da->type) { case FR_TYPE_TLV: @@ -1149,7 +1149,7 @@ static void *_tmpl_cursor_next(fr_dlist_head_t *list, void *curr, void *uctx) ar = fr_dlist_next(&vpt->data.attribute.ar, ar); if (ar) { list_head = &vp->vp_group; - _tmpl_cursor_init(vp, list_head, ar, cc); + _tmpl_pair_cursor_init(vp, list_head, ar, cc); curr = fr_pair_list_head(list_head); list = &list_head->head; continue; @@ -1205,8 +1205,8 @@ static void *_tmpl_cursor_next(fr_dlist_head_t *list, void *curr, void *uctx) * * @see tmpl_cursor_next */ -fr_pair_t *tmpl_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, - fr_dcursor_t *cursor, request_t *request, tmpl_t const *vpt) +fr_pair_t *tmpl_pair_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, + fr_dcursor_t *cursor, request_t *request, tmpl_t const *vpt) { fr_pair_t *vp = NULL; fr_pair_list_t *list_head; @@ -1230,7 +1230,7 @@ fr_pair_t *tmpl_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, fr_table_str_by_value(tmpl_request_ref_table, rr->request, "")); } error: - memset(cc, 0, sizeof(*cc)); /* so tmpl_cursor_clear doesn't explode */ + memset(cc, 0, sizeof(*cc)); /* so tmpl_pair_cursor_clear doesn't explode */ return NULL; } } @@ -1265,7 +1265,7 @@ fr_pair_t *tmpl_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, */ switch (vpt->type) { case TMPL_TYPE_ATTR: - _tmpl_cursor_init(list_ctx, cc->list, fr_dlist_head(&vpt->data.attribute.ar), cc); + _tmpl_pair_cursor_init(list_ctx, cc->list, fr_dlist_head(&vpt->data.attribute.ar), cc); break; case TMPL_TYPE_LIST: @@ -1299,7 +1299,7 @@ fr_pair_t *tmpl_cursor_init(int *err, TALLOC_CTX *ctx, tmpl_cursor_ctx_t *cc, /** Clear any temporary state allocations * */ -void tmpl_cursor_clear(tmpl_cursor_ctx_t *cc) +void tmpl_pair_cursor_clear(tmpl_cursor_ctx_t *cc) { if (!fr_dlist_num_elements(&cc->nested)) return;/* Help simplify dealing with unused cursor ctxs */ @@ -1340,7 +1340,7 @@ int tmpl_copy_pairs(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, tm fr_assert(tmpl_is_attr(vpt) || tmpl_is_list(vpt)); - for (vp = tmpl_cursor_init(&err, NULL, &cc, &from, request, vpt); + for (vp = tmpl_pair_cursor_init(&err, NULL, &cc, &from, request, vpt); vp; vp = fr_dcursor_next(&from)) { vp = fr_pair_copy(ctx, vp); @@ -1352,7 +1352,7 @@ int tmpl_copy_pairs(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, tm } fr_pair_append(out, vp); } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return err; } @@ -1387,7 +1387,7 @@ int tmpl_copy_pair_children(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *req fr_pair_list_free(out); - for (vp = tmpl_cursor_init(&err, NULL, &cc, &from, request, vpt); + for (vp = tmpl_pair_cursor_init(&err, NULL, &cc, &from, request, vpt); vp; vp = fr_dcursor_next(&from)) { switch (vp->da->type) { @@ -1403,7 +1403,7 @@ int tmpl_copy_pair_children(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *req } } done: - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return err; } @@ -1432,8 +1432,8 @@ int tmpl_find_vp(fr_pair_t **out, request_t *request, tmpl_t const *vpt) TMPL_VERIFY(vpt); - vp = tmpl_cursor_init(&err, request, &cc, &cursor, request, vpt); - tmpl_cursor_clear(&cc); + vp = tmpl_pair_cursor_init(&err, request, &cc, &cursor, request, vpt); + tmpl_pair_cursor_clear(&cc); if (out) *out = vp; @@ -1464,8 +1464,8 @@ int tmpl_find_or_add_vp(fr_pair_t **out, request_t *request, tmpl_t const *vpt) *out = NULL; - vp = tmpl_cursor_init(&err, NULL, &cc, &cursor, request, vpt); - tmpl_cursor_clear(&cc); + vp = tmpl_pair_cursor_init(&err, NULL, &cc, &cursor, request, vpt); + tmpl_pair_cursor_clear(&cc); switch (err) { case 0: @@ -1611,7 +1611,7 @@ int tmpl_extents_find(TALLOC_CTX *ctx, /* * Prime the stack! */ - _tmpl_cursor_init(list_ctx, cc.list, fr_dlist_head(&vpt->data.attribute.ar), &cc); + _tmpl_pair_cursor_init(list_ctx, cc.list, fr_dlist_head(&vpt->data.attribute.ar), &cc); /* * - Continue until there are no evaluation contexts @@ -1646,7 +1646,7 @@ int tmpl_extents_find(TALLOC_CTX *ctx, ar = n_ar; list_head = &curr->vp_group; list_ctx = curr; /* Allocations are under the group */ - _tmpl_cursor_init(list_ctx, list_head, ar, &cc); + _tmpl_pair_cursor_init(list_ctx, list_head, ar, &cc); curr = fr_pair_list_head(list_head); continue; } diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 05de5e65c3..a0328149a9 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -865,7 +865,7 @@ static xlat_action_t xlat_func_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcur RIDEBUG("Attributes matching \"%s\"", fmt); RINDENT(); - for (vp = tmpl_cursor_init(NULL, NULL, &cc, &cursor, request, vpt); + for (vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &cursor, request, vpt); vp; vp = fr_dcursor_next(&cursor)) { fr_dict_vendor_t const *vendor; @@ -950,7 +950,7 @@ static xlat_action_t xlat_func_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcur talloc_free(dst); } } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); REXDENT(); talloc_free(vpt); @@ -2089,7 +2089,7 @@ static xlat_action_t xlat_func_pairs(TALLOC_CTX *ctx, fr_dcursor_t *out, return XLAT_ACTION_FAIL; } - for (vp = tmpl_cursor_init(NULL, NULL, &cc, &cursor, request, vpt); + for (vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &cursor, request, vpt); vp; vp = fr_dcursor_next(&cursor)) { fr_token_t op = vp->op; @@ -2106,7 +2106,7 @@ static xlat_action_t xlat_func_pairs(TALLOC_CTX *ctx, fr_dcursor_t *out, fr_dcursor_append(out, vb); } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); talloc_free(vpt); return XLAT_ACTION_DONE; diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 52c0f6563c..f3aaef6fe7 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -826,7 +826,7 @@ static xlat_action_t xlat_eval_pair_real(TALLOC_CTX *ctx, fr_dcursor_t *out, req * This allows users to manipulate virtual attributes as if * they were real ones. */ - vp = tmpl_cursor_init(NULL, NULL, &cc, &cursor, request, vpt); + vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &cursor, request, vpt); /* * We didn't find the VP in a list, check to see if it's @@ -900,7 +900,7 @@ static xlat_action_t xlat_eval_pair_real(TALLOC_CTX *ctx, fr_dcursor_t *out, req default: /* * The cursor was set to the correct - * position above by tmpl_cursor_init. + * position above by tmpl_pair_cursor_init. */ vp = fr_dcursor_current(&cursor); /* NULLness checked above */ value = fr_value_box_alloc(ctx, vp->data.type, vp->da, vp->data.tainted); @@ -913,7 +913,7 @@ static xlat_action_t xlat_eval_pair_real(TALLOC_CTX *ctx, fr_dcursor_t *out, req } done: - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return ret; } diff --git a/src/modules/rlm_dhcpv4/rlm_dhcpv4.c b/src/modules/rlm_dhcpv4/rlm_dhcpv4.c index 2880ba3ca4..5b254af01f 100644 --- a/src/modules/rlm_dhcpv4/rlm_dhcpv4.c +++ b/src/modules/rlm_dhcpv4/rlm_dhcpv4.c @@ -174,7 +174,7 @@ static xlat_action_t dhcpv4_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, MEM(cursor = talloc(ctx, fr_dcursor_t)); talloc_steal(cursor, vpt); - vp = tmpl_cursor_init(NULL, NULL, &cc, cursor, request, vpt); + vp = tmpl_pair_cursor_init(NULL, NULL, &cc, cursor, request, vpt); if (!vp) return XLAT_ACTION_DONE; /* Nothing to encode */ @@ -186,13 +186,13 @@ static xlat_action_t dhcpv4_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, if (len < 0) { RPEDEBUG("DHCP option encoding failed"); talloc_free(cursor); - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return XLAT_ACTION_FAIL; } p += len; } talloc_free(cursor); - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); /* * Pass the options string back diff --git a/src/modules/rlm_expr/rlm_expr.c b/src/modules/rlm_expr/rlm_expr.c index 02c3a1e805..f25741ee7c 100644 --- a/src/modules/rlm_expr/rlm_expr.c +++ b/src/modules/rlm_expr/rlm_expr.c @@ -244,7 +244,7 @@ static bool get_number(request_t *request, char const **string, int64_t *answer) } x = 0; - for (i = 0, vp = tmpl_cursor_init(&err, NULL, &cc, &cursor, request, vpt); + for (i = 0, vp = tmpl_pair_cursor_init(&err, NULL, &cc, &cursor, request, vpt); (i < max) && (vp != NULL); i++, vp = fr_dcursor_next(&cursor)) { int64_t y; @@ -255,7 +255,7 @@ static bool get_number(request_t *request, char const **string, int64_t *answer) RPEDEBUG("Failed converting &%.*s to an integer value", (int) vpt->len, vpt->name); error: - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return false; } if (value.vb_uint64 > INT64_MAX) { @@ -291,7 +291,7 @@ static bool get_number(request_t *request, char const **string, int64_t *answer) x += y; } /* loop over all found VPs */ - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); if (err != 0) { RWDEBUG("Can't find &%.*s. Using 0 as operand value", (int)vpt->len, vpt->name); diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index e6cebe0977..59298c674b 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -568,7 +568,7 @@ build_vector: int alloced = VECTOR_INCREMENT, i; MEM(vector = talloc_array(request, struct iovec, alloced)); - for (vp = tmpl_cursor_init(NULL, NULL, &cc, &cursor, request, vpt_p), i = 0; + for (vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &cursor, request, vpt_p), i = 0; vp; vp = fr_dcursor_next(&cursor), i++) { /* need extra for line terminator */ @@ -600,7 +600,7 @@ build_vector: vector[i].iov_len = inst->delimiter_len; } } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); vector_p = vector; vector_len = i; } diff --git a/src/modules/rlm_smtp/rlm_smtp.c b/src/modules/rlm_smtp/rlm_smtp.c index a5c7004054..f86691bb40 100644 --- a/src/modules/rlm_smtp/rlm_smtp.c +++ b/src/modules/rlm_smtp/rlm_smtp.c @@ -225,14 +225,14 @@ static int tmpl_attr_to_slist(fr_mail_ctx *uctx, struct curl_slist **out, tmpl_t int count = 0; /* Iterate over the VP and add the string value to the curl_slist */ - vp = tmpl_cursor_init(NULL, NULL, &cc, &uctx->cursor, request, tmpl); + vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &uctx->cursor, request, tmpl); while (vp) { count += 1; *out = curl_slist_append(*out, vp->vp_strvalue); vp = fr_dcursor_next(&uctx->cursor); } /* Return the number of elements that were found */ - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return count; } @@ -274,7 +274,7 @@ static ssize_t tmpl_attr_to_sbuff (fr_mail_ctx *uctx, fr_sbuff_t *out, tmpl_t co ssize_t copied = 0; /* Loop through the elements to be added to the sbuff */ - vp = tmpl_cursor_init(NULL, NULL, &cc, &uctx->cursor, uctx->request, vpt); + vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &uctx->cursor, uctx->request, vpt); while (vp) { copied += fr_sbuff_in_bstrncpy(out, vp->vp_strvalue, vp->vp_length); vp = fr_dcursor_next(&uctx->cursor); @@ -283,7 +283,7 @@ static ssize_t tmpl_attr_to_sbuff (fr_mail_ctx *uctx, fr_sbuff_t *out, tmpl_t co copied += fr_sbuff_in_strcpy(out, delimeter); } } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return copied; } @@ -383,7 +383,7 @@ static int tmpl_attr_to_attachment (fr_mail_ctx *uctx, curl_mime *mime, const tm int attachments_set = 0; /* Check for any file attachments */ - for( vp = tmpl_cursor_init(NULL, NULL, &cc, &uctx->cursor, request, tmpl); + for( vp = tmpl_pair_cursor_init(NULL, NULL, &cc, &uctx->cursor, request, tmpl); vp; vp = fr_dcursor_next(&uctx->cursor)){ if(vp->vp_tainted) { @@ -392,7 +392,7 @@ static int tmpl_attr_to_attachment (fr_mail_ctx *uctx, curl_mime *mime, const tm } attachments_set += str_to_attachments(uctx, mime, vp->vp_strvalue, vp->vp_length, path_buffer, m); } - tmpl_cursor_clear(&cc); + tmpl_pair_cursor_clear(&cc); return attachments_set; }