/*
* $Id: autoopts.c,v 4.8 2005/02/13 01:47:59 bkorb Exp $
- * Time-stamp: "2005-03-13 08:39:23 bkorb"
+ * Time-stamp: "2005-09-18 11:48:37 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
# include "compat/pathfind.c"
#endif
+#ifndef HAVE_SNPRINTF
+# include "compat/snprintf.c"
+#endif
+
+#ifndef HAVE_STRDUP
+# include "compat/strdup.c"
+#endif
+
static const char zNil[] = "";
#define SKIP_RC_FILES(po) \
/*
- * Time-stamp: "2005-09-08 14:20:35 bkorb"
+ * Time-stamp: "2005-09-20 19:32:35 bkorb"
*
* autoopts.h $Id: autoopts.h,v 4.7 2005/02/13 01:48:00 bkorb Exp $
* Time-stamp: "2005-02-14 05:59:50 bkorb"
#ifndef AUTOGEN_AUTOOPTS_H
#define AUTOGEN_AUTOOPTS_H
-#define __EXTENSIONS__
-
-#include "config.h"
#include "compat/compat.h"
-#include <sys/param.h>
-#include <sys/wait.h>
-#include <time.h>
-#include <utime.h>
#define AO_NAME_LIMIT 127
#define AO_NAME_SIZE (AO_NAME_LIMIT + 1)
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Sunday September 4, 2005 at 02:14:19 PM PDT
+ * It has been AutoGen-ed Thursday September 15, 2005 at 08:47:43 PM PDT
* From the definitions funcs.def
* and the template file options_h
*
* a flag may appear multiple times without limit. "NO_EQUIVALENT"
* is an illegal value for 'optIndex' (option description index).
*/
-#define NOLIMIT USHORT_MAX
-#define OPTION_LIMIT SHORT_MAX
+#define NOLIMIT USHRT_MAX
+#define OPTION_LIMIT SHRT_MAX
#define NO_EQUIVALENT (OPTION_LIMIT+1)
/*
uint16_t default_opt;
};
-#define OPTIONS_STRUCT_VERSION 102400
-#define OPTIONS_VERSION_STRING "25:2:0"
+#define OPTIONS_STRUCT_VERSION 106497
+#define OPTIONS_VERSION_STRING "26:0:1"
#define OPTIONS_MINIMUM_VERSION 102400
#define OPTIONS_MIN_VER_STRING "25:0:0"
#define strequate option_strequate
#define strtransform option_strtransform
+/*
+ * This is an output only structure used by text_mmap and text_munmap.
+ * Clients must not alter the contents and must provide it to both
+ * the text_mmap and text_munmap procedures. BE ADVISED: if you are
+ * mapping the file with PROT_WRITE the NUL byte at the end MIGHT NOT
+ * BE WRITABLE. In any event, that byte is not be written back
+ * to the source file. ALSO: if "txt_data" is valid and "txt_errno"
+ * is not zero, then there *may* not be a terminating NUL.
+ */
+typedef struct {
+ void* txt_data; /* text file data */
+ size_t txt_size; /* actual file size */
+ size_t txt_full_size; /* mmaped mem size */
+ int txt_fd; /* file descriptor */
+ int txt_zero_fd; /* fd for /dev/zero */
+ int txt_errno; /* warning code */
+ int txt_prot; /* "prot" flags */
+ int txt_flags; /* mapping type */
+ int txt_alloc; /* if we malloced memory */
+} tmap_info_t;
+
/*
* When loading a line (or block) of text as an option, the value can
* be processed in any of several modes:
extern void optionVersionStderr( tOptions*, tOptDesc* );
+extern void* text_mmap( const char*, int, int, 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 Sunday September 4, 2005 at 02:14:19 PM PDT
+ * It has been AutoGen-ed Thursday September 15, 2005 at 08:47:42 PM PDT
* From the definitions usage-txt.def
* and the template file usage-txt.tpl
*
#endif
#ifndef HAVE_UINT32_T
-# if SIZEOF_INT == 4
+# if SIZEOF_UINT == 4
typedef unsigned int uint32_t;
# elif SIZEOF_LONG == 4
typedef unsigned int uint32_t;
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed Sunday September 4, 2005 at 02:14:19 PM PDT
+ * It has been AutoGen-ed Thursday September 15, 2005 at 08:47:43 PM PDT
* From the definitions genshell.def
* and the template file options
*/
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed Sunday September 4, 2005 at 02:14:19 PM PDT
+ * It has been AutoGen-ed Thursday September 15, 2005 at 08:47:43 PM PDT
* From the definitions genshell.def
* and the template file options
*/
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 102400
+#define AO_TEMPLATE_VERSION 106496
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define AUTOOPTS_INTERNAL
-#include "config.h"
#include "compat/compat.h"
#include "autoopts/options.h"
#include "autoopts/usage-txt.h"
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Thursday September 15, 2005 at 08:47:42 PM PDT
+dnl It has been AutoGen-ed Tuesday September 20, 2005 at 08:42:32 PM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
- # ----------------------------------------------------------------------
- # Check for standard headers.
- # ----------------------------------------------------------------------
# =================
# AC_HEADER_STDC
# =================
# =================
AC_HEADER_DIRENT
- # ----------------------------------------------------------------------
- # AC_CHECK_HEADERS Check for list of headers.
- # ----------------------------------------------------------------------
+ # =================
+ # AC_CHECK_HEADERS
+ # =================
AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h)
# --------------------------------------------
# Verify certain entries from AC_CHECK_HEADERS
# --------------------------------------------
- for f in sys_types sys_mman sys_param sys_stat sys_wait \
+ [for f in sys_types sys_mman sys_param sys_stat sys_wait \
string errno stdlib memory setjmp
do eval as_ac_var=\${ac_cv_header_${f}_h+set}
- test "${as_ac_var}" = set || \
+ test "${as_ac_var}" = set] || \
AC_MSG_ERROR([You must have ${f}.h on your system])
done
# if varargs.h is present define HAVE_VARARGS_H.
# =================
AC_CHECK_HEADERS(stdarg.h varargs.h, break)
- if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ [if test `eval echo '${'$as_ac_Header'}'` != yes; then]
AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])
fi
# Similarly for the string.h and strings.h headers
# =================
AC_CHECK_HEADERS(string.h strings.h, break)
- if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ [if test `eval echo '${'$as_ac_Header'}'` != yes; then]
AC_MSG_ERROR([You must have string.h or strings.h on your system])
fi
# ...and limits headers
# =================
AC_CHECK_HEADERS(limits.h sys/limits.h values.h, break)
- if test `eval echo '${'$as_ac_Header'}'` != yes; then
+ [if test `eval echo '${'$as_ac_Header'}'` != yes; then]
AC_MSG_ERROR([You must have one of limits.h, sys/limits.h or values.h])
fi
AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
intptr_t, uintptr_t])
+ # =================
+ # uintptr type & sizes
+ # =================
AC_CHECK_TYPES([uintptr_t], ,
[AC_DEFINE(uintptr_t, unsigned long,
[Alternate uintptr_t for systems without it.])])
# AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
# ----------------------------------------------------------------------
AC_CHECK_LIB(gen, pathfind)
- AC_CHECK_FUNCS(mmap canonicalize_file_name)
- # =================
- # ...and int types
- # =================
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup])
# Check to see if a reg expr header is specified.
LIBOPTS_WITH_REGEX_HEADER
dnl @synopsis LIBOPTS_CHECK
dnl
dnl If autoopts-config works, add the linking information to LIBS.
-dnl Otherwise, add \`\`libopts-${ao_rev}'' to SUBDIRS and run all
+dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all
dnl the config tests that the library needs. Invoke the
dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts.
dnl
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Thu Sep 15 20:48:22 PDT 2005
+ * Generated Tue Sep 20 20:43:10 PDT 2005
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD