]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rename tmpl_cursor_init and tmpl_cursor_clear to tmpl_pair_cursor_init and tmpl_curso...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 6 Apr 2021 11:48:08 +0000 (12:48 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 6 Apr 2021 11:48:08 +0000 (12:48 +0100)
src/lib/server/cond_eval.c
src/lib/server/map.c
src/lib/server/map_async.c
src/lib/server/tmpl.h
src/lib/server/tmpl_eval.c
src/lib/unlang/xlat_builtin.c
src/lib/unlang/xlat_eval.c
src/modules/rlm_dhcpv4/rlm_dhcpv4.c
src/modules/rlm_expr/rlm_expr.c
src/modules/rlm_linelog/rlm_linelog.c
src/modules/rlm_smtp/rlm_smtp.c

index 8a0f2a14421cd3c5439d5d0867b923a4046d6a74..99cd5ab1ccf615f0b802502c751b4cc897ebcd10 100644 (file)
@@ -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;
 
index a8cb740e6b72ac843d06fad96d136dac30b45a2a..cd7a71b111233031217b2a2f0a09cb927b7b8a63 100644 (file)
@@ -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;
 }
index 849f4ffc9abda274dbe3268c190b3edf85499284..2a6b0b1640e3331e4665030879dfdb2de1da93ee 100644 (file)
@@ -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;
 }
index 597d45464baee853a6498e3803615e802588cb47..ef92316a769f9341c88381553f3341d32db880a9 100644 (file)
@@ -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);
index 92166fbf98cf1714b1b079e0fd8ee83e905ecf83..51a4bb35aa195aacebda9fc0675640f5f94a44bf 100644 (file)
@@ -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, "<INVALID>"));
                        }
                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;
                }
index 05de5e65c30c267278031caec44178b03a34ff47..a0328149a9c6f847b451a060fe9cedd1d1ab5c34 100644 (file)
@@ -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;
index 52c0f6563c5ad2d566253ce110c21fa404a6e108..f3aaef6fe788011d5be9565be0d04bdf90da0060 100644 (file)
@@ -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;
 }
 
index 2880ba3ca4642dc3c8a88aaf79771b084137a81a..5b254af01f1cec5650b46a24d51935a195a49cef 100644 (file)
@@ -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
index 02c3a1e8059d596d28ec9e017d18fcc67fb03813..f25741ee7c4f60bb140179a69b1764d4a8a8174e 100644 (file)
@@ -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);
index e6cebe0977c836c57365cf0c259d7705048bc3a8..59298c674b5d74f5c4affd0a8a58d254d268bca7 100644 (file)
@@ -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;
        }
index a5c70040545c10505b6a723c621dddf73ea21dbe..f86691bb409a5212c80d263cfb23d06685e4274d 100644 (file)
@@ -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;
 }