]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove unused function
authorAlan T. DeKok <aland@freeradius.org>
Sat, 29 Mar 2025 19:48:20 +0000 (15:48 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 29 Mar 2025 19:48:20 +0000 (15:48 -0400)
src/lib/util/calc.c
src/lib/util/calc.h

index 12638c8e3bbee32ad544234272accb7234c5b178..a33915b4aa6ae9f7f3e324ab25b6140d3c43af7a 100644 (file)
@@ -2573,71 +2573,6 @@ int fr_value_calc_unary_op(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t op,
 
 }
 
-/** Apply a set of operations in order to create an output box.
- *
- */
-int fr_value_calc_list_op(TALLOC_CTX *ctx, fr_value_box_t *box, fr_token_t op, fr_value_box_list_t const *list)
-{
-       /*
-        *      For octets and string and prepend / append, figure out
-        *      first how long the output is, create a string that
-        *      long, and then loop assigning the values.  Doing it
-        *      this way avoids a lot of intermediate garbage.
-        */
-       if (fr_type_is_variable_size(box->type)) {
-               bool tainted = false;
-               int rcode;
-               size_t len = 0;
-               uint8_t *str, *p;
-               fr_value_box_t src;
-
-               fr_value_box_list_foreach(list, a) {
-                       if (a->type != box->type) {
-                               len = 0;
-                               break;
-                       }
-
-                       len += a->vb_length;
-               }
-
-               if (!len) goto brute_force;
-
-               if (box->type == FR_TYPE_STRING) {
-                       str = talloc_array(ctx, uint8_t, len);
-                       if (!str) return -1;
-               } else {
-                       str = talloc_array(ctx, uint8_t, len + 1);
-                       if (!str) return -1;
-
-                       str[len] = '\0';
-               }
-
-               p = str;
-               fr_value_box_list_foreach(list, a) {
-                       memcpy(p, a->vb_octets, a->vb_length);
-                       p += a->vb_length;
-                       tainted |= a->tainted;
-               }
-
-               if (box->type == FR_TYPE_STRING) {
-                       fr_value_box_bstrndup_shallow(&src, NULL, (char const *) str, len, tainted);
-               } else {
-                       fr_value_box_memdup_shallow(&src, NULL, str, len, tainted);
-               }
-
-               rcode = fr_value_calc_binary_op(ctx, box, box->type, box, op, &src);
-               talloc_free(str);
-               return rcode;
-       }
-
-brute_force:
-       fr_value_box_list_foreach(list, a) {
-               if (fr_value_calc_binary_op(ctx, box, box->type, box, op, a) < 0) return -1;
-       }
-
-       return 0;
-}
-
 /*
  *     Empty lists are empty:
  *
index 5e2ebb782a62d217d5e7f9d5b7f5fa70d57a7944..7da3d56b776ffd519204ad37df6ac23fdc4bff05 100644 (file)
@@ -40,8 +40,6 @@ int fr_value_calc_unary_op(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t op,
 
 int fr_value_calc_nary_op(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t type, fr_token_t op, fr_value_box_t const *group) CC_HINT(nonnull(2,5));
 
-int fr_value_calc_list_op(TALLOC_CTX *ctx, fr_value_box_t *box, fr_token_t op, fr_value_box_list_t const *list);
-
 int fr_value_calc_list_cmp(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_list_t const *list1, fr_token_t op, fr_value_box_list_t const *list2) CC_HINT(nonnull);
 
 #ifdef __cplusplus