#include "choke-me: no vprintf and no snprintf"
#endif
+#if defined(HAVE_STDARG_H)
+# include <stdarg.h>
+# ifndef VA_START
+# define VA_START(a, f) va_start(a, f)
+# define VA_END(a) va_end(a)
+# endif /* VA_START */
+# define SNV_USING_STDARG_H
+
+#elif defined(HAVE_VARARGS_H)
+# include <varargs.h>
+# ifndef VA_START
+# define VA_START(a, f) va_start(a)
+# define VA_END(a) va_end(a)
+# endif /* VA_START */
+# undef SNV_USING_STDARG_H
+
+#else
+# include "must-have-stdarg-or-varargs"
+#endif
+
static int
snprintf(char *str, size_t n, const char *fmt, ...)
{
#ifdef VSPRINTF_CHARSTAR
char *rp;
- va_start(ap, fmt);
+ VA_START(ap, fmt);
rp = vsprintf(str, fmt, ap);
- va_end(ap);
+ VA_END(ap);
rval = strlen(rp);
#else
- va_start(ap, fmt);
+ VA_START(ap, fmt);
rval = vsprintf(str, fmt, ap);
- va_end(ap);
+ VA_END(ap);
#endif
+ if (rval > n) {
+ fprintf(stderr, "snprintf buffer overrun %d > %d\n", rval, n);
+ abort();
+ }
return rval;
}
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Saturday July 22, 2006 at 08:36:51 AM PDT
+dnl It has been AutoGen-ed Thursday July 27, 2006 at 09:14:31 PM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.13 2006/07/15 22:10:21 bkorb Exp $
- * Time-stamp: "2006-07-15 08:18:01 bkorb"
+ * $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
* structure and create a Bourne shell script capable of parsing them.
static void
textToVariable( tOptions* pOpts, teTextTo whichVar, tOptDesc* pOD )
{
+# define _TT_(n) tSCC z ## n [] = #n;
+ TEXTTO_TABLE
+# undef _TT_
+# define _TT_(n) z ## n ,
+ static const char* apzTTNames[] = { TEXTTO_TABLE };
+# undef _TT_
+
#if defined(__windows__) && !defined(__CYGWIN__)
printf( "%1$s_%2$s_TEXT='no %2$s text'\n",
pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
int pipeFd[2];
FILE* fp;
-# define _TT_(n) tSCC z ## n [] = #n;
- TEXTTO_TABLE
-# undef _TT_
-# define _TT_(n) z ## n ,
- static const char* apzTTNames[] = { TEXTTO_TABLE };
-# undef _TT_
-
printf( "%s_%s_TEXT='", pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
fflush( stdout );
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Jul 22 08:37:30 PDT 2006
+ * Generated Thu Jul 27 21:15:11 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: streqvcmp.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
- * Time-stamp: "2005-10-29 14:05:07 bkorb"
+ * $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
*
* err: none.
=*/
void
-strtransform( d, s )
- char* d;
- const char* s;
+strtransform( char* d, const char* s )
{
do {
*(d++) = (char)charmap[ (unsigned)*s ];
-/* $Id: version.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
- * Time-stamp: "2005-12-13 10:29:09 bkorb"
+/* $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
* Automated Options. It may be overridden, of course.
* This routine will print the version to stdout.
=*/
void
-optionPrintVersion( pOpts, pOD )
- tOptions* pOpts;
- tOptDesc* pOD;
+optionPrintVersion( tOptions* pOpts, tOptDesc* pOD )
{
printVersion( pOpts, pOD, stdout );
}
* This routine will print the version to stderr.
=*/
void
-optionVersionStderr( pOpts, pOD )
- tOptions* pOpts;
- tOptDesc* pOD;
+optionVersionStderr( tOptions* pOpts, tOptDesc* pOD )
{
printVersion( pOpts, pOD, stderr );
}
#include "choke-me: no vprintf and no snprintf"
#endif
+#if defined(HAVE_STDARG_H)
+# include <stdarg.h>
+# ifndef VA_START
+# define VA_START(a, f) va_start(a, f)
+# define VA_END(a) va_end(a)
+# endif /* VA_START */
+# define SNV_USING_STDARG_H
+
+#elif defined(HAVE_VARARGS_H)
+# include <varargs.h>
+# ifndef VA_START
+# define VA_START(a, f) va_start(a)
+# define VA_END(a) va_end(a)
+# endif /* VA_START */
+# undef SNV_USING_STDARG_H
+
+#else
+# include "must-have-stdarg-or-varargs"
+#endif
+
static int
snprintf(char *str, size_t n, const char *fmt, ...)
{
#ifdef VSPRINTF_CHARSTAR
char *rp;
- va_start(ap, fmt);
+ VA_START(ap, fmt);
rp = vsprintf(str, fmt, ap);
- va_end(ap);
+ VA_END(ap);
rval = strlen(rp);
#else
- va_start(ap, fmt);
+ VA_START(ap, fmt);
rval = vsprintf(str, fmt, ap);
- va_end(ap);
+ VA_END(ap);
#endif
+ if (rval > n) {
+ fprintf(stderr, "snprintf buffer overrun %d > %d\n", rval, n);
+ abort();
+ }
return rval;
}
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Saturday July 22, 2006 at 08:36:51 AM PDT
+dnl It has been AutoGen-ed Thursday July 27, 2006 at 09:14:31 PM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.13 2006/07/15 22:10:21 bkorb Exp $
- * Time-stamp: "2006-07-15 08:18:01 bkorb"
+ * $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
* structure and create a Bourne shell script capable of parsing them.
static void
textToVariable( tOptions* pOpts, teTextTo whichVar, tOptDesc* pOD )
{
+# define _TT_(n) tSCC z ## n [] = #n;
+ TEXTTO_TABLE
+# undef _TT_
+# define _TT_(n) z ## n ,
+ static const char* apzTTNames[] = { TEXTTO_TABLE };
+# undef _TT_
+
#if defined(__windows__) && !defined(__CYGWIN__)
printf( "%1$s_%2$s_TEXT='no %2$s text'\n",
pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
int pipeFd[2];
FILE* fp;
-# define _TT_(n) tSCC z ## n [] = #n;
- TEXTTO_TABLE
-# undef _TT_
-# define _TT_(n) z ## n ,
- static const char* apzTTNames[] = { TEXTTO_TABLE };
-# undef _TT_
-
printf( "%s_%s_TEXT='", pOpts->pzPROGNAME, apzTTNames[ whichVar ]);
fflush( stdout );
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sat Jul 22 08:37:30 PDT 2006
+ * Generated Thu Jul 27 21:15:11 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: streqvcmp.c,v 4.9 2006/03/25 19:23:28 bkorb Exp $
- * Time-stamp: "2005-10-29 14:05:07 bkorb"
+ * $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
*
* err: none.
=*/
void
-strtransform( d, s )
- char* d;
- const char* s;
+strtransform( char* d, const char* s )
{
do {
*(d++) = (char)charmap[ (unsigned)*s ];
-/* $Id: version.c,v 4.8 2006/03/25 19:23:28 bkorb Exp $
- * Time-stamp: "2005-12-13 10:29:09 bkorb"
+/* $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
* Automated Options. It may be overridden, of course.
* This routine will print the version to stdout.
=*/
void
-optionPrintVersion( pOpts, pOD )
- tOptions* pOpts;
- tOptDesc* pOD;
+optionPrintVersion( tOptions* pOpts, tOptDesc* pOD )
{
printVersion( pOpts, pOD, stdout );
}
* This routine will print the version to stderr.
=*/
void
-optionVersionStderr( pOpts, pOD )
- tOptions* pOpts;
- tOptDesc* pOD;
+optionVersionStderr( tOptions* pOpts, tOptDesc* pOD )
{
printVersion( pOpts, pOD, stderr );
}