]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move legacy function to the only place which uses it
authorAlan T. DeKok <aland@freeradius.org>
Fri, 15 Sep 2023 16:41:36 +0000 (12:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 15 Sep 2023 18:00:44 +0000 (14:00 -0400)
src/lib/util/pair.h
src/lib/util/pair_print.c
src/modules/rlm_detail/rlm_detail.c

index ffea04126e609dfb490917027feddc80563e79b1..5a0f59c95867edd1536b4ed58f6222fcdc2330f4 100644 (file)
@@ -831,8 +831,6 @@ static inline fr_slen_t CC_HINT(nonnull(2,4))
                fr_pair_aprint_secure(TALLOC_CTX *ctx, char **out, fr_dict_attr_t const *parent, fr_pair_t const *vp)
                SBUFF_OUT_TALLOC_FUNC_NO_LEN_DEF(fr_pair_print_secure, parent, vp)
 
-void           fr_pair_fprint(FILE *, fr_pair_t const *vp) CC_HINT(nonnull);
-
 #define                fr_pair_list_log(_log, _lvl, _list) _fr_pair_list_log(_log, _lvl, NULL, _list, __FILE__, __LINE__)
 void           _fr_pair_list_log(fr_log_t const *log, int lvl, fr_pair_t *parent,
                                  fr_pair_list_t const *list, char const *file, int line) CC_HINT(nonnull(1,4));
index 2dd0de64d75413c8268a6705b8da65e482dd3b63..db6ec888cc7313f86bb9c9f1ee466989b0da8d0d 100644 (file)
@@ -237,33 +237,6 @@ ssize_t fr_pair_list_print(fr_sbuff_t *out, fr_dict_attr_t const *parent, fr_pai
        FR_SBUFF_SET_RETURN(out, &our_out);
 }
 
-/** Print one attribute and value to FP
- *
- * Complete string with '\\t' and '\\n' is written to buffer before printing to
- * avoid issues when running with multiple threads.
- *
- * This function will print *flattened* lists, as is suitable for use
- * with rlm_detail.  In fact, the only user of this function is
- * rlm_detail.
- *
- * @param fp to output to.
- * @param vp to print.
- */
-void fr_pair_fprint(FILE *fp, fr_pair_t const *vp)
-{
-       char            buff[1024];
-       fr_sbuff_t      sbuff = FR_SBUFF_OUT(buff, sizeof(buff));
-
-       PAIR_VERIFY(vp);
-
-       (void) fr_sbuff_in_char(&sbuff, '\t');
-       (void) fr_pair_print(&sbuff, NULL, vp);
-       (void) fr_sbuff_in_char(&sbuff, '\n');
-
-       fputs(buff, fp);
-}
-
-
 static void fr_pair_list_log_sbuff(fr_log_t const *log, int lvl, fr_pair_t *parent, fr_pair_list_t const *list, char const *file, int line, fr_sbuff_t *sbuff)
 {
        fr_dict_attr_t const *parent_da = NULL;
index 60dc3e7e00dd4b03505554141901edfa01a52545..5a4024d72c8745e6a759deb1ba83c67a27e9e54e 100644 (file)
@@ -118,6 +118,32 @@ fr_dict_attr_autoload_t rlm_detail_dict_attr[] = {
        { NULL }
 };
 
+/** Print one attribute and value to FP
+ *
+ * Complete string with '\\t' and '\\n' is written to buffer before printing to
+ * avoid issues when running with multiple threads.
+ *
+ * @todo - This function should print *flattened* lists.
+ *
+ * @param fp to output to.
+ * @param vp to print.
+ */
+static void CC_HINT(nonnull) fr_pair_fprint(FILE *fp, fr_pair_t const *vp)
+{
+       char            buff[1024];
+       fr_sbuff_t      sbuff = FR_SBUFF_OUT(buff, sizeof(buff));
+
+       PAIR_VERIFY(vp);
+
+       (void) fr_sbuff_in_char(&sbuff, '\t');
+       (void) fr_pair_print(&sbuff, NULL, vp);
+       (void) fr_sbuff_in_char(&sbuff, '\n');
+
+       fputs(buff, fp);
+}
+
+
+
 /** Generic function for parsing conf pair values as int
  *
  * @note This should be used for enum types as c99 6.4.4.3 states that the enumeration