# HG changeset patch # User Matti Hamalainen # Date 1578850205 -7200 # Node ID ef71ef9b58621de8daac2c9ef4f9568f96fac6ee # Parent 98812eb78d8ed66f8a10db04c20bb3378fff60d4 Change th_print_wrap() API and move the string argument last. diff -r 98812eb78d8e -r ef71ef9b5862 th_args.c --- 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); } } diff -r 98812eb78d8e -r ef71ef9b5862 th_args.h --- 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 }