data-out: Clarify the meaning of the 'encoding' parameter.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 27 May 2018 00:50:20 +0000 (17:50 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 26 Nov 2018 00:25:19 +0000 (16:25 -0800)
Signed-off-by: Ben Pfaff <blp@cs.stanford.edu>
src/data/data-out.c
src/data/data-out.h

index c6e793bd71488ef8a7c85997ce879ad61329dcc9..cb21600a72962bdddcb47eda87dd494db913e7da 100644 (file)
@@ -157,21 +157,21 @@ binary_to_utf8 (const char *in, struct pool *pool)
    VALUE must be the correct width for FORMAT, that is, its width must be
    fmt_var_width(FORMAT).
 
-   ENCODING must be the encoding of INPUT.  Normally this can be obtained by
-   calling dict_get_encoding() on the dictionary with which INPUT is
-   associated.  ENCODING is only important when FORMAT's type is FMT_A.
+   INPUT_ENCODING must be the encoding of INPUT.  Normally this can be obtained
+   by calling dict_get_encoding() on the dictionary with which INPUT is
+   associated.  INPUT_ENCODING is only important when FORMAT's type is FMT_A.
 
    The return value is dynamically allocated, and must be freed by the caller.
    If POOL is non-null, then the return value is allocated on that pool.  */
 char *
-data_out_pool (const union value *input, const char *encoding,
+data_out_pool (const union value *input, const char *input_encoding,
               const struct fmt_spec *format, struct pool *pool)
 {
   assert (fmt_check_output (format));
   if (format->type == FMT_A)
     {
       char *in = CHAR_CAST (char *, value_str (input, format->w));
-      return recode_string_pool (UTF8, encoding, in, format->w, pool);
+      return recode_string_pool (UTF8, input_encoding, in, format->w, pool);
     }
   else if (fmt_get_category (format->type) == FMT_CAT_BINARY)
     {
@@ -224,9 +224,10 @@ data_out_stretchy (const union value *input, const char *encoding,
 }
 
 char *
-data_out (const union value *input, const char *encoding, const struct fmt_spec *format)
+data_out (const union value *input, const char *input_encoding,
+          const struct fmt_spec *format)
 {
-  return data_out_pool (input, encoding, format, NULL);
+  return data_out_pool (input, input_encoding, format, NULL);
 }
 
 \f
index b18d067436fbb9b95a3cc5a9043ea20560b26632..65ac60544fffd6bc065c6b18633c222183d8be5b 100644 (file)
@@ -25,11 +25,14 @@ struct fmt_spec;
 struct string;
 union value;
 
-char * data_out (const union value *, const char *encoding, const struct fmt_spec *);
+char *data_out (const union value *input, const char *input_encoding,
+                const struct fmt_spec *);
 
-char * data_out_pool (const union value *, const char *encoding, const struct fmt_spec *, struct pool *pool);
+char *data_out_pool (const union value *input, const char *input_encoding,
+                     const struct fmt_spec *, struct pool *pool);
 
-char *data_out_stretchy (const union value *, const char *encoding, const struct fmt_spec *, struct pool *);
+char *data_out_stretchy (const union value *input, const char *input_encoding,
+                         const struct fmt_spec *, struct pool *);
 
 void data_out_recode (const union value *input, const char *input_encoding,
                       const struct fmt_spec *,