diff options
author | jbj <jbj> | 1999-11-18 17:10:15 +0000 |
---|---|---|
committer | jbj <jbj> | 1999-11-18 17:10:15 +0000 |
commit | fc99906440154ba41b09a963449fa725bf54c0c0 (patch) | |
tree | ea968194f740664a797c9797a849924d49a4ee70 /popt.h | |
parent | 1ab9a2fb53ea98630163eff2cee34b8f9d84ab11 (diff) | |
download | libpopt-fc99906440154ba41b09a963449fa725bf54c0c0.tar.gz |
From: Dick Porter <dick@acm.org> --
Here is a patch for popt to implement selective argument stripping from argv.
With this patch I can use popt in ORBit (the CORBA spec requires ORBs to
remove all ORB options from argv), which allows me to export a popt option
table to the rest of Gnome.
There is also a bug fix included where a string was realloc()d into a space
too small to hold the trailing NULL.
Diffstat (limited to 'popt.h')
-rw-r--r-- | popt.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -30,6 +30,7 @@ extern "C" { #define POPT_ARG_MASK 0x0000FFFF #define POPT_ARGFLAG_ONEDASH 0x80000000 /* allow -longoption */ #define POPT_ARGFLAG_DOC_HIDDEN 0x40000000 /* don't show in help/usage */ +#define POPT_ARGFLAG_STRIP 0x20000000 /* strip this arg from argv (only applies to long args) */ #define POPT_CBFLAG_PRE 0x80000000 /* call the callback before parse */ #define POPT_CBFLAG_POST 0x40000000 /* call the callback after parse */ #define POPT_CBFLAG_INC_DATA 0x20000000 /* use data from the include line, @@ -119,6 +120,8 @@ void poptPrintHelp(poptContext con, FILE * f, int flags); void poptPrintUsage(poptContext con, FILE * f, int flags); void poptSetOtherOptionHelp(poptContext con, const char * text); /*@observer@*/ const char * poptGetInvocationName(poptContext con); +/* shuffles argv pointers to remove stripped args, returns new argc */ +int poptStrippedArgv(poptContext con, int argc, char **argv); #ifdef __cplusplus } |