From 07f86a3d78720f616c5417da8b937e0d7691072d Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Wed, 7 Jun 2017 00:24:14 +0100 Subject: Updated libarg --- extlibs/arg.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- extlibs/arg.h | 2 +- 2 files changed, 56 insertions(+), 6 deletions(-) (limited to 'extlibs') diff --git a/extlibs/arg.c b/extlibs/arg.c index 7a34641..2a35b60 100644 --- a/extlibs/arg.c +++ b/extlibs/arg.c @@ -291,15 +291,65 @@ arg_t* arg_load( int argc, char **argv, def_arg *argl ) i++; } - //printf("arg "); - for (i=1;iptr = ((s_arg_val *)argl[i].def)->default_ptr; + ((s_arg_val *)argl[i].def)->result = val; + break; + } + case ARGT_FLAG: + { + printf("FLAG default\n"); + arg_flag *flag= __create_arg( argl[i].type, argl[i].def ); + //flag->flag = ((s_arg_flag *)argl[i].def)->flag; + flag->flag = 0; + ((s_arg_flag *)argl[i].def)->result = flag; + break; + } + default: { - //printf("%d ",i); + printf("Unknown type\n"); } + } + } + + i++; } - //printf("\n"); free(used); diff --git a/extlibs/arg.h b/extlibs/arg.h index 98c4681..dc11f47 100644 --- a/extlibs/arg.h +++ b/extlibs/arg.h @@ -200,7 +200,7 @@ typedef struct arg_flag typedef struct s_arg_flag { int used; - int flag; + int flag; //do we need it? arg_flag *result; } s_arg_flag; -- cgit v1.2.3