*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed August 3, 2014 at 10:44:46 AM by AutoGen 5.18.4pre11
+ * It has been AutoGen-ed
* From the definitions funcs.def
* and the template file options_h
*
* This file defines all the global structures and special values
* used in the automated option processing library.
*
- * Automated Options Copyright (C) 1992-2014 by Bruce Korb
+ * Automated Options Copyright (C) 1992-2015 by Bruce Korb
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
*/
#define AO_EXIT_REQ_USAGE 10064
+#undef VOIDP
+/**
+ * Coerce a value into a void pointer with no const or volatile attributes.
+ * Somewhere along the line, the above set of includes need to set up
+ * the "uintptr_t" type.
+ */
+#define VOIDP(_a) ((void *)(uintptr_t)(_a))
+
/**
* PUBLIC DEFINES
*
* to an option descriptor must be obtained. There are two ways:
*
* 1. inside an option processing procedure, it is the second argument,
- * conventionally "tOptDesc* pOD".
+ * conventionally "tOptDesc * pOD".
*
* 2. Outside of an option procedure (or to reference a different option
* descriptor), use either "&DESC( opt_name )" or "&pfx_DESC( opt_name )".
unsigned int boolVal; ///< OPARG_TYPE_BOOLEAN
unsigned long setVal; ///< OPARG_TYPE_MEMBERSHIP
long longVal; ///< OPARG_TYPE_NUMERIC
- void* nestVal; ///< OPARG_TYPE_HIERARCHY
+ void * nestVal; ///< OPARG_TYPE_HIERARCHY
} v;
} tOptionValue;
* with the "exitCode" argument passed to it.
*/
// coverity[+kill]
-typedef void (tUsageProc)(tOptions* pOpts, int exitCode);
+typedef void (tUsageProc)(tOptions * pOpts, int exitCode);
/**
* a pointer to a procedure that prints usage and exits.
char * pzCurOpt; ///< current option text
/// Public, the full path of the program
-#if AUTOOPTS_INTERNAL
- char const * pzProgPath;
-#else
char const * const pzProgPath;
-#endif
/// Public, the name of the executable, without any path
-#if AUTOOPTS_INTERNAL
- char const * pzProgName;
-#else
char const * const pzProgName;
-#endif
/// Public, the upper-cased, shell variable syntax-ed program name
char const * const pzPROGNAME;
/// the name of the "rc file" (configuration file)
*/
typedef struct {
unsigned long tkn_ct; ///< number of tokens found
- unsigned char* tkn_list[1]; ///< array of pointers to tokens
+ unsigned char * tkn_list[1]; ///< array of pointers to tokens
} token_list_t;
/*
/**
* mmap result wrapper that yields "true" when mmap has failed.
*/
-#define TEXT_MMAP_FAILED_ADDR(a) ((void*)(a) == (void*)MAP_FAILED)
+#define TEXT_MMAP_FAILED_ADDR(a) (VOIDP(a) == VOIDP(MAP_FAILED))
#ifdef __cplusplus
#define CPLUSPLUS_OPENER extern "C" {
*
* @param string string to be tokenized
*
- * @return token_list_t* - pointer to a structure that lists each token
+ * @return token_list_t * - pointer to a structure that lists each token
*/
-extern token_list_t* ao_string_tokenize(char const*);
+extern token_list_t * ao_string_tokenize(char const *);
/**
*
* @param fname the file to load
*
- * @return const tOptionValue* - An allocated, compound value structure
+ * @return const tOptionValue * - An allocated, compound value structure
*/
-extern const tOptionValue* configFileLoad(char const*);
+extern const tOptionValue * configFileLoad(char const *);
/**
*
* @return int - 0 -> SUCCESS, -1 -> FAILURE
*/
-extern int optionFileLoad(tOptions*, char const*);
+extern int optionFileLoad(tOptions *, char const *);
/**
* @param name name of value to find
* @param value the matching value
*
- * @return const tOptionValue* - a compound value structure
+ * @return const tOptionValue * - a compound value structure
*/
-extern const tOptionValue* optionFindNextValue(const tOptDesc*, const tOptionValue*, char const*, char const*);
+extern const tOptionValue * optionFindNextValue(const tOptDesc *, const tOptionValue *, char const *, char const *);
/**
* @param name name of value to find
* @param val the matching value
*
- * @return const tOptionValue* - a compound value structure
+ * @return const tOptionValue * - a compound value structure
*/
-extern const tOptionValue* optionFindValue(const tOptDesc*, char const*, char const*);
+extern const tOptionValue * optionFindValue(const tOptDesc *, char const *, char const *);
/**
*
* @param pOpts program options descriptor
*/
-extern void optionFree(tOptions*);
+extern void optionFree(tOptions *);
/**
* @param pOptValue a hierarchcal value
* @param valueName name of value to get
*
- * @return const tOptionValue* - a compound value structure
+ * @return const tOptionValue * - a compound value structure
*/
-extern const tOptionValue* optionGetValue(const tOptionValue*, char const*);
+extern const tOptionValue * optionGetValue(const tOptionValue *, char const *);
/**
* @param opts program options descriptor
* @param line NUL-terminated text
*/
-extern void optionLoadLine(tOptions*, char const*);
+extern void optionLoadLine(tOptions *, char const *);
/**
*
* @param od the set membership option description
*
- * @return char* - the names of the set bits
+ * @return char * - the names of the set bits
*/
-extern char* optionMemberList(tOptDesc *);
+extern char * optionMemberList(tOptDesc *);
/**
* @param pOptValue a hierarchcal list value
* @param pOldValue a value from this list
*
- * @return const tOptionValue* - a compound value structure
+ * @return const tOptionValue * - a compound value structure
*/
-extern const tOptionValue* optionNextValue(const tOptionValue*, const tOptionValue*);
+extern const tOptionValue * optionNextValue(const tOptionValue *, const tOptionValue *);
/**
* @param pOpts program options descriptor
* @param ex_code exit code for calling exit(3)
*/
-extern void optionOnlyUsage(tOptions*, int);
+extern void optionOnlyUsage(tOptions *, int);
/**
* @param opts program options descriptor
* @param od the descriptor for this arg
*/
-extern void optionPrintVersion(tOptions*, tOptDesc*);
+extern void optionPrintVersion(tOptions *, tOptDesc *);
/**
* @param opts program options descriptor
* @param od the descriptor for this arg
*/
-extern void optionPrintVersionAndReturn(tOptions*, tOptDesc*);
+extern void optionPrintVersionAndReturn(tOptions *, tOptDesc *);
/**
*
* @return int - the count of the arguments processed
*/
-extern int optionProcess(tOptions*, int, char**);
+extern int optionProcess(tOptions *, int, char **);
/**
*
* @param pOpts program options descriptor
*/
-extern void optionRestore(tOptions*);
+extern void optionRestore(tOptions *);
/**
*
* @param opts program options descriptor
*/
-extern void optionSaveFile(tOptions*);
+extern void optionSaveFile(tOptions *);
/**
*
* @param pOpts program options descriptor
*/
-extern void optionSaveState(tOptions*);
+extern void optionSaveState(tOptions *);
/**
* Returns the full version string compiled into the library.
* The returned string cannot be modified.
*
- * @return char const* - the version string in constant memory
+ * @return char const * - the version string in constant memory
*/
-extern char const* optionVersion(void);
+extern char const * optionVersion(void);
/**
*
* @param ch_list characters to equivalence
*/
-extern void strequate(char const*);
+extern void strequate(char const *);
/**
*
* @return int - the difference between two differing characters
*/
-extern int streqvcmp(char const*, char const*);
+extern int streqvcmp(char const *, char const *);
/**
*
* @return int - the difference between two differing characters
*/
-extern int strneqvcmp(char const*, char const*, int);
+extern int strneqvcmp(char const *, char const *, int);
/**
* @param dest output string
* @param src input string
*/
-extern void strtransform(char*, char const*);
+extern void strtransform(char *, char const *);
/* AutoOpts PRIVATE FUNCTIONS: */
tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal;
-extern char* ao_string_cook(char*, int*);
+extern char * ao_string_cook(char *, int *);
-extern unsigned int ao_string_cook_escape_char(char const*, char*, unsigned int);
+extern unsigned int ao_string_cook_escape_char(char const *, char *, unsigned int);
-extern void genshelloptUsage(tOptions*, int);
+extern void genshelloptUsage(tOptions *, int);
extern int optionAlias(tOptions *, tOptDesc *, unsigned int);
-extern void optionBooleanVal(tOptions*, tOptDesc*);
+extern void optionBooleanVal(tOptions *, tOptDesc *);
-extern uintptr_t optionEnumerationVal(tOptions*, tOptDesc*, char const * const *, unsigned int);
+extern uintptr_t optionEnumerationVal(tOptions *, tOptDesc *, char const * const *, unsigned int);
-extern void optionFileCheck(tOptions*, tOptDesc*, teOptFileType, tuFileMode);
+extern void optionFileCheck(tOptions *, tOptDesc *, teOptFileType, tuFileMode);
-extern char const * optionKeywordName(tOptDesc*, unsigned int);
+extern char const * optionKeywordName(tOptDesc *, unsigned int);
-extern void optionLoadOpt(tOptions*, tOptDesc*);
+extern void optionLoadOpt(tOptions *, tOptDesc *);
-extern bool optionMakePath(char*, int, char const*, char const*);
+extern bool optionMakePath(char *, int, char const *, char const *);
-extern void optionNestedVal(tOptions*, tOptDesc*);
+extern void optionNestedVal(tOptions *, tOptDesc *);
-extern void optionNumericVal(tOptions*, tOptDesc*);
+extern void optionNumericVal(tOptions *, tOptDesc *);
extern void optionPagedUsage(tOptions *, tOptDesc *);
-extern void optionParseShell(tOptions*);
+extern void optionParseShell(tOptions *);
extern void optionPrintParagraphs(char const *, bool, FILE *);
-extern void optionPutShell(tOptions*);
+extern void optionPutShell(tOptions *);
extern char const * optionQuoteString(char const *, char const *);
-extern void optionResetOpt(tOptions*, tOptDesc*);
+extern void optionResetOpt(tOptions *, tOptDesc *);
-extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int);
+extern void optionSetMembers(tOptions *, tOptDesc *, char const * const *, unsigned int);
-extern void optionShowRange(tOptions*, tOptDesc*, const void *, int);
+extern void optionShowRange(tOptions *, tOptDesc *, void *, int);
-extern void optionStackArg(tOptions*, tOptDesc*);
+extern void optionStackArg(tOptions *, tOptDesc *);
-extern void optionTimeDate(tOptions*, tOptDesc*);
+extern void optionTimeDate(tOptions *, tOptDesc *);
-extern void optionTimeVal(tOptions*, tOptDesc*);
+extern void optionTimeVal(tOptions *, tOptDesc *);
-extern void optionUnstackArg(tOptions*, tOptDesc*);
+extern void optionUnstackArg(tOptions *, tOptDesc *);
-extern void optionUsage(tOptions*, int);
+extern void optionUsage(tOptions *, int);
extern void optionVendorOption(tOptions *, tOptDesc *);
-extern void optionVersionStderr(tOptions*, tOptDesc*);
+extern void optionVersionStderr(tOptions *, tOptDesc *);
-extern void* text_mmap(char const*, int, int, tmap_info_t*);
+extern void * text_mmap(char const *, int, int, tmap_info_t *);
-extern int text_munmap(tmap_info_t*);
+extern int text_munmap(tmap_info_t *);
CPLUSPLUS_CLOSER
#endif /* AUTOOPTS_OPTIONS_H_GUARD */
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed August 3, 2014 at 10:44:44 AM by AutoGen 5.18.4pre11
+ * It has been AutoGen-ed
* From the definitions usage-txt.def
* and the template file usage-txt.tpl
*
* This file is part of AutoOpts, a companion to AutoGen.
* AutoOpts is free software.
- * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
*
* AutoOpts is available under any one of two licenses. The license
* in use must be one of these two and the choice is under the control
puts(_("allocation of %d bytes failed\n"));
#line 53 "../init.c"
puts(_("AutoOpts function called without option descriptor\n"));
-#line 90 "../init.c"
+#line 86 "../init.c"
puts(_("\tThis exceeds the compiled library version: "));
-#line 88 "../init.c"
+#line 84 "../init.c"
puts(_("Automated Options Processing Error!\n"
"\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
#line 80 "../autoopts.c"
puts(_("realloc of %d bytes at 0x%p failed\n"));
-#line 92 "../init.c"
+#line 88 "../init.c"
puts(_("\tThis is less than the minimum library version: "));
#line 121 "../version.c"
puts(_("Automated Options version %s\n"
"\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
-#line 82 "../makeshell.c"
+#line 87 "../makeshell.c"
puts(_("(AutoOpts bug): %s.\n"));
#line 90 "../reset.c"
puts(_("optionResetOpt() called, but reset-option not configured"));
puts(_("%s: Command line arguments required\n"));
#line 43 "../alias.c"
puts(_("%d %s%s options allowed\n"));
-#line 89 "../makeshell.c"
+#line 94 "../makeshell.c"
puts(_("%s error %d (%s) calling %s for '%s'\n"));
-#line 301 "../makeshell.c"
+#line 306 "../makeshell.c"
puts(_("interprocess pipe"));
#line 168 "../version.c"
puts(_("error: version option argument '%c' invalid. Use:\n"
puts(_("Try '%s %s' for more information.\n"));
#line 45 "../alias.c"
puts(_("one %s%s option allowed\n"));
-#line 203 "../makeshell.c"
+#line 208 "../makeshell.c"
puts(_("standard output"));
-#line 938 "../makeshell.c"
+#line 943 "../makeshell.c"
puts(_("standard output"));
#line 274 "../usage.c"
puts(_("standard output"));
puts(_("standard error"));
#line 175 "../version.c"
puts(_("standard error"));
-#line 203 "../makeshell.c"
+#line 208 "../makeshell.c"
puts(_("write"));
-#line 938 "../makeshell.c"
+#line 943 "../makeshell.c"
puts(_("write"));
#line 273 "../usage.c"
puts(_("write"));
#line 380 "../usage.c"
puts(_("Options are specified by doubled hyphens and their name or by a single\n"
"hyphen and the flag character.\n"));
-#line 916 "../makeshell.c"
+#line 921 "../makeshell.c"
puts(_("\n"
"= = = = = = = =\n\n"
"This incarnation of genshell will produce\n"
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed August 3, 2014 at 10:44:34 AM by AutoGen 5.18.4pre11
+dnl It has been AutoGen-ed
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
])
AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
intptr_t, uintptr_t, uint_t, pid_t, size_t, ptrdiff_t])
- AC_CHECK_SIZEOF(char*, 8)
- AC_CHECK_SIZEOF(int, 4)
- AC_CHECK_SIZEOF(long, 8)
- AC_CHECK_SIZEOF(short, 2)
+ AC_CHECK_SIZEOF(char *, 8)
+ AC_CHECK_SIZEOF(int, 4)
+ AC_CHECK_SIZEOF(long, 8)
+ AC_CHECK_SIZEOF(short, 2)
# ------------
# AC_CHECK_LIB
Xyes|Xno|X )
case "X${libopts_cv_with_libregex_root}" in
Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;;
- * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
+ * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
esac
esac
case "X${libopts_cv_with_libregex_libs}" in
Xyes|Xno|X )
case "X${libopts_cv_with_libregex_root}" in
Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;;
- * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";;
+ * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex" ;;
esac
esac
libopts_save_CPPFLAGS="${CPPFLAGS}"
LIBREGEX_LIBS=""
AC_MSG_CHECKING([whether libregex functions properly])
AC_CACHE_VAL([libopts_cv_with_libregex],[
- AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
+ AC_RUN_IFELSE([@%:@include <stdio.h>
@%:@include <stdlib.h>
@%:@include <sys/types.h>
@%:@include REGEX_HEADER
static regex_t re;
-void comp_re( char const* pzPat ) {
+void comp_re(char const * pzPat) {
int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE );
if (res == 0) return;
exit( res ); }
fputs( "error: regex -->.<-- did not match\n", stderr );
return 1;
}
- return 0; }])],
+ return 0; }],
[libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
[libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE
]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
AC_MSG_CHECKING([whether pathfind(3) works])
AC_CACHE_VAL([libopts_cv_run_pathfind],[
- AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <string.h>
+ AC_RUN_IFELSE([@%:@include <string.h>
@%:@include <stdlib.h>
-int main (int argc, char** argv) {
- char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
+int main (int argc, char ** argv) {
+ char * pz = pathfind( getenv( "PATH" ), "sh", "x" );
return (pz == 0) ? 1 : 0;
-}])],
+}],
[libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
) # end of RUN_IFELSE
]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
AC_DEFUN([LIBOPTS_RUN_REALPATH],[
AC_MSG_CHECKING([whether we have a functional realpath(3C)])
AC_CACHE_VAL([libopts_cv_run_realpath],[
- AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <limits.h>
+ AC_RUN_IFELSE([@%:@include <limits.h>
@%:@include <stdlib.h>
-int main (int argc, char** argv) {
+int main (int argc, char ** argv) {
@%:@ifndef PATH_MAX
choke me!!
@%:@else
@%:@endif
char *pz = realpath(argv@<:@0@:>@, zPath);
return (pz == zPath) ? 0 : 1;
-}])],
+}],
[libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
) # end of RUN_IFELSE
]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
AC_MSG_CHECKING([whether strftime() works])
AC_CACHE_VAL([libopts_cv_run_strftime],[
- AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <time.h>
+ AC_RUN_IFELSE([@%:@include <time.h>
@%:@include <string.h>
char t_buf@<:@ 64 @:>@;
int main() {
tm.tm_yday = 239; /* days since January 1 @<:@0, 365@:>@ */
tm.tm_isdst = 1; /* flag for daylight savings time */
strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
- return (strcmp( t_buf, z ) != 0); }])],
+ return (strcmp( t_buf, z ) != 0); }],
[libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
) # end of RUN_IFELSE
]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
AC_MSG_CHECKING([whether fopen accepts "b" mode])
AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
- AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
-int main (int argc, char** argv) {
-FILE* fp = fopen("conftest.@S|@ac_ext", "rb");
-return (fp == NULL) ? 1 : fclose(fp); }])],
+ AC_RUN_IFELSE([@%:@include <stdio.h>
+int main (int argc, char ** argv) {
+FILE * fp = fopen("conftest.@S|@ac_ext", "rb");
+return (fp == NULL) ? 1 : fclose(fp); }],
[libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
) # end of RUN_IFELSE
]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
AC_MSG_CHECKING([whether fopen accepts "t" mode])
AC_CACHE_VAL([libopts_cv_run_fopen_text],[
- AC_RUN_IFELSE([AC_LANG_SOURCE([@%:@include <stdio.h>
-int main (int argc, char** argv) {
-FILE* fp = fopen("conftest.@S|@ac_ext", "rt");
-return (fp == NULL) ? 1 : fclose(fp); }])],
+ AC_RUN_IFELSE([@%:@include <stdio.h>
+int main (int argc, char ** argv) {
+FILE * fp = fopen("conftest.@S|@ac_ext", "rt");
+return (fp == NULL) ? 1 : fclose(fp); }],
[libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
) # end of RUN_IFELSE
]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts.
dnl
dnl This file is part of AutoGen.
-dnl AutoGen Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+dnl AutoGen Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
dnl
dnl AutoGen is free software: you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the