changeset 588:ef71ef9b5862

Change th_print_wrap() API and move the string argument last.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 12 Jan 2020 19:30:05 +0200
parents 98812eb78d8e
children f2aa3c809247
files th_args.c th_args.h
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/th_args.c	Sun Jan 12 18:03:47 2020 +0200
+++ b/th_args.c	Sun Jan 12 19:30:05 2020 +0200
@@ -188,13 +188,13 @@
  * Print given string indented in such a way that it is automatically
  * line-wrapped as necessary, taking hard linefeeds into account as well.
  * @param fh stdio file handle to output to
- * @param str string to output
  * @param spad starting pad/indent of the first line
  * @param rpad how much to pad the other lines
  * @param width total line width to wrap at
+ * @param str string to output
  */
-void th_print_wrap(FILE *fh, const char *str,
-    const int spad, int const rpad, const int width)
+void th_print_wrap(FILE *fh, const int spad, int const rpad,
+    const int width, const char *str)
 {
     size_t pos = 0;
     BOOL first = TRUE;
@@ -321,7 +321,7 @@
 
         fputs(fmtBuf, fh);
         th_print_pad(fh, padWidth, ' ');
-        th_print_wrap(fh, opt->desc, *lineWidth, *lineWidth, th_term_width() - 2);
+        th_print_wrap(fh, *lineWidth, *lineWidth, th_term_width() - 2, opt->desc);
     }
 }
 
--- a/th_args.h	Sun Jan 12 18:03:47 2020 +0200
+++ b/th_args.h	Sun Jan 12 19:30:05 2020 +0200
@@ -54,8 +54,8 @@
 void     th_args_help(FILE *fh, const th_optarg *opts,
          const int nopts, const int flags);
 
-void     th_print_wrap(FILE *fh, const char *str,
-         const int spad, const int rpad, const int width);
+void     th_print_wrap(FILE *fh, const int spad,
+         const int rpad, const int width, const char *str);
 
 #ifdef __cplusplus
 }