Mercurial > hg > dmlib
changeset 2401:263093248f26
Change dmPrintWrap() API and move the string argument last.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 12 Jan 2020 19:32:29 +0200 |
parents | 01c6a5261962 |
children | b7cd5dd0b82e |
files | src/dmargs.c src/dmargs.h |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dmargs.c Sun Jan 12 19:25:52 2020 +0200 +++ b/src/dmargs.c Sun Jan 12 19:32:29 2020 +0200 @@ -186,13 +186,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 dmPrintWrap(FILE *fh, const char *str, - const int spad, int const rpad, const int width) +void dmPrintWrap(FILE *fh, const int spad, int const rpad, + const int width, const char *str) { size_t pos = 0; BOOL first = TRUE; @@ -319,7 +319,7 @@ fputs(fmtBuf, fh); dmPrintPad(fh, padWidth, ' '); - dmPrintWrap(fh, opt->desc, *lineWidth, *lineWidth, 79); + dmPrintWrap(fh, *lineWidth, *lineWidth, 79, opt->desc); } }
--- a/src/dmargs.h Sun Jan 12 19:25:52 2020 +0200 +++ b/src/dmargs.h Sun Jan 12 19:32:29 2020 +0200 @@ -53,8 +53,8 @@ void dmArgsPrintHelp(FILE *fh, const DMOptArg *opts, const int nopts, const int flags); -void dmPrintWrap(FILE *fh, const char *str, - const int spad, const int rpad, const int width); +void dmPrintWrap(FILE *fh, const int spad, const int rpad, + const int width, const char *str); #ifdef __cplusplus }