diff options
| author | David M. Syzdek <david@syzdek.net> | 2022-03-31 15:33:03 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2022-03-31 15:33:03 -0800 |
| commit | ffd539b1c77aa18a176c1e8e8adad520eae0cf4f (patch) | |
| tree | d946a529b5830c738891541aa1dcc198860d45e3 /src | |
| parent | a10b176def2447563f5f5e6f0ddbad4044045e02 (diff) | |
| download | tinyrad-ffd539b1c77aa18a176c1e8e8adad520eae0cf4f.tar.gz tinyrad-ffd539b1c77aa18a176c1e8e8adad520eae0cf4f.tar.bz2 tinyrad-ffd539b1c77aa18a176c1e8e8adad520eae0cf4f.tar.xz tinyrad-ffd539b1c77aa18a176c1e8e8adad520eae0cf4f.zip | |
tinyrad: adding tru_verbose()
Diffstat (limited to 'src')
| -rw-r--r-- | src/tru/tinyradutil.c | 17 | ||||
| -rw-r--r-- | src/tru/tinyradutil.h | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/tru/tinyradutil.c b/src/tru/tinyradutil.c index 05f3b89..edbc996 100644 --- a/src/tru/tinyradutil.c +++ b/src/tru/tinyradutil.c | |||
| @@ -294,6 +294,23 @@ tru_printf( | |||
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | 296 | ||
| 297 | int | ||
| 298 | tru_verbose( | ||
| 299 | TinyRadUtilConf * cnf, | ||
| 300 | const char * fmt, | ||
| 301 | ... ) | ||
| 302 | { | ||
| 303 | int rc; | ||
| 304 | va_list args; | ||
| 305 | if (!(cnf->opts & TRUTILS_OPT_VERBOSE)) | ||
| 306 | return(0); | ||
| 307 | va_start(args, fmt); | ||
| 308 | rc = vprintf(fmt, args); | ||
| 309 | va_end(args); | ||
| 310 | return(rc); | ||
| 311 | } | ||
| 312 | |||
| 313 | |||
| 297 | //-------------------------// | 314 | //-------------------------// |
| 298 | // miscellaneous functions // | 315 | // miscellaneous functions // |
| 299 | //-------------------------// | 316 | //-------------------------// |
diff --git a/src/tru/tinyradutil.h b/src/tru/tinyradutil.h index 9fbaf8d..641d304 100644 --- a/src/tru/tinyradutil.h +++ b/src/tru/tinyradutil.h | |||
| @@ -201,6 +201,13 @@ tru_printf( | |||
| 201 | ... ); | 201 | ... ); |
| 202 | 202 | ||
| 203 | 203 | ||
| 204 | int | ||
| 205 | tru_verbose( | ||
| 206 | TinyRadUtilConf * cnf, | ||
| 207 | const char * fmt, | ||
| 208 | ... ); | ||
| 209 | |||
| 210 | |||
| 204 | //--------------------------// | 211 | //--------------------------// |
| 205 | // miscellaneous prototypes // | 212 | // miscellaneous prototypes // |
| 206 | //--------------------------// | 213 | //--------------------------// |
