static char* pzPicMode = "default";
static int xCompile = 0;
-static void*
-xmalloc( size_t s )
-{
- void* p = malloc( s );
- if (p == NULL) {
- fprintf( stderr, "%s error: cannot allocate %d bytes\n",
- libtoolOptions.pzProgPath );
- exit( EXIT_FAILURE );
- }
- return p;
-}
-
-tCC*
-makeShellSafe( pzArg )
- tCC* pzArg;
-{
- tSCC zSpecial[] = "\\\"$`[~#^&*(){}|;<>?' \t|]";
- tSCC* pzProt = zSpecial + 4;
-
- size_t len = strlen( pzArg );
- char* pz;
-
- if (strcspn( pzArg, zSpecial ) == len)
- return pzArg;
-
- pz = strchr( pzArg, '\'' );
- if (pz == NULL)
- return pzArg;
-
- do {
- len += 3;
- pz = strchr( pz+1, '\'' );
- } while (pz != NULL);
-
- {
- char* pzRes = malloc( len + 1 );
- pz = pzRes;
- for (;;) {
- char ch = *(pzArg++);
- *(pz++) = ch;
+/* BEGIN-STATIC-FORWARD */
+LOCAL tCC*
+makeShellSafe LT_PARAMS((
+ tCC* pzArg ));
- switch (ch) {
- case '\0':
- goto scan_done;
-
- case '\'':
- do {
- strcpy( pz, "\\'" );
- pz += 2;
- } while (*pzArg == '\'');
- *(pz++) = '\'';
- break;
+LOCAL void
+parseCompileOpts LT_PARAMS((
+ int* pArgc,
+ char*** pArgv ));
- default:
- break;
- }
- } scan_done:;
-
- return pzRes;
- }
-}
-
-
-static void
-parseCompileOpts( pArgc, pArgv )
- int* pArgc;
- char*** pArgv;
-{
- tSCC zTooManyTargets[] =
- "%s compile: you cannot specify `-o' more than once\n";
- tSCC zNoTarget[] =
- "%s compile: `-o' must specify an output file name\n";
- tSCC zNoXcompile[] =
- "%s compile: `-Xcompiler' must specify a cross compiler\n";
- tSCC zEarlyOpts[] =
- "%s compile: error: you cannot supply options before the command\n";
-
- int argc = *pArgc;
- char** argv = *pArgv;
+/* END-STATIC-FORWARD */
- tCC** newArgv = xmalloc( sizeof( char* ) * (argc + 1) );
- int newCt = 0;
-
- tCC* pzCmd = NULL;
- int i;
-
- for (i=0; i<argc; i++) {
- if (strncmp( argv[i], "-o", 2 ) == 0) {
- if (pzTarget != NULL) {
- fprintf( stderr, zTooManyTargets, libtoolOptions.pzProgPath );
- exit( EXIT_FAILURE );
- }
- if (argv[i][2] != '\0')
- pzTarget = (argv[i]) + 2;
- else {
- pzTarget = argv[ ++i ];
- if (pzTarget == NULL) {
- fprintf( stderr, zNoTarget, libtoolOptions.pzProgPath );
- exit( EXIT_FAILURE );
- }
- }
-
- } else if (strcmp( argv[i], "-static" ) == 0) {
- oldLibs = 1;
-
- } else if (strcmp( argv[i], "-prefer-pic" ) == 0) {
- pzPicMode = "yes";
-
- } else if (strcmp( argv[i], "-prefer-non-pic" ) == 0) {
- pzPicMode = "no";
-
- } else if (strcmp( argv[i], "-Xcompiler" ) == 0) {
- if (argv[++i] == NULL) {
- fprintf( stderr, zNoXcompile, libtoolOptions.pzProgPath );
- exit( EXIT_FAILURE );
- }
- pzCmd = newArgv[ newCt++ ] = makeShellSafe( argv[i] );
-
- } else if (argv[i][0] == '-') {
- if (pzCmd == NULL) {
- fprintf( stderr, zEarlyOpts, libtoolOptions.pzProgPath );
- exit( EXIT_FAILURE );
- }
- newArgv[ newCt++ ] = makeShellSafe( argv[i] );
-
- } else if (pzCmd == NULL) {
- pzCmd = newArgv[ newCt++ ] = makeShellSafe( argv[i] );
-
- } else {
- if (pzSource != NULL)
- newArgv[ newCt++ ] = makeShellSafe( pzSource );
- pzSource = argv[i];
- }
- }
-
- if (pzSource == NULL) {
- fprintf( stderr, "%s compile: error: no source file to compile\n",
- libtoolOptions.pzProgName );
- exit( EXIT_FAILURE );
- }
-
- newArgv[ newCt ] = NULL;
- *pArgc = newCt;
- *pArgv = (char**)newArgv;
-}
-
-
- void
+EXPORT void
emitCompile( argc, argv )
- int argc;
- char** argv;
+ int argc;
+ char** argv; /*end-decl*/
{
tSCC zDbgFmt[] = "set -x\n";
tSCC zQuiet[] = "run=\nshow=%s\n";
* that one of the command scripts depends upon.
*/
fprintf( fp, zModeName, libtoolOptions.pzProgName,
- libtoolOptions.pOptDesc[ OPT_VALUE_MODE ].pz_Name );
+ apzModeName[ OPT_VALUE_MODE ]);
CKSERV;
fprintf( fp, zMode, libtoolOptions.pzProgName );
CKSERV;
emitCommands( fp, apz_mode_cmd[ OPT_VALUE_MODE ]);
}
+
+
+EXPORT void*
+xmalloc( size )
+ size_t size; /*end-decl*/
+{
+ void* p = malloc( size );
+ if (p == NULL) {
+ fprintf( stderr, "%s error: cannot allocate %d bytes\n",
+ libtoolOptions.pzProgPath );
+ exit( EXIT_FAILURE );
+ }
+ return p;
+}
+
+
+LOCAL tCC*
+makeShellSafe( pzArg )
+ tCC* pzArg; /*end-decl*/
+{
+ tSCC zSpecial[] = "\\\"$`[~#^&*(){}|;<>?' \t|]";
+ tSCC* pzProt = zSpecial + 4;
+
+ size_t len = strlen( pzArg );
+ char* pz;
+
+ if (strcspn( pzArg, zSpecial ) == len)
+ return pzArg;
+
+ pz = strchr( pzArg, '\'' );
+ if (pz == NULL)
+ return pzArg;
+
+ do {
+ len += 3;
+ pz = strchr( pz+1, '\'' );
+ } while (pz != NULL);
+
+ {
+ char* pzRes = malloc( len + 1 );
+ pz = pzRes;
+ for (;;) {
+ char ch = *(pzArg++);
+ *(pz++) = ch;
+
+ switch (ch) {
+ case '\0':
+ goto scan_done;
+
+ case '\'':
+ do {
+ strcpy( pz, "\\'" );
+ pz += 2;
+ } while (*pzArg == '\'');
+ *(pz++) = '\'';
+ break;
+
+ default:
+ break;
+ }
+ } scan_done:;
+
+ return pzRes;
+ }
+}
+
+
+LOCAL void
+parseCompileOpts( pArgc, pArgv )
+ int* pArgc;
+ char*** pArgv; /*end-decl*/
+{
+ tSCC zTooManyTargets[] =
+ "%s compile: you cannot specify `-o' more than once\n";
+ tSCC zNoTarget[] =
+ "%s compile: `-o' must specify an output file name\n";
+ tSCC zNoXcompile[] =
+ "%s compile: `-Xcompiler' must specify a cross compiler\n";
+ tSCC zEarlyOpts[] =
+ "%s compile: error: you cannot supply options before the command\n";
+
+ int argc = *pArgc;
+ char** argv = *pArgv;
+
+ tCC** newArgv = xmalloc( sizeof( char* ) * (argc + 1) );
+ int newCt = 0;
+
+ tCC* pzCmd = NULL;
+ int i;
+
+ for (i=0; i<argc; i++) {
+ if (strncmp( argv[i], "-o", 2 ) == 0) {
+ if (pzTarget != NULL) {
+ fprintf( stderr, zTooManyTargets, libtoolOptions.pzProgPath );
+ exit( EXIT_FAILURE );
+ }
+ if (argv[i][2] != '\0')
+ pzTarget = (argv[i]) + 2;
+ else {
+ pzTarget = argv[ ++i ];
+ if (pzTarget == NULL) {
+ fprintf( stderr, zNoTarget, libtoolOptions.pzProgPath );
+ exit( EXIT_FAILURE );
+ }
+ }
+
+ } else if (strcmp( argv[i], "-static" ) == 0) {
+ oldLibs = 1;
+
+ } else if (strcmp( argv[i], "-prefer-pic" ) == 0) {
+ pzPicMode = "yes";
+
+ } else if (strcmp( argv[i], "-prefer-non-pic" ) == 0) {
+ pzPicMode = "no";
+
+ } else if (strcmp( argv[i], "-Xcompiler" ) == 0) {
+ if (argv[++i] == NULL) {
+ fprintf( stderr, zNoXcompile, libtoolOptions.pzProgPath );
+ exit( EXIT_FAILURE );
+ }
+ pzCmd = newArgv[ newCt++ ] = makeShellSafe( argv[i] );
+
+ } else if (argv[i][0] == '-') {
+ if (pzCmd == NULL) {
+ fprintf( stderr, zEarlyOpts, libtoolOptions.pzProgPath );
+ exit( EXIT_FAILURE );
+ }
+ newArgv[ newCt++ ] = makeShellSafe( argv[i] );
+
+ } else if (pzCmd == NULL) {
+ pzCmd = newArgv[ newCt++ ] = makeShellSafe( argv[i] );
+
+ } else {
+ if (pzSource != NULL)
+ newArgv[ newCt++ ] = makeShellSafe( pzSource );
+ pzSource = argv[i];
+ }
+ }
+
+ if (pzSource == NULL) {
+ fprintf( stderr, "%s compile: error: no source file to compile\n",
+ libtoolOptions.pzProgName );
+ exit( EXIT_FAILURE );
+ }
+
+ newArgv[ newCt ] = NULL;
+ *pArgc = newCt;
+ *pArgv = (char**)newArgv;
+}
/*
* Local Variables:
* c-file-style: "stroustrup"
* indent-tabs-mode: nil
+ * tab-width: 4
* End:
* end of ltcompile.c */
#include "ltopts.h"
#include "ltstr.h"
+/* BEGIN-STATIC-FORWARD */
+/* END-STATIC-FORWARD */
- void
+EXPORT void
emitExecute( argc, argv )
- int argc;
- char** argv;
+ int argc;
+ char** argv; /*end-decl*/
{
tSCC zDbgFmt[] = "set -x\n";
tSCC zQuiet[] = "run=\nshow=%s\n";
* that one of the command scripts depends upon.
*/
fprintf( fp, zModeName, libtoolOptions.pzProgName,
- libtoolOptions.pOptDesc[ OPT_VALUE_MODE ].pz_Name );
+ apzModeName[ OPT_VALUE_MODE ]);
CKSERV;
fprintf( fp, zMode, libtoolOptions.pzProgName );
CKSERV;
int scriptStatus = EXIT_SUCCESS;
int signalReceived = 0;
+/* BEGIN-STATIC-FORWARD */
+LOCAL void
+handleSignal LT_PARAMS((
+ int signo ));
+
+LOCAL void
+validateMode LT_PARAMS((
+ int argct,
+ char** argvec ));
+
+/* END-STATIC-FORWARD */
+
+int
+main( argc, argv )
+ int argc;
+ char** argv;
+{
+ pzHost = getenv( "host" );
+ if (pzHost == (char*)NULL)
+ pzHost = zUnkn;
+
+ /*
+ * Process the options, removing them from the arg list.
+ * Make sure the resulting state is sane.
+ */
+ {
+ int ct = optionProcess( &libtoolOptions, argc, argv );
+ argc -= ct;
+ argv += ct;
+ if (! HAVE_OPT( MODE ))
+ validateMode( argc, argv );
+ }
+
+ switch (OPT_VALUE_MODE) {
+ case MODE_EXECUTE:
+ case MODE_CLEAN:
+ case MODE_FINISH:
+ case MODE_INSTALL:
+ case MODE_UNINSTALL:
+ /*
+ * Options prohibited for all states except link & compile
+ */
+ if (HAVE_OPT( OUTPUT_FILE )) {
+ fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "output-file" );
+ USAGE( EXIT_FAILURE );
+ /* NOTREACHED */
+ }
+ if (HAVE_OPT( STATIC )) {
+ fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "static" );
+ USAGE( EXIT_FAILURE );
+ /* NOTREACHED */
+ }
+ if (HAVE_OPT( DYNAMIC )) {
+ fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "dynamic" );
+ USAGE( EXIT_FAILURE );
+ /* NOTREACHED */
+ }
+
+ /*
+ * dlopen is allowed for execute, but nothing else. So, for
+ * other modes, fall through and check for DLOPEN.
+ */
+ if (OPT_VALUE_MODE == MODE_EXECUTE)
+ break;
+ /* FALLTHROUGH */
+
+ case MODE_LINK:
+ case MODE_COMPILE:
+ if (HAVE_OPT( DLOPEN )) {
+ fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "dlopen" );
+ USAGE( EXIT_FAILURE );
+ /* NOTREACHED */
+ }
+ break;
+
+ case MODE_ECHO:
+ /*
+ * We ignore all conflicts for echo mode
+ */
+ for (;;) {
+ fputs( *(argv++), stdout );
+ if (--argc <= 0)
+ break;
+ fputc( ' ', stdout );
+ }
+
+ fputc( '\n', stdout );
+ return EXIT_SUCCESS;
+
+ default:
+ fprintf( stderr, zBadMode, libtoolOptions.pzProgName );
+ USAGE( EXIT_FAILURE );
+ /* NOTREACHED */
+ }
+
+ pz_cmd_name = argv[0];
+ signal( SIGPIPE, handleSignal );
+ signal( SIGBUS, handleSignal );
+ signal( SIGSEGV, handleSignal );
+
+ assert( OPT_VALUE_MODE < MODE_CT );
+ {
+ emitScriptProc* pEP = ap_emitProc[ OPT_VALUE_MODE ];
+ if (pEP == NULL) {
+ fprintf( stderr, "We're in the wrong mode: %d\n",
+ OPT_VALUE_MODE );
+ USAGE( EXIT_FAILURE );
+ }
+ (*pEP)( argc, argv );
+ }
+
+ return scriptStatus;
+}
+
/*
* Handle SIGPIPE and SIGSEGV by telling emitScript() to call close.
*/
- void
-handleSignal( int signo )
+LOCAL void
+handleSignal( signo )
+ int signo; /*end-decl*/
{
signalReceived = signo;
}
* this routine will be called, too. However, it will choke. If that
* is a problem, then check `fp' for being stdout.
*/
- void
-closeScript( FILE* fp )
+EXPORT void
+closeScript( fp )
+ FILE* fp; /*end-decl*/
{
int scriptStatus = pclose( fp );
}
}
-/*
- * The usage text varies a bit, depending on operational mode.
- * Therefore, catch the usage call, do the variation and then
- * finish up with the library routine.
- */
- void
-modalUsage( pOpts, exitCode )
- tOptions* pOpts;
- int exitCode;
-{
- tSCC zFmt[] = "%s --mode=%s";
- char z[ 256 ];
-
- if (HAVE_OPT( MODE )) {
- sprintf( z, zFmt, pOpts->pzProgName,
- pOpts->pOptDesc[ OPT_VALUE_MODE ].pz_Name );
- pOpts->pzProgName = z;
- pOpts->pzExplain = apz_mode_explain[ OPT_VALUE_MODE ];
- }
- optionUsage( pOpts, exitCode );
-}
-
-
- void
+LOCAL void
validateMode( argct, argvec )
int argct;
- char** argvec;
+ char** argvec; /*end-decl*/
{
char* pzCmd = *argvec;
char* pzEnd = pzCmd + strlen( pzCmd );
}
- void
+EXPORT void
emitShellQuoted( pzArg, outFp )
tCC* pzArg;
- FILE* outFp;
+ FILE* outFp; /*end-decl*/
{
for (;;) {
char ch = *(pzArg++);
}
- void
+EXPORT void
emitShellArg( pzArg, outFp )
tCC* pzArg;
- FILE* outFp;
+ FILE* outFp; /*end-decl*/
{
tSCC zMetas[] = "<>{}()[]|&^#~*;?$`'\"\\ \t\v\f\r\n";
}
- void
+EXPORT void
emitScript( argc, argv )
- int argc;
- char** argv;
+ int argc;
+ char** argv; /*end-decl*/
{
tSCC zDbgFmt[] = "set -x\n";
tSCC zQuiet[] = "run=\nshow=%s\n";
* that one of the command scripts depends upon.
*/
fprintf( fp, zModeName, libtoolOptions.pzProgName,
- libtoolOptions.pOptDesc[ OPT_VALUE_MODE ].pz_Name );
+ apzModeName[ OPT_VALUE_MODE ]);
CKSERV;
fprintf( fp, zMode, libtoolOptions.pzProgName );
CKSERV;
}
-void
-emitCommands( FILE* fp, tCC* pzCmds )
+EXPORT void
+emitCommands( fp, pzCmds )
+ FILE* fp;
+ tCC* pzCmds; /*end-decl*/
{
fputc( '\n', fp );
fflush( fp );
if (fp != stdout)
closeScript( fp );
}
-
-
- int
-main( argc, argv )
- int argc;
- char** argv;
-{
- pzHost = getenv( "host" );
- if (pzHost == (char*)NULL)
- pzHost = zUnkn;
-
- /*
- * Process the options, removing them from the arg list.
- * Make sure the resulting state is sane.
- */
- {
- int ct = optionProcess( &libtoolOptions, argc, argv );
- argc -= ct;
- argv += ct;
- if (! HAVE_OPT( MODE ))
- validateMode( argc, argv );
- }
-
- switch (OPT_VALUE_MODE) {
- case MODE_EXECUTE:
- case MODE_CLEAN:
- case MODE_FINISH:
- case MODE_INSTALL:
- case MODE_UNINSTALL:
- /*
- * Options prohibited for all states except link & compile
- */
- if (HAVE_OPT( OUTPUT_FILE )) {
- fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "output-file" );
- USAGE( EXIT_FAILURE );
- /* NOTREACHED */
- }
- if (HAVE_OPT( STATIC )) {
- fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "static" );
- USAGE( EXIT_FAILURE );
- /* NOTREACHED */
- }
- if (HAVE_OPT( DYNAMIC )) {
- fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "dynamic" );
- USAGE( EXIT_FAILURE );
- /* NOTREACHED */
- }
-
- /*
- * dlopen is allowed for execute, but nothing else. So, for
- * other modes, fall through and check for DLOPEN.
- */
- if (OPT_VALUE_MODE == MODE_EXECUTE)
- break;
- /* FALLTHROUGH */
-
- case MODE_LINK:
- case MODE_COMPILE:
- if (HAVE_OPT( DLOPEN )) {
- fprintf( stderr, zBadOpt, libtoolOptions.pzProgName, "dlopen" );
- USAGE( EXIT_FAILURE );
- /* NOTREACHED */
- }
- break;
-
- case MODE_ECHO:
- /*
- * We ignore all conflicts for echo mode
- */
- for (;;) {
- fputs( *(argv++), stdout );
- if (--argc <= 0)
- break;
- fputc( ' ', stdout );
- }
-
- fputc( '\n', stdout );
- return EXIT_SUCCESS;
-
- default:
- fprintf( stderr, zBadMode, libtoolOptions.pzProgName );
- USAGE( EXIT_FAILURE );
- /* NOTREACHED */
- }
-
- pz_cmd_name = argv[0];
- signal( SIGPIPE, handleSignal );
- signal( SIGBUS, handleSignal );
- signal( SIGSEGV, handleSignal );
-
- assert( OPT_VALUE_MODE < MODE_CT );
- {
- emitScriptProc* pEP = ap_emitProc[ OPT_VALUE_MODE ];
- if (pEP == NULL) {
- fprintf( stderr, "We're in the wrong mode: %d\n",
- OPT_VALUE_MODE );
- USAGE( EXIT_FAILURE );
- }
- (*pEP)( argc, argv );
- }
-
- return scriptStatus;
-}
/*
* Local Variables:
* c-file-style: "stroustrup"
libtool : ltmain
./ltmain --mode=link $(CC) -o $@ $(OBJ) -lopts
+
+fwd:
+ for f in `egrep -l '^LOCAL ' *.c` ; do \
+ ( sed '/BEGIN-STATIC-FORWARD/q' $$f ; \
+ sed -n '1,/END-STATIC-FORWARD/d;/^LOCAL /,/^{/p' $$f | \
+ sed 's/^\([a-zA-Z0-9_]*\)(.*/\1 LT_PARAMS((/;\
+ s/;/,/;\
+ s=,[ \t]*/\*end-decl.*= ));=;\
+ s/^{//' ;\
+ echo '/* END-STATIC-FORWARD */';\
+ sed '1,/END-STATIC-FORWARD/d' $$f ) > XXX ; \
+ if cmp XXX $$f > /dev/null ; then rm -f XXX ; else mv -f XXX $$f ; fi ; \
+ done
\tlink create a library or an executable
\trelink (synonym for `link')
\tuninstall remove libraries from an installed directory
-\techo the program behaves as a reimplementation of echo";
+\techo the program behaves as a reimplementation of echo
+
+Use --mode=xxx before the --help option to get more help on one of the modes.";
include =
arg_type = keyword;
arg_name = mode;
settable;
+ immediate; /* must be able to take effect before ``--help'' */
+ no-preset;
descrip = "ltmain's operational mode";
/*
doc =
"This enumerates all of the libtool operational modes.\n"
"If this option is not specified, then this program tries to infer\n"
- "it from the command name or the name of the file being operated on.";
+ "it from the command name or the name of the file being operated on.\n"
+ "If this option is set before the ``--help'' option on the command line,\n"
+ "then explanitory text for that mode will be included in the usage text.";
};
flag = {
=]
[=IF (== (suffix) "h")=]extern [=
- ENDIF=]tCC* apz_mode_explain[ MODE_CT ][=
+ ENDIF=]tCC* apzModeExplain[ MODE_CT ][=
IF (== (suffix) "c") =] = {[=
FOR string , =]
ENDIF =];
[=IF (== (suffix) "h")=]extern [=
- ENDIF=]tCC* apz_mode_cmd[ MODE_CT ][=
+ ENDIF=]tCC* apz_mode_cmd[ MODE_CT ][=
IF (== (suffix) "c") =] = {
[=(shellf "columns -I4 -S, <<_EOF_\n%s_EOF_" cmd-list) =]
}[=
FOR string , =]
[=?% call-proc "%s" emitScript=][=
ENDFOR =]
-};[=
+}[=
+
+ENDIF =];
+
+[=IF (== (suffix) "h")=]extern [=
+ ENDIF=]tCC* apzModeName[ MODE_CT+1 ][=
+IF (== (suffix) "c") =] = { NULL[=
+
+ FOR string =],
+ "[=str-name=]"[=
+ ENDFOR =]
+}[=
+
+ENDIF =];[=
-ELSE =];
+IF (== (suffix) "h") =]
+
+#define EXPORT
+#ifdef DEBUG
+# define LOCAL
+#else
+# define LOCAL static
+#endif
extern int signalReceived;
extern int scriptStatus;
-
-extern void closeScript LT_PARAMS(( FILE* fp ));
-extern void modalUsage LT_PARAMS(( tOptions* pOpts, int exitCode ));
-extern void emitShellQuoted LT_PARAMS(( tCC* pzArg, FILE* outFp ));
-extern void emitShellArg LT_PARAMS(( tCC* pzArg, FILE* outFp ));
-extern void emitCommands LT_PARAMS(( FILE* fp, tCC* pzCmds ));
+[=`
+for f in \`egrep -l '^EXPORT ' *.c\`
+do
+ sed -n '/^EXPORT /,/^{/p' $f
+done | \
+sed '
+ s/EXPORT /extern /
+ s/^\\([a-zA-Z0-9_]*\\)(.*/\\1 LT_PARAMS((/
+ s/;/,/
+ s=,[ \t]*/\\*end-decl.*= ));=
+ s/^{//' `=]
#endif /* [=(. header-guard)=] */[=
#include <stdio.h>
#include <stdlib.h>
-#include "options.h"
+#include "ltstr.h"
#include "ltopts.h"
tSCC zAO[] =
\t'c' - version and copyright\n\
\t'n' - version and copyright notice\n";
+/* BEGIN-STATIC-FORWARD */
+/* END-STATIC-FORWARD */
- void
+EXPORT void
doVersion( pOpts, pOD )
tOptions* pOpts;
- tOptDesc* pOD;
+ tOptDesc* pOD; /*end-decl*/
{
char swCh;
exit( EXIT_SUCCESS );
}
+
+
+EXPORT void
+modalUsage( pOpts, exitCode )
+ tOptions* pOpts;
+ int exitCode; /*end-decl*/
+{
+ char z[ 256 ];
+
+ if (OPT_VALUE_MODE != MODE_UNDEFINED) {
+ tSCC zFmt[] = "%s --mode=%s";
+
+ sprintf( z, zFmt, pOpts->pzProgName, apzModeName[ OPT_VALUE_MODE ]);
+ pOpts->pzProgName = z;
+ pOpts->pzExplain = apzModeExplain[ OPT_VALUE_MODE ];
+ }
+
+ optionUsage( pOpts, exitCode );
+}
/*
* Local Variables:
* c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * tab-width: 4
* End:
* version.c ends here */