# HG changeset patch # User Matti Hamalainen # Date 1456845682 -7200 # Node ID ac10155d2b4ab3e485f3df032b4893b6a0655af0 # Parent f4e182720870cb81395e081faf9e5e77c2a6dc5a Rename th_optarg_t to t_optarg. API break. diff -r f4e182720870 -r ac10155d2b4a tests.c --- 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 }, diff -r f4e182720870 -r ac10155d2b4a th_args.c --- 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 diff -r f4e182720870 -r ac10155d2b4a th_args.h --- 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