diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:38:28 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:38:28 +0000 |
commit | 367c9cb514c9da766488b9bdb218a18e31cb7624 (patch) | |
tree | f9e343be94161a4837f0f1c1d072a35538ae0f63 /lib/util/shhopt.h | |
parent | 6e88e3326cb0c7f7975b56189278cab3f84ba1bd (diff) | |
download | netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.gz netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.xz netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.zip |
Promote Stable (10.47) to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2691 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/util/shhopt.h')
-rw-r--r-- | lib/util/shhopt.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/util/shhopt.h b/lib/util/shhopt.h index 0c3c3ba4..99096a76 100644 --- a/lib/util/shhopt.h +++ b/lib/util/shhopt.h @@ -1,4 +1,4 @@ -/*============================================================================== +/*============================================================================= HERE IS AN EXAMPLE OF THE USE OF SHHOPT: @@ -6,6 +6,8 @@ HERE IS AN EXAMPLE OF THE USE OF SHHOPT: int main ( int argc, char **argv ) { + // initial values here are just to demonstrate what gets set and + // what doesn't by the code below. int help_flag = 7; unsigned int help_spec =7; unsigned int height_spec =7; @@ -186,12 +188,13 @@ typedef struct { /* OPTENT3 is the same as OPTENTRY except that it also sets the "specified" element of the table entry (so it assumes OPTION_DEF is a table of - optEntry instead of optStruct). + optEntry instead of optStruct). It sets it to the number of times that + the option appears in the command line. Here is an example: unsigned int option_def_index = 0; - optEntry *option_def = malloc(100*sizeof(optEntry)); + MALLOCARRAY_NOFAIL(option_def, 100); OPTENT3('h', "help", OPT_FLAG, &help_flag, 0); OPTENT3(0, "alphaout", OPT_STRING, &alpha_filename, 0); */ @@ -229,14 +232,4 @@ optDestroyNameValueList(struct optNameValue * const list); } #endif -/* Here's a hack to help us introduce pm_c_util.h. That should be - #included in nearly every Netpbm program, but we're too lazy to insert - it into hundreds of files right now. But shhopt.h is included into - most of those files, so we #include it here! - - Before 2005.12.03, the stuff that is now in pm_c_util.h was in pm.h, - but that's a bad place for it because pm.h is an external header file. -*/ -#include "pm_c_util.h" - #endif |