/*
- * $Id: autoopts.c,v 4.13 2006/07/15 22:17:36 bkorb Exp $
- * Time-stamp: "2006-07-15 13:54:08 bkorb"
+ * $Id: autoopts.c,v 4.22 2006/07/15 22:10:21 bkorb Exp $
+ * Time-stamp: "2006-09-10 14:42:45 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
checkConsistency( tOptions* pOpts );
/* = = = END-STATIC-FORWARD = = = */
+LOCAL void *
+ao_malloc( size_t sz )
+{
+ void * res = malloc(sz);
+ if (res == NULL) {
+ fprintf( stderr, "malloc of %d bytes failed\n", sz );
+ exit( EXIT_FAILURE );
+ }
+ return res;
+}
+
+
+LOCAL void *
+ao_realloc( void *p, size_t sz )
+{
+ void * res = realloc(p, sz);
+ if (res == NULL) {
+ fprintf( stderr, "realloc of %d bytes at 0x%p failed\n", sz, p );
+ exit( EXIT_FAILURE );
+ }
+ return res;
+}
+
+
+LOCAL void
+ao_free( void *p )
+{
+ if (p != NULL)
+ free(p);
+}
+
+
+LOCAL char *
+ao_strdup( char const *str )
+{
+ char * res = strdup(str);
+ if (res == NULL) {
+ fprintf( stderr, "strdup of %d byte string failed\n", strlen(str) );
+ exit( EXIT_FAILURE );
+ }
+ return res;
+}
+
+
/*
* handleOption
*
/*
- * Time-stamp: "2006-08-12 10:26:19 bkorb"
+ * Time-stamp: "2006-09-10 14:43:25 bkorb"
*
- * autoopts.h $Id: autoopts.h,v 4.14 2006/08/12 17:36:43 bkorb Exp $
+ * autoopts.h $Id: autoopts.h,v 4.26 2006/08/12 17:31:50 bkorb Exp $
* Time-stamp: "2005-02-14 05:59:50 bkorb"
*
* This file defines all the global structures and special values
tCC* pzOptFmt;
} arg_types_t;
-# define AGALOC( c, w ) malloc( (unsigned)c )
-# define AGREALOC( p, c, w ) realloc( p, (unsigned)c )
-# define AGFREE( p ) free( p )
-# define AGDUPSTR( p, s, w ) p = strdup( s )
-# define TAGMEM( m, t )
+#define AGALOC( c, w ) ao_malloc( (unsigned)c )
+#define AGREALOC( p, c, w ) ao_realloc( p, (unsigned)c )
+#define AGFREE( p ) ao_free( p )
+#define AGDUPSTR( p, s, w ) p = ao_strdup( s )
+
+#define TAGMEM( m, t )
/*
* DO option handling?
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Saturday September 9, 2006 at 01:15:17 PM PDT
+ * It has been AutoGen-ed Sunday September 10, 2006 at 04:03:10 PM PDT
* From the definitions funcs.def
* and the template file options_h
*
extern const tOptionValue* configFileLoad( const char* );
-/* From: configfile.c line 869
+/* From: configfile.c line 872
*
* optionFileLoad - Load the locatable config files, in order
*
extern void optionOnlyUsage( tOptions*, int );
-/* From: autoopts.c line 936
+/* From: autoopts.c line 980
*
* optionProcess - this is the main option processing routine
*
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed Saturday September 9, 2006 at 01:15:15 PM PDT
+ * It has been AutoGen-ed Sunday September 10, 2006 at 04:03:08 PM PDT
* From the definitions usage-txt.def
* and the template file usage-txt.tpl
*
/*
- * $Id: boolean.c,v 4.4 2006/03/31 19:52:10 bkorb Exp $
+ * $Id: boolean.c,v 4.6 2006/03/25 19:23:28 bkorb Exp $
* Time-stamp: "2005-02-14 08:24:12 bkorb"
*
* Automated Options Paged Usage module.
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Created: Mon Jun 30 15:54:46 1997
*
- * $Id: compat.h,v 4.11 2006/09/07 14:48:05 bkorb Exp $
+ * $Id: compat.h,v 4.12 2006/09/07 14:46:34 bkorb Exp $
*/
#ifndef COMPAT_H_GUARD
#define COMPAT_H_GUARD 1
/*
* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk>
* Created: Tue Jun 24 15:07:31 1997
- * Last Modified: $Date: 2006/08/22 16:09:02 $
+ * Last Modified: $Date: 2006/08/22 16:06:36 $
* by: bkorb
*
- * $Id: pathfind.c,v 4.7 2006/08/22 16:09:02 bkorb Exp $
+ * $Id: pathfind.c,v 4.7 2006/08/22 16:06:36 bkorb Exp $
*/
/* Code: */
/*
- * $Id: configfile.c,v 1.10 2006/07/14 04:31:37 bkorb Exp $
- * Time-stamp: "2006-07-01 12:46:31 bkorb"
+ * $Id: configfile.c,v 4.23 2006/07/01 21:57:23 bkorb Exp $
+ * Time-stamp: "2006-09-10 13:57:10 bkorb"
*
* configuration/rc/ini file handling.
*/
char* pzName = pzText++;
char* pzEnd = strchr( pzText, '\n' );
+ if (pzEnd == NULL)
+ return pzText + strlen(pzText);
+
while (ISNAMECHAR( *pzText )) pzText++;
while (isspace( *pzText )) pzText++;
if (pzText > pzEnd) {
/*
- * $Id: cook.c,v 4.4 2006/06/24 23:36:07 bkorb Exp $
+ * $Id: cook.c,v 4.6 2006/06/24 23:34:51 bkorb Exp $
* Time-stamp: "2006-06-24 11:29:58 bkorb"
*
* This file contains the routines that deal with processing quoted strings
/*
- * $Id: enumeration.c,v 4.9 2006/06/24 23:36:08 bkorb Exp $
+ * $Id: enumeration.c,v 4.11 2006/06/24 23:34:51 bkorb Exp $
* Time-stamp: "2006-06-24 10:46:02 bkorb"
*
* Automated Options Paged Usage module.
/*
- * $Id: environment.c,v 4.7 2006/03/31 19:52:10 bkorb Exp $
+ * $Id: environment.c,v 4.10 2006/03/25 19:23:28 bkorb Exp $
* Time-stamp: "2005-10-29 13:23:59 bkorb"
*
* This file contains all of the routines that must be linked into
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed Saturday September 9, 2006 at 01:15:18 PM PDT
+ * It has been AutoGen-ed Sunday September 10, 2006 at 04:03:10 PM PDT
* From the definitions genshell.def
* and the template file options
*/
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed Saturday September 9, 2006 at 01:15:18 PM PDT
+ * It has been AutoGen-ed Sunday September 10, 2006 at 04:03:10 PM PDT
* From the definitions genshell.def
* and the template file options
*/
/*
- * $Id: load.c,v 4.11 2006/07/14 04:31:37 bkorb Exp $
+ * $Id: load.c,v 4.23 2006/07/01 21:57:23 bkorb Exp $
* Time-stamp: "2006-07-01 12:43:03 bkorb"
*
* This file contains the routines that deal with processing text strings
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Saturday September 9, 2006 at 01:15:14 PM PDT
+dnl It has been AutoGen-ed Sunday September 10, 2006 at 04:03:12 PM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.10 2006/07/27 02:59:08 bkorb Exp $
+ * $Id: makeshell.c,v 4.14 2006/07/27 02:51:47 bkorb Exp $
* Time-stamp: "2006-07-24 21:30:51 bkorb"
*
* This module will interpret the options set in the tOptions
/*
- * $Id: nested.c,v 4.4 2006/03/31 19:52:10 bkorb Exp $
+ * $Id: nested.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
* Time-stamp: "2005-07-27 10:10:28 bkorb"
*
* Automated Options Nested Values module.
/*
- * $Id: numeric.c,v 4.5 2006/03/31 19:52:10 bkorb Exp $
+ * $Id: numeric.c,v 4.7 2006/03/25 19:23:28 bkorb Exp $
* Time-stamp: "2005-02-14 08:22:56 bkorb"
*/
/*
- * $Id: pgusage.c,v 4.10 2006/07/16 15:29:31 bkorb Exp $
+ * $Id: pgusage.c,v 4.12 2006/07/16 15:27:50 bkorb Exp $
* Time-stamp: "2006-07-16 08:13:26 bkorb"
*
* Automated Options Paged Usage module.
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Sep 9 13:16:02 PDT 2006
+ * Generated Sun Sep 10 16:03:11 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
* Extracted from autoopts.c
*/
+LOCAL void *
+ao_malloc( size_t sz );
+
+LOCAL void *
+ao_realloc( void *p, size_t sz );
+
+LOCAL void
+ao_free( void *p );
+
+LOCAL char *
+ao_strdup( char const *str );
+
LOCAL tSuccess
handleOption( tOptions* pOpts, tOptState* pOptState );
/*
- * $Id: putshell.c,v 4.9 2006/07/16 15:29:31 bkorb Exp $
+ * $Id: putshell.c,v 4.12 2006/07/16 15:27:50 bkorb Exp $
* Time-stamp: "2006-07-16 08:13:24 bkorb"
*
* This module will interpret the options set in the tOptions
/*
- * restore.c $Id: restore.c,v 4.5 2006/03/31 19:52:11 bkorb Exp $
+ * restore.c $Id: restore.c,v 4.7 2006/03/25 19:23:28 bkorb Exp $
* Time-stamp: "2005-02-23 15:10:20 bkorb"
*
* This module's routines will save the current option state to memory
/*
- * save.c $Id: save.c,v 4.8 2006/07/16 15:29:31 bkorb Exp $
+ * save.c $Id: save.c,v 4.16 2006/07/16 15:27:50 bkorb Exp $
* Time-stamp: "2006-07-16 08:13:22 bkorb"
*
* This module's routines will take the currently set options and
/*
- * sort.c $Id: sort.c,v 4.7 2006/06/24 23:36:08 bkorb Exp $
+ * sort.c $Id: sort.c,v 4.10 2006/06/24 23:34:51 bkorb Exp $
* Time-stamp: "2006-06-24 10:53:35 bkorb"
*
* This module implements argument sorting.
/*
* stack.c
- * $Id: stack.c,v 4.7 2006/07/14 04:31:38 bkorb Exp $
+ * $Id: stack.c,v 4.10 2006/07/14 04:20:17 bkorb Exp $
* Time-stamp: "2006-07-13 21:11:29 bkorb"
*
* This is a special option processing routine that will save the
/*
- * $Id: streqvcmp.c,v 4.7 2006/07/27 02:59:08 bkorb Exp $
+ * $Id: streqvcmp.c,v 4.10 2006/07/27 02:51:47 bkorb Exp $
* Time-stamp: "2006-07-26 18:25:53 bkorb"
*
* String Equivalence Comparison
/*
- * $Id: text_mmap.c,v 4.10 2006/08/22 16:09:02 bkorb Exp $
+ * $Id: text_mmap.c,v 4.12 2006/08/22 16:06:36 bkorb Exp $
*
- * Time-stamp: "2006-08-22 07:17:49 bkorb"
+ * Time-stamp: "2006-09-10 14:50:04 bkorb"
*/
#ifndef MAP_ANONYMOUS
return pMI->txt_data;
pMI->txt_errno = errno;
-#endif
-#if defined(HAVE_DEV_ZERO)
+#elif defined(HAVE_DEV_ZERO)
pMI->txt_zero_fd = open( "/dev/zero", O_RDONLY );
if (pMI->txt_zero_fd == AO_INVALID_FD) {
{
void* p = AGALOC( pMI->txt_size+1, "file text" );
- if (pMI->txt_data == NULL) {
- pMI->txt_errno = ENOMEM;
- goto fail_return;
- }
memcpy( p, pMI->txt_data, pMI->txt_size );
((char*)p)[pMI->txt_size] = NUL;
munmap(pMI->txt_data, pMI->txt_size );
/*
- * usage.c $Id: usage.c,v 4.10 2006/08/12 17:36:43 bkorb Exp $
+ * usage.c $Id: usage.c,v 4.15 2006/08/12 17:31:50 bkorb Exp $
* Time-stamp: "2006-07-01 12:41:02 bkorb"
*
* This module implements the default usage procedure for
-/* $Id: version.c,v 4.7 2006/07/27 02:59:08 bkorb Exp $
+/* $Id: version.c,v 4.9 2006/07/27 02:51:47 bkorb Exp $
* Time-stamp: "2006-07-26 18:38:16 bkorb"
*
* This module implements the default usage procedure for