]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
libopts upgrade
authorHarlan Stenn <stenn@ntp.org>
Wed, 21 Sep 2005 04:28:47 +0000 (00:28 -0400)
committerHarlan Stenn <stenn@ntp.org>
Wed, 21 Sep 2005 04:28:47 +0000 (00:28 -0400)
bk: 4330e17f-pMtPNHfY996UW3aDJOIjg

sntp/libopts/autoopts.c
sntp/libopts/autoopts.h
sntp/libopts/autoopts/options.h
sntp/libopts/autoopts/usage-txt.h
sntp/libopts/compat/compat.h
sntp/libopts/genshell.c
sntp/libopts/genshell.h
sntp/libopts/libopts.c
sntp/libopts/libopts.m4
sntp/libopts/proto.h

index 0da7a864792aca8293f039435dee38ed1be52ef0..3d9e2df6277f5cea566cea6e33d3d8ffdd6c7750 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  *  $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) \
index 3c860712bfcfa7e0c986d1d50495a139ed7d3bd6..97057bcd0946fab9d90a21a8ee91b1f03d2a5d24 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- *  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)
index 0e1caa48351b577341c0e60140159a3d8972d7ea..c4f3ae2d399ac8c445f85cbc717e17e4630b2371 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  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
  *
@@ -198,8 +198,8 @@ typedef tUsageProc* tpUsageProc;
  *  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)
 
 /*
@@ -260,8 +260,8 @@ struct optSpecIndex {
     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"
 
@@ -321,6 +321,27 @@ typedef struct {
 #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:
@@ -854,6 +875,10 @@ extern void optionUsage( tOptions*, int );
 
 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 */
 /*
index 9d2652fa3f7459064f83570bf8203b95648ec752..88e95fab1d478e5968843f14c6c46dd9814c4150 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  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
  *
index 3fa0132d889b8ab3fa3fe2b2a8d8af57ee3e1917..ea01d6a29ccb55ed43966f5af360a68c10d30048 100644 (file)
 #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;
index 649cd8af1a052b41e55d638c96436676f35219f6..606bd167fb5aaaea14cc94cf816c7bd8d43df908 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  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
  */
index 46bc4863368b2f00df511c5d21d08f6aab2e3f7f..05279d49b96f50fc9d02e0140c7c8680eb898d0d 100644 (file)
@@ -2,7 +2,7 @@
  *  
  *  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
  */
@@ -43,7 +43,7 @@
  *  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
index d132a1f8b9acb65c719e723b39b500e571c55345..3c25a204e74b601a9365ae3e87e81f6e361d0a44 100644 (file)
@@ -1,5 +1,4 @@
 #define AUTOOPTS_INTERNAL
-#include "config.h"
 #include "compat/compat.h"
 #include "autoopts/options.h"
 #include "autoopts/usage-txt.h"
index 68e985c068a6f7804364d9a9f875b5fd97e5d8af..b22a0c17aa80c5837f7d339c55013f902ca37cfb 100644 (file)
@@ -2,7 +2,7 @@ dnl  -*- buffer-read-only: t -*- vi: set ro:
 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
@@ -295,9 +295,6 @@ return (fp == NULL) ? 1 : fclose(fp); }],
 
 AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   
-  # ----------------------------------------------------------------------
-  # Check for standard headers.
-  # ----------------------------------------------------------------------
   # =================
   # AC_HEADER_STDC
   # =================
@@ -307,9 +304,9 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # =================
   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)
@@ -317,10 +314,10 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # --------------------------------------------
   # 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
   
@@ -329,7 +326,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # 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
   
@@ -337,7 +334,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # 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
   
@@ -345,7 +342,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # ...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
   
@@ -356,6 +353,9 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   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.])])
@@ -368,10 +368,8 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
   # 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
 
@@ -401,7 +399,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
 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
index 4b6ccfb9966ef45b32c2eb78f7c9183982d9be24..96f09ac84e80f3d180e9e69a7180e433f96e68e7 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- 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