From ffd539b1c77aa18a176c1e8e8adad520eae0cf4f Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Thu, 31 Mar 2022 15:33:03 -0800 Subject: tinyrad: adding tru_verbose() --- src/tru/tinyradutil.c | 17 +++++++++++++++++ src/tru/tinyradutil.h | 7 +++++++ 2 files changed, 24 insertions(+) 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( } +int +tru_verbose( + TinyRadUtilConf * cnf, + const char * fmt, + ... ) +{ + int rc; + va_list args; + if (!(cnf->opts & TRUTILS_OPT_VERBOSE)) + return(0); + va_start(args, fmt); + rc = vprintf(fmt, args); + va_end(args); + return(rc); +} + + //-------------------------// // miscellaneous functions // //-------------------------// 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( ... ); +int +tru_verbose( + TinyRadUtilConf * cnf, + const char * fmt, + ... ); + + //--------------------------// // miscellaneous prototypes // //--------------------------// -- cgit v1.2.3