Mercurial > hg > th-libs
changeset 380:ac10155d2b4a
Rename th_optarg_t to t_optarg. API break.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 01 Mar 2016 17:21:22 +0200 |
parents | f4e182720870 |
children | 4e7e0a74e73e |
files | tests.c th_args.c th_args.h |
diffstat | 3 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/tests.c Tue Mar 01 17:18:58 2016 +0200 +++ b/tests.c Tue Mar 01 17:21:22 2016 +0200 @@ -36,7 +36,7 @@ // Define option arguments -static const th_optarg_t arg_opts[] = +static const th_optarg arg_opts[] = { { 0, '?', "help", "Show this help", OPT_NONE }, { 1, 'v', "verbose", "Be more verbose", OPT_NONE },
--- a/th_args.c Tue Mar 01 17:18:58 2016 +0200 +++ b/th_args.c Tue Mar 01 17:21:22 2016 +0200 @@ -17,17 +17,17 @@ static BOOL th_args_process_opt( char *currArg, int *argIndex, int argc, char *argv[], - const th_optarg_t opts[], int nopts, + const th_optarg opts[], int nopts, BOOL (*handle_option)(int id, char *, char *), BOOL doProcess, BOOL isLong) { - const th_optarg_t *opt = NULL; + const th_optarg *opt = NULL; char *optArg = NULL; int optIndex; for (optIndex = 0; optIndex < nopts; optIndex++) { - const th_optarg_t *node = &opts[optIndex]; + const th_optarg *node = &opts[optIndex]; if (isLong && node->o_long != NULL) { if (strcmp(currArg, node->o_long) == 0) @@ -99,7 +99,7 @@ * calling the given callback functions. */ BOOL th_args_process(int argc, char *argv[], - const th_optarg_t *opts, const int nopts, + const th_optarg *opts, const int nopts, BOOL(*handle_option)(int id, char *, char *), BOOL(*handle_other)(char *), const int flags) { @@ -160,7 +160,7 @@ /* Print help for commandline arguments/options */ void th_args_help(FILE *fh, - const th_optarg_t *opts, const int nopts, + const th_optarg *opts, const int nopts, const int flags) { int index; @@ -169,7 +169,7 @@ // Print out option list for (index = 0; index < nopts; index++) { - const th_optarg_t *opt = &opts[index]; + const th_optarg *opt = &opts[index]; char tmpStr[128]; // Print short option
--- a/th_args.h Tue Mar 01 17:18:58 2016 +0200 +++ b/th_args.h Tue Mar 01 17:21:22 2016 +0200 @@ -36,15 +36,15 @@ char *o_long; char *desc; int flags; -} th_optarg_t; +} th_optarg; BOOL th_args_process(int argc, char *argv[], - const th_optarg_t *opts, const int nopts, + const th_optarg *opts, const int nopts, BOOL (*handle_option)(int id, char *, char *), BOOL (*handle_other)(char *), const int flags); -void th_args_help(FILE *, const th_optarg_t *opts, +void th_args_help(FILE *, const th_optarg *opts, const int nopts, const int flags); #ifdef __cplusplus