diff -rc2P gengetopt-2.0/ChangeLog gengetopt-2.1/ChangeLog *** gengetopt-2.0/ChangeLog Tue Aug 1 10:36:21 2000 --- gengetopt-2.1/ChangeLog Wed Sep 20 23:44:43 2000 *************** *** 1,2 **** --- 1,23 ---- + 2000-09-20 Lorenzo Bettini (LAP) + + * NEWS: version 2.1 released + + * doc/Makefile.am: examples are installed in a subdirectory + under doc + + * doc/gengetopt.html.in: the version number is substituted by + configure + + * src/gm.c: (generate_cmdline_parser) fixed a bug for the generated + code, a malloc was not casted + + * doc/gengetopt.1.in: modified by James R. Van Zandt + + + * doc/gengetopt.html: we do not include sections from the GNU + coding standards. + + * LICENSE: the generated code is not under any license + 2000-08-01 Lorenzo Bettini diff -rc2P gengetopt-2.0/LICENSE gengetopt-2.1/LICENSE *** gengetopt-2.0/LICENSE Sun Jul 30 14:04:25 2000 --- gengetopt-2.1/LICENSE Wed Sep 20 21:25:54 2000 *************** *** 2,7 **** to parse command line arguments - Copyright (C) 1999 Roberto Arturo Tena Sanchez Copyright (C) 2000 Free Software Foundation This program is free software; you can redistribute it and/or modify --- 2,7 ---- to parse command line arguments Copyright (C) 2000 Free Software Foundation + Copyright (C) 1999 Roberto Arturo Tena Sanchez This program is free software; you can redistribute it and/or modify *************** *** 9,12 **** --- 9,15 ---- the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + + Use of gengetopt does not impose any particular license on the + generated code. This program is distributed in the hope that it will be useful, diff -rc2P gengetopt-2.0/Makefile.in gengetopt-2.1/Makefile.in *** gengetopt-2.0/Makefile.in Tue Aug 1 10:37:58 2000 --- gengetopt-2.1/Makefile.in Wed Sep 20 23:46:20 2000 *************** *** 80,83 **** --- 80,84 ---- YFLAGS = @YFLAGS@ gengetoptdocdir = @gengetoptdocdir@ + gengetoptexamplesdir = @gengetoptexamplesdir@ EXTRA_DIST = reconf configure TODO LICENSE diff -rc2P gengetopt-2.0/NEWS gengetopt-2.1/NEWS *** gengetopt-2.0/NEWS Sun Jul 30 16:27:39 2000 --- gengetopt-2.1/NEWS Wed Sep 20 23:44:09 2000 *************** *** 6,9 **** --- 6,17 ---- Please send gengetopt bug reports to bug-gengetopt@gnu.org + Version 2.1 + + * It is made more clear that use of gengetopt does not impose any + particular license on the generated code. + * A bug in the generation of code (for some new C++ compilers) was fixed, + thanks to "James R. Van Zandt" + * Some modifications to the man page, also due to James. + * a directory for examples is specifically created (suggested by James). Version 2.0 diff -rc2P gengetopt-2.0/README gengetopt-2.1/README *** gengetopt-2.0/README Tue Aug 1 10:34:39 2000 --- gengetopt-2.1/README Wed Sep 20 23:42:33 2000 *************** *** 1,5 **** ! GNU Gengetopt 2.0 ! July 1st 2000 This program generate a C function that uses getopt_long function to parse --- 1,5 ---- ! GNU Gengetopt 2.1 ! September 20th, 2000 This program generate a C function that uses getopt_long function to parse *************** *** 13,23 **** with - and consist of only one character) can be handled. For standards about short and long options you may want to take a look at the GNU Coding ! Standards. The sections which concerns this subject can also be found in doc ! directory: standards_14.html and standards_15.html. gengetopt is free software. Please see the file LICENSE and COPYING for ! details. For documentation, please read this file. As it is a GPL program, ! we provide sources (~100k), but if you don't fell like compiling it, you can ! download Win32 executable (new). The code generated is not under any license. --- 13,26 ---- with - and consist of only one character) can be handled. For standards about short and long options you may want to take a look at the GNU Coding ! Standards. gengetopt is free software. Please see the file LICENSE and COPYING for ! details. ! Notice that: Use of gengetopt does not impose any particular license on the ! generated code. ! ! For documentation, please read this file. As it is a GPL program, we provide ! sources (~100k), but if you don't fell like compiling it, you can download ! Win32 executable (new). The code generated is not under any license. *************** *** 30,34 **** Gengetopt has originally been written by Roberto Arturo Tena Sanchez , and currently maintained by Lorenzo Bettini ! . Gengetopt is a GNU program, so you can download it from GNU's ftp site: --- 33,37 ---- Gengetopt has originally been written by Roberto Arturo Tena Sanchez , and currently maintained by Lorenzo Bettini ! . Gengetopt is a GNU program, so you can download it from GNU's ftp site: *************** *** 55,58 **** --- 58,70 ---- Changes in this release + * It is made more clear that use of gengetopt does not impose any + particular license on the generated code. + * A bug in the generation of code (for some new C++ compilers) was fixed, + thanks to "James R. Van Zandt" + * Some modifications to the man page, also due to James. + * a directory for examples is specifically created (suggested by James). + + Changes in release 2.0 + This is quite a totally new release: *************** *** 86,90 **** * Executables -> /prefix/bin ! * docs and samples -> /prefix/share/doc/gengetopt * util files -> /prefix/share/gengetopt --- 98,103 ---- * Executables -> /prefix/bin ! * docs -> /prefix/share/doc/gengetopt ! * examples -> /prefix/share/doc/gengetopt/examples * util files -> /prefix/share/gengetopt *************** *** 219,223 **** /* cmdline1.h */ ! /* File autogenerated by gengetopt version 2.0 */ #ifndef _cmdline1_h --- 232,236 ---- /* cmdline1.h */ ! /* File autogenerated by gengetopt version 2.1 */ #ifndef _cmdline1_h *************** *** 368,372 **** $ gengetopt --help ! gengetopt 2.0 Usage: gengetopt [OPTIONS]... -h --help Print help and exit --- 381,385 ---- $ gengetopt --help ! gengetopt 2.1 Usage: gengetopt [OPTIONS]... -h --help Print help and exit *************** *** 428,432 **** http://infostud.dsi.unifi.it/~bettini, (very fast if you're in University) ! . gengetopt is free software. See the file LICENSE and COPYING for copying --- 441,445 ---- http://infostud.dsi.unifi.it/~bettini, (very fast if you're in University) ! . gengetopt is free software. See the file LICENSE and COPYING for copying diff -rc2P gengetopt-2.0/TODO gengetopt-2.1/TODO *** gengetopt-2.0/TODO Sun Jul 30 16:27:39 2000 --- gengetopt-2.1/TODO Wed Sep 20 21:40:55 2000 *************** *** 62,63 **** --- 62,68 ---- customize help and version printing + + when you touch src/cmdline.ggo, the first time cmdline.c is recreated, + then if you run make once again also gengetopt.c is recompiled... + maybe we should state that cmdline.c is a generated file, so that it + is checked first. \ No newline at end of file diff -rc2P gengetopt-2.0/configure gengetopt-2.1/configure *** gengetopt-2.0/configure Tue Aug 1 08:48:50 2000 --- gengetopt-2.1/configure Wed Sep 20 23:23:26 2000 *************** *** 699,703 **** PACKAGE=gengetopt ! VERSION=2.0 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then --- 699,703 ---- PACKAGE=gengetopt ! VERSION=2.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then *************** *** 783,793 **** - gengetoptdocdir=$datadir/doc/gengetopt # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:792: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 783,795 ---- gengetoptdocdir=$datadir/doc/gengetopt + + gengetoptexamplesdir=$gengetoptdocdir/examples + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:794: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 819,823 **** set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:822: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 821,825 ---- set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:824: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 870,874 **** set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:873: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 872,876 ---- set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:875: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 902,906 **** echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:905: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c --- 904,908 ---- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:907: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c *************** *** 913,922 **** cat > conftest.$ac_ext << EOF ! #line 916 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. --- 915,924 ---- cat > conftest.$ac_ext << EOF ! #line 918 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. *************** *** 944,953 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:947: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:952: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 946,955 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:949: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:954: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 958,962 **** #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else --- 960,964 ---- #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else *************** *** 977,981 **** CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:980: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 979,983 ---- CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:982: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1013,1017 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1016: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1015,1019 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1018: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1045,1049 **** echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1048: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C --- 1047,1051 ---- echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1050: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C *************** *** 1056,1065 **** cat > conftest.$ac_ext << EOF ! #line 1059 "configure" #include "confdefs.h" int main(){return(0);} EOF ! if { (eval echo configure:1064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. --- 1058,1067 ---- cat > conftest.$ac_ext << EOF ! #line 1061 "configure" #include "confdefs.h" int main(){return(0);} EOF ! if { (eval echo configure:1066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. *************** *** 1087,1096 **** fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1090: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1095: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1089,1098 ---- fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1092: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1097: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1101,1105 **** #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else --- 1103,1107 ---- #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else *************** *** 1120,1124 **** CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1123: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1122,1126 ---- CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1125: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1156,1160 **** enableval="$enable_warnings" echo $ac_n "checking maximum warning verbosity option""... $ac_c" 1>&6 ! echo "configure:1159: checking maximum warning verbosity option" >&5 if test -n "$CXX" then --- 1158,1162 ---- enableval="$enable_warnings" echo $ac_n "checking maximum warning verbosity option""... $ac_c" 1>&6 ! echo "configure:1161: checking maximum warning verbosity option" >&5 if test -n "$CXX" then *************** *** 1184,1193 **** echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 ! echo "configure:1187: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1189: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes --- 1202,1206 ---- ; return 0; } EOF ! if { (eval echo configure:1205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes *************** *** 1217,1226 **** test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:1220: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1222: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes --- 1231,1235 ---- ; return 0; } EOF ! if { (eval echo configure:1234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes *************** *** 1248,1252 **** echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1251: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1250,1254 ---- echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1253: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1258,1262 **** echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in --- 1260,1264 ---- echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *************** *** 1284,1288 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1287: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1286,1290 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1289: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1318,1322 **** echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1321: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then --- 1320,1324 ---- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1323: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then *************** *** 1333,1337 **** # not just through cpp. cat > conftest.$ac_ext < --- 1335,1339 ---- # not just through cpp. cat > conftest.$ac_ext < *************** *** 1339,1343 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then --- 1341,1345 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then *************** *** 1350,1354 **** CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < --- 1352,1356 ---- CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < *************** *** 1356,1360 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then --- 1358,1362 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then *************** *** 1367,1371 **** CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < --- 1369,1373 ---- CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < *************** *** 1373,1377 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then --- 1375,1379 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then *************** *** 1403,1407 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1406: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1405,1409 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1408: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1436,1440 **** set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1439: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1438,1442 ---- set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1441: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1470,1474 **** esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 ! echo "configure:1473: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 1472,1476 ---- esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 ! echo "configure:1475: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 1478,1482 **** LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 1491,1495 ---- ; return 0; } EOF ! if { (eval echo configure:1494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 1512,1516 **** echo $ac_n "checking lex output file root""... $ac_c" 1>&6 ! echo "configure:1515: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1514,1518 ---- echo $ac_n "checking lex output file root""... $ac_c" 1>&6 ! echo "configure:1517: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1533,1537 **** echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 ! echo "configure:1536: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1535,1539 ---- echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 ! echo "configure:1538: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1545,1549 **** LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes --- 1554,1558 ---- ; return 0; } EOF ! if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes *************** *** 1575,1579 **** echo $ac_n "checking for main in -lfl""... $ac_c" 1>&6 ! echo "configure:1578: checking for main in -lfl" >&5 ac_lib_var=`echo fl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then --- 1577,1581 ---- echo $ac_n "checking for main in -lfl""... $ac_c" 1>&6 ! echo "configure:1580: checking for main in -lfl" >&5 ac_lib_var=`echo fl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then *************** *** 1583,1587 **** LIBS="-lfl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" --- 1592,1596 ---- ; return 0; } EOF ! if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" *************** *** 1621,1630 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1624: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1626: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 1651,1655 ---- ; return 0; } EOF ! if { (eval echo configure:1654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 1677,1686 **** echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1680: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 1679,1688 ---- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1682: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 1690,1694 **** EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then --- 1692,1696 ---- EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then *************** *** 1707,1711 **** # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < --- 1709,1713 ---- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < *************** *** 1725,1729 **** # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < --- 1727,1731 ---- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < *************** *** 1746,1750 **** else cat > conftest.$ac_ext < --- 1748,1752 ---- else cat > conftest.$ac_ext < *************** *** 1757,1761 **** EOF ! if { (eval echo configure:1760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : --- 1759,1763 ---- EOF ! if { (eval echo configure:1762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : *************** *** 1784,1798 **** ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1787: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then --- 1786,1800 ---- ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1789: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then *************** *** 1822,1831 **** echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:1825: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1827: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes --- 1878,1882 ---- ; return 0; } EOF ! if { (eval echo configure:1881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes *************** *** 1900,1909 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1903: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1905: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 1930,1934 ---- ; return 0; } EOF ! if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 1958,1967 **** do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1961: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1963: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 1988,1992 ---- ; return 0; } EOF ! if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" *************** *** 2017,2021 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2020: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2019,2023 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2022: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2058,2062 **** set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2061: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CPP2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2060,2064 ---- set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2063: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CPP2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2223,2227 **** ac_given_INSTALL="$INSTALL" ! trap 'rm -fr `echo "Makefile src/Makefile doc/Makefile doc/gengetopt.1 config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF --- 2329,2333 ---- cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff -rc2P gengetopt-2.0/configure.in gengetopt-2.1/configure.in *** gengetopt-2.0/configure.in Tue Aug 1 08:40:36 2000 --- gengetopt-2.1/configure.in Wed Sep 20 23:23:17 2000 *************** *** 1,7 **** # Copyright (C) 2000 Lorenzo Bettini # ! # This file is free software; as a special exception the author gives ! # unlimited permission to copy and/or distribute it, with or without ! # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but --- 1,5 ---- # Copyright (C) 2000 Lorenzo Bettini # ! # This file is free software; see LICENSE # # This program is distributed in the hope that it will be useful, but *************** *** 14,24 **** AM_CONFIG_HEADER(config.h) ! AM_INIT_AUTOMAKE(gengetopt,2.0) dnl directory for docs (html) AC_SUBST(gengetoptdocdir) - gengetoptdocdir=$datadir/doc/gengetopt dnl Checks for C compiler. AC_PROG_CC --- 12,25 ---- AM_CONFIG_HEADER(config.h) ! AM_INIT_AUTOMAKE(gengetopt,2.1) dnl directory for docs (html) AC_SUBST(gengetoptdocdir) gengetoptdocdir=$datadir/doc/gengetopt + dnl directory for examples + AC_SUBST(gengetoptexamplesdir) + gengetoptexamplesdir=$gengetoptdocdir/examples + dnl Checks for C compiler. AC_PROG_CC *************** *** 74,76 **** AM_CONDITIONAL(NO_CPP2HTML, test -z "$ac_cv_path_CPP2HTML" ) ! AC_OUTPUT(Makefile src/Makefile doc/Makefile doc/gengetopt.1) --- 75,77 ---- AM_CONDITIONAL(NO_CPP2HTML, test -z "$ac_cv_path_CPP2HTML" ) ! AC_OUTPUT(Makefile src/Makefile doc/Makefile doc/gengetopt.1 doc/gengetopt.html) diff -rc2P gengetopt-2.0/doc/Makefile.am gengetopt-2.1/doc/Makefile.am *** gengetopt-2.0/doc/Makefile.am Tue Aug 1 09:18:19 2000 --- gengetopt-2.1/doc/Makefile.am Wed Sep 20 23:14:50 2000 *************** *** 52,59 **** LDADD = $(GETOPTLONG_O) $(STRDUP_O) ! gengetoptdoc_DATA = gengetopt.html standards_14.html standards_15.html \ ! cmdline1.c.html sample1.ggo sample2.ggo main1.cc main2.c \ ! cmdline1.c cmdline1.h cmdline2.c cmdline2.h \ man_getopt.html no_getopt_long.txt EXTRA_DIST = sample1.ggo sample2.ggo samples.stamp \ --- 52,61 ---- LDADD = $(GETOPTLONG_O) $(STRDUP_O) ! gengetoptdoc_DATA = gengetopt.html \ ! cmdline1.c.html \ man_getopt.html no_getopt_long.txt + + gengetoptexamples_DATA = sample1.ggo sample2.ggo main1.cc main2.c \ + cmdline1.c cmdline1.h cmdline2.c cmdline2.h EXTRA_DIST = sample1.ggo sample2.ggo samples.stamp \ diff -rc2P gengetopt-2.0/doc/Makefile.in gengetopt-2.1/doc/Makefile.in *** gengetopt-2.0/doc/Makefile.in Tue Aug 1 10:38:02 2000 --- gengetopt-2.1/doc/Makefile.in Wed Sep 20 23:46:25 2000 *************** *** 83,86 **** --- 83,87 ---- YFLAGS = @YFLAGS@ gengetoptdocdir = @gengetoptdocdir@ + gengetoptexamplesdir = @gengetoptexamplesdir@ PROGNAME = $(top_builddir)/src/gengetopt$(EXEEXT) *************** *** 105,109 **** LDADD = $(GETOPTLONG_O) $(STRDUP_O) ! gengetoptdoc_DATA = gengetopt.html standards_14.html standards_15.html cmdline1.c.html sample1.ggo sample2.ggo main1.cc main2.c cmdline1.c cmdline1.h cmdline2.c cmdline2.h man_getopt.html no_getopt_long.txt --- 106,113 ---- LDADD = $(GETOPTLONG_O) $(STRDUP_O) ! gengetoptdoc_DATA = gengetopt.html cmdline1.c.html man_getopt.html no_getopt_long.txt ! ! ! gengetoptexamples_DATA = sample1.ggo sample2.ggo main1.cc main2.c cmdline1.c cmdline1.h cmdline2.c cmdline2.h *************** *** 115,119 **** mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h ! CONFIG_CLEAN_FILES = gengetopt.1 DEFS = @DEFS@ -I. -I$(srcdir) -I.. --- 119,123 ---- mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h ! CONFIG_CLEAN_FILES = gengetopt.1 gengetopt.html DEFS = @DEFS@ -I. -I$(srcdir) -I.. *************** *** 127,135 **** @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o \ @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/strdup.o - @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@sample1_DEPENDENCIES = \ - @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@$(top_builddir)/src/strdup.o @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@sample1_DEPENDENCIES = \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt.o \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o sample1_LDFLAGS = sample2_OBJECTS = main2.o cmdline2.o --- 131,139 ---- @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o \ @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/strdup.o @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@sample1_DEPENDENCIES = \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt.o \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o + @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@sample1_DEPENDENCIES = \ + @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@$(top_builddir)/src/strdup.o sample1_LDFLAGS = sample2_OBJECTS = main2.o cmdline2.o *************** *** 140,148 **** @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o \ @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/strdup.o - @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@sample2_DEPENDENCIES = \ - @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@$(top_builddir)/src/strdup.o @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@sample2_DEPENDENCIES = \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt.o \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o sample2_LDFLAGS = CXXFLAGS = @CXXFLAGS@ --- 144,152 ---- @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o \ @NO_STRDUP_TRUE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/strdup.o @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@sample2_DEPENDENCIES = \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt.o \ @NO_STRDUP_FALSE@@NO_GETOPTLONG_TRUE@$(top_builddir)/src/getopt1.o + @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@sample2_DEPENDENCIES = \ + @NO_STRDUP_TRUE@@NO_GETOPTLONG_FALSE@$(top_builddir)/src/strdup.o sample2_LDFLAGS = CXXFLAGS = @CXXFLAGS@ *************** *** 158,164 **** NROFF = nroff ! DATA = $(gengetoptdoc_DATA) ! DIST_COMMON = Makefile.am Makefile.in gengetopt.1.in --- 162,168 ---- NROFF = nroff ! DATA = $(gengetoptdoc_DATA) $(gengetoptexamples_DATA) ! DIST_COMMON = Makefile.am Makefile.in gengetopt.1.in gengetopt.html.in *************** *** 181,184 **** --- 185,190 ---- gengetopt.1: $(top_builddir)/config.status gengetopt.1.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + gengetopt.html: $(top_builddir)/config.status gengetopt.html.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status .c.o: *************** *** 269,272 **** --- 275,297 ---- done + install-gengetoptexamplesDATA: $(gengetoptexamples_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(gengetoptexamplesdir) + @list='$(gengetoptexamples_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gengetoptexamplesdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gengetoptexamplesdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gengetoptexamplesdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(gengetoptexamplesdir)/$$p; \ + fi; fi; \ + done + + uninstall-gengetoptexamplesDATA: + @$(NORMAL_UNINSTALL) + list='$(gengetoptexamples_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(gengetoptexamplesdir)/$$p; \ + done + tags: TAGS *************** *** 313,316 **** --- 338,343 ---- fi; \ done + main1.o: main1.cc cmdline1.h + main2.o: main2.c ../config.h getopt.h cmdline2.h info-am: *************** *** 325,329 **** install-exec: install-exec-am ! install-data-am: install-man install-gengetoptdocDATA install-data: install-data-am --- 352,357 ---- install-exec: install-exec-am ! install-data-am: install-man install-gengetoptdocDATA \ ! install-gengetoptexamplesDATA install-data: install-data-am *************** *** 331,335 **** @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am ! uninstall-am: uninstall-man uninstall-gengetoptdocDATA uninstall: uninstall-am all-am: Makefile $(MANS) $(DATA) --- 359,364 ---- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am ! uninstall-am: uninstall-man uninstall-gengetoptdocDATA \ ! uninstall-gengetoptexamplesDATA uninstall: uninstall-am all-am: Makefile $(MANS) $(DATA) *************** *** 338,342 **** $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: ! $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(gengetoptdocdir) --- 367,372 ---- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: ! $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(gengetoptdocdir) \ ! $(DESTDIR)$(gengetoptexamplesdir) *************** *** 375,379 **** .PHONY: mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile install-man1 uninstall-man1 install-man \ ! uninstall-man uninstall-gengetoptdocDATA install-gengetoptdocDATA tags \ mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ distdir info-am info dvi-am dvi check check-am installcheck-am \ --- 405,410 ---- .PHONY: mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile install-man1 uninstall-man1 install-man \ ! uninstall-man uninstall-gengetoptdocDATA install-gengetoptdocDATA \ ! uninstall-gengetoptexamplesDATA install-gengetoptexamplesDATA tags \ mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ distdir info-am info dvi-am dvi check check-am installcheck-am \ diff -rc2P gengetopt-2.0/doc/cmdline1.c gengetopt-2.1/doc/cmdline1.c *** gengetopt-2.0/doc/cmdline1.c Tue Aug 1 09:18:26 2000 --- gengetopt-2.1/doc/cmdline1.c Wed Sep 20 23:26:23 2000 *************** *** 1,6 **** /* ! File autogenerated by gengetopt version 2.0 generated with the following command: ../src/gengetopt -isample1.ggo -Fcmdline1 --long-help -u */ --- 1,10 ---- /* ! File autogenerated by gengetopt version 2.1 generated with the following command: ../src/gengetopt -isample1.ggo -Fcmdline1 --long-help -u + + The developers of gengetopt consider the fixed text that goes in all + gengetopt output files to be in the public domain: + we make no copyright claims on it. */ *************** *** 53,57 **** char * n, * pn, * ps = s; while (*ps) ps++; ! n = malloc (1 + ps - s); if (n != NULL) { --- 57,61 ---- char * n, * pn, * ps = s; while (*ps) ps++; ! n = (char *) malloc (1 + ps - s); if (n != NULL) { diff -rc2P gengetopt-2.0/doc/cmdline1.c.html gengetopt-2.1/doc/cmdline1.c.html *** gengetopt-2.0/doc/cmdline1.c.html Tue Aug 1 09:18:26 2000 --- gengetopt-2.1/doc/cmdline1.c.html Wed Sep 20 23:26:27 2000 *************** *** 13,42 ****
  
! /*
!   File autogenerated by gengetopt version 2.0  
    generated with the following command:
    ../src/gengetopt -isample1.ggo -Fcmdline1 --long-help -u 
- */
  
! 
! #include <stdio.h>
! #include <stdlib.h>
! #include <string.h>
! /* If we use autoconf.  */
! #ifdef HAVE_CONFIG_H
! #include "config.h"
! #endif
! /* Check for configure's getopt check result.  */
! #ifndef HAVE_GETOPT_LONG
! #include "getopt.h"
! #else
! #include <getopt.h>
! #endif
! 
! #include "cmdline1.h"
! 
! /* Don't define PACKAGE and VERSION if we use automake.  */
! #define PACKAGE "sample1"
! #define VERSION "2.0"
  
  
--- 13,46 ----
  
  
! /*
!   File autogenerated by gengetopt version 2.1  
    generated with the following command:
    ../src/gengetopt -isample1.ggo -Fcmdline1 --long-help -u 
  
!   The developers of gengetopt consider the fixed text that goes in all
!   gengetopt output files to be in the public domain:
!   we make no copyright claims on it.
! */
! 
! 
! #include <stdio.h>
! #include <stdlib.h>
! #include <string.h>
! /* If we use autoconf.  */
! #ifdef HAVE_CONFIG_H
! #include "config.h"
! #endif
! /* Check for configure's getopt check result.  */
! #ifndef HAVE_GETOPT_LONG
! #include "getopt.h"
! #else
! #include <getopt.h>
! #endif
! 
! #include "cmdline1.h"
! 
! /* Don't define PACKAGE and VERSION if we use automake.  */
! #define PACKAGE "sample1"
! #define VERSION "2.0"
  
  
***************
*** 66,98 ****
  {
    char * n, * pn, * ps = s;
!   while (*ps) ps++;
!   n = malloc (1 + ps - s);
!   if (n != NULL)
      {
!       for (ps=s,pn=n; *ps; ps++,pn++)
          *pn = *ps;
!       *pn = 0;
      }
!   return n;
  }
  
  
  int
! cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
  {
!   int c;	/* Character of the parsed option.  */
!   int missing_required_options = 0;	
  
!   args_info->help_given = 0 ;
!   args_info->version_given = 0 ;
!   args_info->str_opt_given = 0 ;
!   args_info->int_opt_given = 0 ;
!   args_info->funct_opt_given = 0 ;
!   args_info->flag_opt_given = 0 ;
  
! #define clear_args()
  { \
    args_info->str_opt_arg = NULL; \
!   args_info->flag_opt_flag = 0;\
  }
  
--- 70,102 ----
  {
    char * n, * pn, * ps = s;
!   while (*ps) ps++;
!   n = (char *) malloc (1 + ps - s);
!   if (n != NULL)
      {
!       for (ps=s,pn=n; *ps; ps++,pn++)
          *pn = *ps;
!       *pn = 0;
      }
!   return n;
  }
  
  
  int
! cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
  {
!   int c;	/* Character of the parsed option.  */
!   int missing_required_options = 0;	
  
!   args_info->help_given = 0 ;
!   args_info->version_given = 0 ;
!   args_info->str_opt_given = 0 ;
!   args_info->int_opt_given = 0 ;
!   args_info->funct_opt_given = 0 ;
!   args_info->flag_opt_given = 0 ;
  
! #define clear_args()
  { \
    args_info->str_opt_arg = NULL; \
!   args_info->flag_opt_flag = 0;\
  }
  
***************
*** 100,204 ****
  
    args_info->inputs = NULL;
!   args_info->inputs_num = 0;
  
!   while (1)
      {
!       int option_index = 0;
!       static struct option long_options[] = {
!         { "help",	0, NULL, 'h' },
!         { "version",	0, NULL, 'V' },
!         { "str-opt",	1, NULL, 's' },
!         { "int-opt",	1, NULL, 'i' },
!         { "funct-opt",	0, NULL, 'F' },
!         { "flag-opt",	0, NULL, 'x' },
!         { NULL,	0, NULL, 0 }
        };
  
        c = getopt_long (argc, argv, "hVs:i:Fx", long_options, &option_index);
  
!       if (c == -1) break;	/* Exit from `while (1)' loop.  */
  
!       switch (c)
          {
!         case 'h':	/* Print help and exit.  */
            clear_args ();
            print_help ();
!           exit (0);
  
!         case 'V':	/* Print version and exit.  */
            clear_args ();
            print_version ();
!           exit (0);
  
!         case 's':	/* A string option.  */
!           if (args_info->str_opt_given)
              {
                fprintf (stderr, "%s: `--str-opt' (`-s') option given more than once\n", PACKAGE);
                clear_args ();
                print_help ();
!               exit (1);
              }
!           args_info->str_opt_given = 1;
            args_info->str_opt_arg = gengetopt_strdup (optarg);
!           break;
  
!         case 'i':	/* A int option.  */
!           if (args_info->int_opt_given)
              {
                fprintf (stderr, "%s: `--int-opt' (`-i') option given more than once\n", PACKAGE);
                clear_args ();
                print_help ();
!               exit (1);
              }
!           args_info->int_opt_given = 1;
            args_info->int_opt_arg = atoi (optarg);
!           break;
  
!         case 'F':	/* A function option.  */
!           if (args_info->funct_opt_given)
              {
                fprintf (stderr, "%s: `--funct-opt' (`-F') option given more than once\n", PACKAGE);
                clear_args ();
                print_help ();
!               exit (1);
              }
!           args_info->funct_opt_given = 1;
!           break;
  
!         case 'x':	/* A flag option.  */
            args_info->flag_opt_flag = !(args_info->flag_opt_flag);
!           break;
  
!         case '?':	/* Invalid option.  */
!           /* `getopt_long' already printed an error message.  */
!           exit (1);
  
!         default:	/* bug: option not considered.  */
            fprintf (stderr, "%s: option unknown: %c\n", PACKAGE, c);
            abort ();
!         } /* switch */
!     } /* while */
  
!   if (! args_info->int_opt_given)
      {
        fprintf (stderr, "%s: `--int-opt' (`-i') option required!\n", PACKAGE);
!       missing_required_options = 1;
      }
  
!   if ( missing_required_options )
!     exit (1);
  
!   if (optind < argc)
      {
!       int i = 0 ;
  
        args_info->inputs_num = argc - optind ;
        args_info->inputs = 
!         (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
!       while (optind < argc)
          args_info->inputs[ i++ ] = strdup (argv[optind++]) ; 
      }
  
!   return 0;
  }
  
--- 104,208 ---- args_info->inputs = NULL; ! args_info->inputs_num = 0; ! while (1) { ! int option_index = 0; ! static struct option long_options[] = { ! { "help", 0, NULL, 'h' }, ! { "version", 0, NULL, 'V' }, ! { "str-opt", 1, NULL, 's' }, ! { "int-opt", 1, NULL, 'i' }, ! { "funct-opt", 0, NULL, 'F' }, ! { "flag-opt", 0, NULL, 'x' }, ! { NULL, 0, NULL, 0 } }; c = getopt_long (argc, argv, "hVs:i:Fx", long_options, &option_index); ! if (c == -1) break; /* Exit from `while (1)' loop. */ ! switch (c) { ! case 'h': /* Print help and exit. */ clear_args (); print_help (); ! exit (0); ! case 'V': /* Print version and exit. */ clear_args (); print_version (); ! exit (0); ! case 's': /* A string option. */ ! if (args_info->str_opt_given) { fprintf (stderr, "%s: `--str-opt' (`-s') option given more than once\n", PACKAGE); clear_args (); print_help (); ! exit (1); } ! args_info->str_opt_given = 1; args_info->str_opt_arg = gengetopt_strdup (optarg); ! break; ! case 'i': /* A int option. */ ! if (args_info->int_opt_given) { fprintf (stderr, "%s: `--int-opt' (`-i') option given more than once\n", PACKAGE); clear_args (); print_help (); ! exit (1); } ! args_info->int_opt_given = 1; args_info->int_opt_arg = atoi (optarg); ! break; ! case 'F': /* A function option. */ ! if (args_info->funct_opt_given) { fprintf (stderr, "%s: `--funct-opt' (`-F') option given more than once\n", PACKAGE); clear_args (); print_help (); ! exit (1); } ! args_info->funct_opt_given = 1; ! break; ! case 'x': /* A flag option. */ args_info->flag_opt_flag = !(args_info->flag_opt_flag); ! break; ! case '?': /* Invalid option. */ ! /* `getopt_long' already printed an error message. */ ! exit (1); ! default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c\n", PACKAGE, c); abort (); ! } /* switch */ ! } /* while */ ! if (! args_info->int_opt_given) { fprintf (stderr, "%s: `--int-opt' (`-i') option required!\n", PACKAGE); ! missing_required_options = 1; } ! if ( missing_required_options ) ! exit (1); ! if (optind < argc) { ! int i = 0 ; args_info->inputs_num = argc - optind ; args_info->inputs = ! (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; ! while (optind < argc) args_info->inputs[ i++ ] = strdup (argv[optind++]) ; } ! return 0; }
diff -rc2P gengetopt-2.0/doc/cmdline1.h gengetopt-2.1/doc/cmdline1.h *** gengetopt-2.0/doc/cmdline1.h Tue Aug 1 09:18:26 2000 --- gengetopt-2.1/doc/cmdline1.h Wed Sep 20 23:25:21 2000 *************** *** 1,5 **** /* cmdline1.h */ ! /* File autogenerated by gengetopt version 2.0 */ #ifndef _cmdline1_h --- 1,5 ---- /* cmdline1.h */ ! /* File autogenerated by gengetopt version 2.1 */ #ifndef _cmdline1_h diff -rc2P gengetopt-2.0/doc/cmdline2.c gengetopt-2.1/doc/cmdline2.c *** gengetopt-2.0/doc/cmdline2.c Tue Aug 1 09:18:26 2000 --- gengetopt-2.1/doc/cmdline2.c Wed Sep 20 23:25:24 2000 *************** *** 1,6 **** /* ! File autogenerated by gengetopt version 2.0 generated with the following command: ../src/gengetopt --input=sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unamed-opts */ --- 1,10 ---- /* ! File autogenerated by gengetopt version 2.1 generated with the following command: ../src/gengetopt --input=sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unamed-opts + + The developers of gengetopt consider the fixed text that goes in all + gengetopt output files to be in the public domain: + we make no copyright claims on it. */ *************** *** 65,69 **** char * n, * pn, * ps = s; while (*ps) ps++; ! n = malloc (1 + ps - s); if (n != NULL) { --- 69,73 ---- char * n, * pn, * ps = s; while (*ps) ps++; ! n = (char *) malloc (1 + ps - s); if (n != NULL) { diff -rc2P gengetopt-2.0/doc/cmdline2.h gengetopt-2.1/doc/cmdline2.h *** gengetopt-2.0/doc/cmdline2.h Tue Aug 1 09:18:26 2000 --- gengetopt-2.1/doc/cmdline2.h Wed Sep 20 23:25:24 2000 *************** *** 1,5 **** /* cmdline2.h */ ! /* File autogenerated by gengetopt version 2.0 */ #ifndef _cmdline2_h --- 1,5 ---- /* cmdline2.h */ ! /* File autogenerated by gengetopt version 2.1 */ #ifndef _cmdline2_h diff -rc2P gengetopt-2.0/doc/gengetopt.1.in gengetopt-2.1/doc/gengetopt.1.in *** gengetopt-2.0/doc/gengetopt.1.in Sun Jul 30 15:43:31 2000 --- gengetopt-2.1/doc/gengetopt.1.in Wed Sep 20 22:48:59 2000 *************** *** 1,3 **** ! .TH GENGETOPT 1 2000-07-30 "GNU" "Programmer's Manual" .SH NAME gengetopt \- generate a C function which parses command line --- 1,4 ---- ! .\" -*- nroff -*- ! .TH GENGETOPT 1 2000-09-20 "GNU" "Programmer's Manual" .SH NAME gengetopt \- generate a C function which parses command line *************** *** 5,26 **** .SH SYNOPSIS .B gengetopt ! .RI "< " file " " [OPTIONS...] .SH "DESCRIPTION" \fBgengetopt\fP reads a description file for command line arguments and generates a C function which ! uses GNU .BR getopt_long (3) library function to parse the command line arguments. .PP \fBgengetopt\fP supports: ! long and short options, 10 types of parameters (including flag, int, double, string, and function call), and a usage message. .PP ! \fBTHIS MAN PAGE IS COMPLETELY OUT OF DATE AND WILL NO LONGER ! BE MAINTAINED.\fP ! .PP ! \fBTexinfo documentation will be released soon, but meanwhile ! please refer to README file or to the html documentation that you ! can find in @prefix@/share/doc/gengetopt.\fP .SH OPTIONS \fBgengetopt\fP accepts some options. --- 6,31 ---- .SH SYNOPSIS .B gengetopt ! .RI [ OPTIONS... "] [\fB<\fP " file ] .SH "DESCRIPTION" \fBgengetopt\fP reads a description file for command line arguments and generates a C function which ! uses the GNU .BR getopt_long (3) library function to parse the command line arguments. .PP \fBgengetopt\fP supports: ! long and short options (per the \fBGNU Coding Standards\fP), 10 types of ! parameters (including flag, int, double, string, and function call), and a usage message. .PP ! \fBgengetopt\fP itself is under the GPL. The code it generates is not ! under any license. See LICENSE. ! .\" .PP ! .\" \fBTHIS MAN PAGE IS COMPLETELY OUT OF DATE AND WILL NO LONGER ! .\" BE MAINTAINED.\fP ! .\" .PP ! .\" \fBTexinfo documentation will be released soon, but meanwhile ! .\" please refer to README file or to the html documentation that you ! .\" can find in @prefix@/share/doc/gengetopt.\fP .SH OPTIONS \fBgengetopt\fP accepts some options. *************** *** 37,50 **** -u --unamed-opts accept filenames .fi - .sp - .\" .TP - .\" .B \-h, \-\-help - .\" Show summary of options. - .\" .TP - .\" .B \-v, \-\-version - .\" Show version of program. .SH INPUT ! A comment begins with '#' any place in a line and continues to the ! end of line. The file consist of lines with the following format: .sp .nf --- 42,47 ---- -u --unamed-opts accept filenames .fi .SH INPUT ! The description file consists of lines with the following format: .sp .nf *************** *** 57,76 **** .fi .sp ! The data items are as follows: .TP .I packname ! Double quoted string with upper and lower case chars, digits, '-' and '.'. No spaces allowed. .TP .I version ! Double quoted string with upper and lower case chars, digits, '-' and '.'. No spaces allowed. .TP .I long The long option, a double quoted string with upper and lower case chars, ! digits, '-' and '.'. No spaces allowed. The name of the variables generated to store arguments are long options converted to be legal C variable ! names. This means, '.' and '-' are both replaced by '_'. '_arg' ! is appended, or '_flag' for a flag. .TP .I short --- 54,74 ---- .fi .sp ! `#' anywhere in a line starts a comment which continues to the ! end of the line. The data items are as follows: .TP .I packname ! Double quoted string with upper and lower case chars, digits, `-' and `.'. No spaces allowed. .TP .I version ! Double quoted string with upper and lower case chars, digits, `-' and `.'. No spaces allowed. .TP .I long The long option, a double quoted string with upper and lower case chars, ! digits, `-' and `.'. No spaces allowed. The name of the variables generated to store arguments are long options converted to be legal C variable ! names. This means, `.' and `-' are both replaced by `_'. `_arg' ! is appended, or `_flag' for a flag. .TP .I short *************** *** 78,82 **** .TP .I desc ! Double quoted string with upper and lower case chars, digits, '-', '.' and spaces. First character must not be a space. .TP --- 76,80 ---- .TP .I desc ! Double quoted string with upper and lower case chars, digits, `-', `.' and spaces. First character must not be a space. .TP *************** *** 97,107 **** .PP Options \fB--help\fP and \fB--version\fP are generated automatically. .SH "SEE ALSO" ! examples in \fI@prefix@/share/doc/gengetopt\fP. .SH "VERSION INFORMATION" ! This man page (partially) documents \fBgengetopt\fP, version 2.0. .SH AUTHOR This man page was written by \fBJames R. Van Zandt \fP, for the Debian GNU/Linux system (but may be used by others). ! It was modified by \fBLorenzo Bettini \fP the current maintainer of GNU gengetopt. --- 95,119 ---- .PP Options \fB--help\fP and \fB--version\fP are generated automatically. + .SH EXAMPLE + + Here's an example of a description file: + .sp + .nf + # file sample1.ggo + option "str-opt" s "An optional string option" string no + option "int-opt" i "A required int option" int yes + option "funct-opt" F "A function option" no + option "flag-opt" x "A flag option" flag off + .fi .SH "SEE ALSO" ! HTML documentation in \fI@prefix@/share/doc/gengetopt\fP. ! .br ! Examples in \fI@prefix@/share/doc/gengetopt/examples\fP. .SH "VERSION INFORMATION" ! This man page (partially) documents \fBgengetopt\fP, version @VERSION@. ! TexInfo documentation will be released soon. .SH AUTHOR This man page was written by \fBJames R. Van Zandt \fP, for the Debian GNU/Linux system (but may be used by others). ! It was modified by \fBLorenzo Bettini \fP the current maintainer of GNU gengetopt. diff -rc2P gengetopt-2.0/doc/gengetopt.html gengetopt-2.1/doc/gengetopt.html *** gengetopt-2.0/doc/gengetopt.html Tue Aug 1 10:33:47 2000 --- gengetopt-2.1/doc/gengetopt.html Wed Sep 20 23:40:00 2000 *************** *** 3,7 **** ! Gengetopt - GNU Project - Free Software Foundation (FSF) --- 3,7 ---- ! Gengetopt - GNU Project - Free Software Foundation (FSF) *************** *** 9,14 ****

! GNU Gengetopt 2.0

! July 1st 2000

This program generate a C function that uses getopt_long function to parse the command line options, validate them and fill a struct. --- 9,14 ----

! GNU Gengetopt 2.1

! September 20th, 2000

This program generate a C function that uses getopt_long function to parse the command line options, validate them and fill a struct. *************** *** 18,29 **** with - and consist of only one character) can be handled. For standards about short and long options you may want to take a look at the GNU ! Coding Standards. The sections which concerns this subject can also ! be found in doc directory: standards_14.html ! and standards_15.html.

gengetopt is free software. Please see the file LICENSE and COPYING ! for details. For documentation, please read this file. As it is a GPL program, ! we provide sources (~100k), but if you don't fell like compiling it, you ! can download Win32 executable (new).
The code generated is not under any license.

gengetopt is perfect if you are too lazy (like me) to write all stuff --- 18,30 ---- with - and consist of only one character) can be handled. For standards about short and long options you may want to take a look at the GNU ! Coding Standards.

gengetopt is free software. Please see the file LICENSE and COPYING ! for details. !
Notice that: Use of gengetopt does not impose any particular license ! on the generated code. !

For documentation, please read this file. As it is a GPL program, we ! provide sources (~100k), but if you don't fell like compiling it, you can ! download Win32 executable (new).
The code generated is not under any license.

gengetopt is perfect if you are too lazy (like me) to write all stuff *************** *** 33,37 ****

Gengetopt has originally been written by Roberto Arturo Tena Sanchez <arturo@directmail.org>, ! and currently maintained by Lorenzo Bettini <lorenzo.bettini@penteres.it>.

Gengetopt is a GNU program, so you can download it from GNU's ftp site: --- 34,38 ----

Gengetopt has originally been written by Roberto Arturo Tena Sanchez <arturo@directmail.org>, ! and currently maintained by Lorenzo Bettini <bettini@gnu.org>.

Gengetopt is a GNU program, so you can download it from GNU's ftp site: *************** *** 40,51 ****

  • ! Latest Version (sources, .tar.gz) - ! md5sum - signature of md5sum
  • ! Latest Version (win32 executable, ! zipped) - md5sum - signature ! of md5sum
  • --- 41,53 ----
    • ! Latest Version (sources, .tar.gz) ! - ! md5sum - signature of md5sum
    • ! Latest Version (win32 executable, ! zipped) - md5sum ! - signature of md5sum
    • *************** *** 63,66 **** --- 65,87 ----

      Changes in this release

      + +
        +
      • + It is made more clear that use of gengetopt does not impose any particular + license on the generated code.
      • + +
      • + A bug in the generation of code (for some new C++ compilers) was fixed, + thanks to "James R. Van Zandt" <jrv@vanzandt.mv.com>
      • + +
      • + Some modifications to the man page, also due to James.
      • + +
      • + a directory for examples is specifically created (suggested by James).
      • +
      + +

      + Changes in release 2.0

      This is quite a totally new release:
        *************** *** 101,105 ****
      • ! docs and samples     -> /prefix/share/doc/gengetopt
      • --- 122,131 ----
      • ! docs                 ! -> /prefix/share/doc/gengetopt
      • ! !
      • ! examples             ! -> /prefix/share/doc/gengetopt/examples
      • *************** *** 227,231 ****
        /* cmdline1.h */
          
        ! /* File autogenerated by gengetopt version 2.0  */
          
          #ifndef _cmdline1_h
        --- 253,257 ----
          
        /* cmdline1.h */
          
        ! /* File autogenerated by gengetopt version 2.1  */
          
          #ifndef _cmdline1_h
        ***************
        *** 373,377 ****
          This is the output of gengetopt --help:
          
        $ gengetopt --help
        ! gengetopt 2.0
          Usage: gengetopt [OPTIONS]...
             -h         --help              Print help and exit
        --- 399,403 ----
          This is the output of gengetopt --help:
          
        $ gengetopt --help
        ! gengetopt 2.1
          Usage: gengetopt [OPTIONS]...
             -h         --help              Print help and exit
        ***************
        *** 444,448 ****
          
        http://infostud.dsi.unifi.it/~bettini (very fast if you're in University) !
        <lorenzo.bettini@penteres.it>. Roberto Arturo Tena Sanchez --- 470,474 ----
        http://infostud.dsi.unifi.it/~bettini (very fast if you're in University) !
        <bettini@gnu.org>. Roberto Arturo Tena Sanchez diff -rc2P gengetopt-2.0/doc/gengetopt.html.in gengetopt-2.1/doc/gengetopt.html.in *** gengetopt-2.0/doc/gengetopt.html.in Thu Jan 1 01:00:00 1970 --- gengetopt-2.1/doc/gengetopt.html.in Wed Sep 20 23:39:54 2000 *************** *** 0 **** --- 1,500 ---- + + + + + + Gengetopt - GNU Project - Free Software Foundation (FSF) + + + +

        + GNU Gengetopt @VERSION@

        + September 20th, 2000 +

        This program generate a C function that uses getopt_long function + to parse the command line options, validate them and fill a struct. +

        Thus your program can now handle options such as: +

        myprog --input foo.c -o foo.o --no-tabs -i 100 *.class
        + And both long options (those that start with --) and short options (start + with - and consist of only one character) can be handled. For standards + about short and long options you may want to take a look at the GNU + Coding Standards. +

        gengetopt is free software. Please + see the file LICENSE and COPYING + for details. +
        Notice that: Use of gengetopt does not impose any particular license + on the generated code. +

        For documentation, please read this file. As it is a GPL program, we + provide sources (~100k), but if you don't fell like compiling it, you can + download Win32 executable (new). +
        The code generated is not under any license. +

        gengetopt is perfect if you are too lazy (like me) to write all stuff + required to call getopt_long, and when you have a +
        program and wish it took options. +

        Generated code works if you use GNU Autoconf or GNU Automake. +

        Gengetopt has originally been written by Roberto Arturo Tena Sanchez + <arturo@directmail.org>, + and currently maintained by Lorenzo Bettini <bettini@gnu.org>. +

        Gengetopt is a GNU program, so you + can download it from GNU's ftp site: +
        ftp://ftp.gnu.org/gnu/gengetopt/ +

        or from here: +

        + You may also want to check the md5sum of the archives, which are + also digitally signed by me (Lorenzo Bettini) with GNU gpg (http://www.gnupg.org). + My GPG public key can be found at my home page (see at the end of this + doc). +

        Gengetopt main home page is at GNU site: +
        http://www.gnu.org/software/gengetopt/gengetopt.html +

        or you can also get the pacthes (see below + for patching from a previous version). +

        + Changes in this release

        + +
          +
        • + It is made more clear that use of gengetopt does not impose any particular + license on the generated code.
        • + +
        • + A bug in the generation of code (for some new C++ compilers) was fixed, + thanks to "James R. Van Zandt" <jrv@vanzandt.mv.com>
        • + +
        • + Some modifications to the man page, also due to James.
        • + +
        • + a directory for examples is specifically created (suggested by James).
        • +
        + +

        + Changes in release 2.0

        + This is quite a totally new release: +
          +
        • + Gengetopt has become GNU software
        • + +
        • + it is conform to GNU coding standards, and so it uses configure script + generated by Automake and Autoconf
        • + +
        • + it generates separated files: one header file with the struct used to store + command line options information, and a C file which contains the function + which actually uses getopt_long to parse the command line
        • + +
        • + 'required' option is now fully implemented
        • +
        + see also NEWS file and ChangeLog + for the complete list of changes between versions. +

        + Installation

        + See the file INSTALL for detailed building and installation + instructions; anyway if you're used to compiling Linux software that comes + with sources you may simply follow the usual procedure: +
        cd <source code main directory>
        + ./configure
        + make
        + make install
        + Note: unless you specify a different install directory by --prefix option + of configure (e.g. ./configure --prefix=<your home>), + you must be root to 'make install'. +

        Files will be installed in the following directories: +

          +
        • + Executables          -> + /prefix/bin
        • + +
        • + docs                 + -> /prefix/share/doc/gengetopt
        • + +
        • + examples             + -> /prefix/share/doc/gengetopt/examples
        • + +
        • + util files           + -> /prefix/share/gengetopt
        • +
        + Default value for prefix is /usr/local but you may change it with + --prefix option to configure (see above). +

        + What you need to build gengetopt

        + Actually you need nothing more than a Unix C/C++ + compiler +

        getopt_long function is usually in the standard C library, but + there may be some C libraries which don't include it; in this case you + have to link the program that uses the file generated by gengetopt with + the files getopt.c and getopt1.c and include getopt.h + in your project. We obviously provide these files in the utility files + directory (/prefix/share/gengetopt). These files are part of the + GNU C library. You may want to take a look at getopt + man page. Read also no_getopt_long.txt. +

        gengetopt has been developed under Linux, + using gcc, and bison (yacc) and flex (lex), and ported + under Win32 with Cygnus C/C++ compiler, + available at http://www.cygnus.com/ + (a .DLL is also distributed togheter with the .exe: you may simply copy + it in the same place of the .exe). I used the excellent GNU Autoconf + and Automake. I also used Autotools (ftp://ftp.ugcs.caltech.edu/pub/elef/autotools) + which creates a starting source tree (according to GNU standards) with + autoconf, automake starting files, and getopt_long (for command + line parsing). +

        Actually, unless you want to develop gengetopt, you don't need all these + tools to build gengetopt because I provide generated sources; you don't + need neither bison (yacc) nor flex (lex), for the same reason. Actually + programs that use lex generated files need to link with library libfl + (or + libl + for + lex); anyway configuration phase can discover if this library is missing + and in that case it sets the program to link with a source file I provide. + This hack works for flex: I don't know about lex generated scanners. But, + again, this is a problem only if you develop gengetopt and you use lex. +

        + Patching from a previous + version

        + If you downloaded a pacth, say gengetopt-1.3-1.3.1-patch.gz (i.e. + the pacth to go from version 1.3 to version 1.3.1), cd to the directory + with sources from the previous version (gengetopt-1.3) and type: +
        gunzip -cd ../gengetopt-1.3-1.3.1.patch.gz | patch -p1
        + and restart the compilation process (if you had already run configure a + simple + make will do). +

        + Usage (a little tutorial)

        + The command line options, which have to be handled by gengetopt generated + function, are specified in a file (typically with .ggo extension). + This file consist in lines of sentences with the following formats: +
        package <packname>
        + version <version>
        + 
        + option <long> <short> <desc> <argtype> <required>
        + option <long> <short> <desc> flag      <onoff>
        + option <long> <short> <desc> no
        + Where: +

        packname +

        Double quoted string  with  upper  and  + lower  case chars, digits, '-' and '.'.  No spaces allowed.
        + version +
        Double  quoted  string  with  upper  + and lower case chars, digits, '-' and '.'.  No spaces allowed.
        + long +
        The long option, a double quoted string with  upper and  + lower  case  chars,  digits,  '-' and '.'.  No + spaces allowed.  The name of the  variables  generated  + to store arguments are long options converted to be legal C variable names.  + This means, '.'  and '-'  are  both replaced by '_'. '_arg' + is appended, or '_flag' for a flag.
        + short +
        The short option, a  single  upper  or  + lower  case char, or a digit.
        + desc +
        Double  quoted  string  with  upper  + and lower case chars, digits, '-', '.' and spaces. First character must + not be a space.
        + argtype +
        string, int, short, long, float, double, longdouble or longlong.
        + required +
        yes or no.
        + onoff +
        on or off. This is the state of the flag when the program starts. + If user specifies the option, the flag toggles.
        + The third type of option is used when the option does not take any argument. + It must not be required. +

        Comments begins with '#' in any place of the line and ends in + the end of line. +

        Here's an example of such a file (the file is called sample1.ggo) +
          + + + + +
        # file sample1.ggo +
        option  "str-opt"         + s "A string option"      string     + no +
        option  "int-opt"         + i "A int option"         int        + yes +
        option  "funct-opt"       F + "A function option"    no  +
        option  "flag-opt"        + x "A flag option"        flag       + off
        + +

        The simplest way to use gengetopt is to pass this file as the standard + input, i.e.: +

        gengetopt < sample1.ggo
        + by default gengetopt generates cmdline.h and cmdline.c. + Otherwise we can specify these names with a command line option: +
        gengetopt < sample1.ggo --file-name=cmdline1
        + In cmdline1.h you'll find the generated C struct: +
          + + + + +
        +
        /* cmdline1.h */
        + 
        + /* File autogenerated by gengetopt version @VERSION@  */
        + 
        + #ifndef _cmdline1_h
        + #define _cmdline1_h
        + 
        + #ifdef __cplusplus
        + extern "C" {
        + #endif /* __cplusplus */
        + 
        + struct gengetopt_args_info {
        +   char * str_opt_arg;   /* A string option.  */
        +   int int_opt_arg;      /* A int option.  */
        +   int flag_opt_flag;    /* A flag option (default=off).  */
        + 
        +   int help_given ;      /* Wheter help was given.  */
        +   int version_given ;   /* Wheter version was given.  */
        +   int str_opt_given ;   /* Wheter str-opt was given.  */
        +   int int_opt_given ;   /* Wheter int-opt was given.  */
        +   int funct_opt_given ; /* Wheter funct-opt was given.  */
        +   int flag_opt_given ;  /* Wheter flag-opt was given.  */
        + 
        +   char **inputs ; /* unamed options */
        +   unsigned inputs_num ; /* unamed options number */
        + } ;
        + 
        + int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info);
        + 
        + #ifdef __cplusplus
        + }
        + #endif /* __cplusplus */
        + #endif /* _cmdline1_h */
        +
        + +

        Notice that by default the generated function is called cmdline_parser + (see the command line options below, to override this name), and it takes + the arguments that main receives and a pointer to such a struct, + that it will be filled. +
        And here's how this function can be used inside the main program: +
          + + + + +
        +
        /* main1.cc */
        + /* we try to use gengetopt generated file in a C++ program */
        + /* we don't use autoconf and automake vars */
        + 
        + #include <iostream.h>
        + 
        + #include "cmdline1.h"
        + 
        + int
        + main (int argc, char **argv)
        + {
        +   gengetopt_args_info args_info;
        + 
        +   cout << "This one is from a C++ program" << endl ;
        +   cout << "Try to launch me with some options" << endl ;
        +   cout << "(type sample1 --help for the complete list)" << endl ;
        +   cout << "For example: ./sample1 *.* --funct-opt" << endl ;
        + 
        +   /* let's call our cmdline parser */
        +   if (cmdline_parser (argc, argv, &args_info) != 0)
        +     exit(1) ;
        + 
        +   cout << "Here are the options you passed..." << endl;
        + 
        +   for ( unsigned i = 0 ; i < args_info.inputs_num ; ++i )
        +     cout << "file: " << args_info.inputs[i] << endl ;
        + 
        +   if ( args_info.funct_opt_given )
        +     cout << "You chose --funct-opt or -F." << endl ;
        + 
        +   if ( args_info.str_opt_given )
        +     cout << "You inserted " << args_info.str_opt_arg << " for " <<
        +       "--str-opt option." << endl ;
        + 
        +   if ( args_info.int_opt_given )
        +     cout << "This is the integer you input: " << 
        +       args_info.int_opt_arg << "." << endl;
        + 
        +   cout << "The flag is " << ( args_info.flag_opt_flag ? "on" : "off" ) <<
        +     "." << endl ;
        + 
        +   cout << "Have a nice day! :-)" << endl ;
        + 
        +   return 0;
        + }
        +
        + +

        Now you can compile main1.cc and the cmdline1.c generated + by gengetopt and link all together to obtain sample1 executable: +

        gcc -c cmdline1.c
        + g++ -c main1.cc
        + g++ -o sample1 cmdline1.o main1.o
        + (Here we assume that getopt_long is included in the standard C library; + see 'What you need to build gengetopt' section). +

        Now let's try some tests with this program: +

        $ ./sample1 -s "hello" --int-opt 1234
        + This one is from a C++ program
        + Try to launch me with some options
        + (type sample1 --help for the complete list)
        + For example: ./sample1 *.* --funct-opt
        + Here are the options you passed...
        + You inserted hello for --str-opt option.
        + This is the integer you input: 1234.
        + The flag is off.
        + Have a nice day! :-)
        + You can also pass many file names to the command line (this also shows + how flags work): +
        $ ./sample1 *.h -i -100 -x
        + This one is from a C++ program
        + Try to launch me with some options
        + (type sample1 --help for the complete list)
        + For example: ./sample1 *.* --funct-opt
        + Here are the options you passed...
        + file: cmdline1.h
        + file: cmdline2.h
        + file: cmdline.h
        + file: getopt.h
        + This is the integer you input: -100.
        + The flag is on.
        + Have a nice day! :-)
        + And if we try to omit the --int-opt (or -i), which is required, + we get an error: +
        $ ./sample1
        + This one is from a C++ program
        + Try to launch me with some options
        + (type sample1 --help for the complete list)
        + For example: ./sample1 *.* --funct-opt
        + sample1: `--int-opt' (`-i') option required!
        + If you're curious you may want to take a look at the generated + C file. +

        You may find other examples in /prefix/share/doc/gengetopt. +

        + Warning for Win32 users

        + If you run Win32 version, please remember that DOS shell does not translate + wildcards, and thus the previous test which uses '*.h' will not + work. Thus also a 'make check' is destined to fail. +

        + Options

        + This is the output of gengetopt --help: +
        $ gengetopt --help
        + gengetopt @VERSION@
        + Usage: gengetopt [OPTIONS]...
        +    -h         --help              Print help and exit
        +    -V         --version           Print version and exit
        +    -iSTRING   --input=STRING      input file. default std input
        +    -fSTRING   --func-name=STRING  name of generated function
        +    -FSTRING   --file-name=STRING  name of generated file. default cmdline
        +    -l         --long-help         long usage line in help
        +    -u         --unamed-opts       accept filenames
        + The options should be clear; in particular: +
          +
        • + if no --func-name is given, cmdline_parser is taken by default;
        • + +
        • + with --long-help option, the "Usage" line reports all the options; + this may be unpleasant if options are many;
        • + +
        • + with --unamed-opts we can accept also options without a name, which, + in most case, means that we can pass many file names to the program (see + the example above when we call sample1 *.h).
        • +
        + You may have already guessed it: gengetopt uses gengetopt itself + for command line options, and this is its specification file: + + + + +
        +
        option  "input"         i "input file. default std input"  string     no
        + option  "func-name"     f "name of generated function"  string     no
        + option  "file-name"     F "name of generated file. default cmdline"  string     no
        + option  "long-help"     l "long usage line in help" no
        + option  "unamed-opts"   u "accept filenames" no
        +
        + +

        + Credits

        + See THANKS file :-) +

        + Feedback

        + Tell us if you like this software :-) +

        Actually we want to extend it, so if you have some ideas... The most + import one will be to make gengetopt more customizable :-) +

        Please send all bug reports by electronic mail to: +
        bug-gengetopt@gnu.org +

        + Mailing Lists

        + The following mailing lists are available: + + if you want to subscribe to a mailing list just go to the URL and follow + the instructions. +
          + + + + + + +
        Lorenzo Bettini +
        http://w3.newnet.it/bettini  + or +
        http://infostud.dsi.unifi.it/~bettini + (very fast if you're in University) +
        <bettini@gnu.org>.
        Roberto Arturo Tena Sanchez +
        http://arturo.directmail.org +
        <arturo@directmail.org>,
        + +

        gengetopt is free software. See the file LICENSE and COPYING for copying + conditions. Anyway we won't get offended if you send us a postcard :-) +

        C/C++ files are formatted with GNU cpp2html (http://www.gnu.org/software/cpp2html) + by Lorenzo Bettini. +

        +


        +

        Return to GNU's home page. +

        Please send FSF & GNU inquiries & questions to gnu@gnu.org. + There are also other + ways to contact the FSF. +

        Please send comments on these web pages to webmasters@www.gnu.org, + send other questions to gnu@gnu.org. +

        Copyright (C) 1999 Free Software Foundation, Inc., 59 Temple Place - + Suite 330, Boston, MA 02111, USA +

        Verbatim copying and distribution of this entire article is permitted + in any medium, provided this notice is preserved. +

         Updated: 27 Mar 1999 jonas  +
        +


        + + Only in gengetopt-2.0/doc: standards_14.html Only in gengetopt-2.0/doc: standards_15.html diff -rc2P gengetopt-2.0/src/Makefile.in gengetopt-2.1/src/Makefile.in *** gengetopt-2.0/src/Makefile.in Tue Aug 1 10:38:00 2000 --- gengetopt-2.1/src/Makefile.in Wed Sep 20 23:46:22 2000 *************** *** 83,86 **** --- 83,87 ---- YFLAGS = @YFLAGS@ gengetoptdocdir = @gengetoptdocdir@ + gengetoptexamplesdir = @gengetoptexamplesdir@ bin_PROGRAMS = gengetopt diff -rc2P gengetopt-2.0/src/cmdline.c gengetopt-2.1/src/cmdline.c *** gengetopt-2.0/src/cmdline.c Tue Aug 1 08:56:53 2000 --- gengetopt-2.1/src/cmdline.c Wed Sep 20 22:16:08 2000 *************** *** 3,6 **** --- 3,10 ---- generated with the following command: ../src/gengetopt --input=cmdline.ggo + + The developers of gengetopt consider the fixed text that goes in all + gengetopt output files to be in the public domain: + we make no copyright claims on it. */ *************** *** 60,64 **** char * n, * pn, * ps = s; while (*ps) ps++; ! n = malloc (1 + ps - s); if (n != NULL) { --- 64,68 ---- char * n, * pn, * ps = s; while (*ps) ps++; ! n = (char *) malloc (1 + ps - s); if (n != NULL) { diff -rc2P gengetopt-2.0/src/gm.c gengetopt-2.1/src/gm.c *** gengetopt-2.0/src/gm.c Sun Jul 23 18:51:59 2000 --- gengetopt-2.1/src/gm.c Wed Sep 20 22:14:56 2000 *************** *** 231,234 **** --- 231,240 ---- } + printf + ("\n" + " The developers of gengetopt consider the fixed text that goes in all\n" + " gengetopt output files to be in the public domain:\n" + " we make no copyright claims on it.\n"); + printf ("*/\n\ \n\ *************** *** 414,418 **** char * n, * pn, * ps = s;\n\ while (*ps) ps++;\n\ ! n = malloc (1 + ps - s);\n\ if (n != NULL)\n\ {\n\ --- 420,424 ---- char * n, * pn, * ps = s;\n\ while (*ps) ps++;\n\ ! n = (char *) malloc (1 + ps - s);\n\ if (n != NULL)\n\ {\n\ diff -rc2P gengetopt-2.0/src/parser.c gengetopt-2.1/src/parser.c *** gengetopt-2.0/src/parser.c Mon Jul 31 17:43:26 2000 --- gengetopt-2.1/src/parser.c Sat Aug 5 17:51:39 2000 *************** *** 1,20 **** /* A Bison parser, made from parser.y ! by GNU Bison version 1.25 ! */ #define YYBISON 1 /* Identify Bison output. */ ! #define TOK_PACKAGE 258 ! #define TOK_VERSION 259 ! #define TOK_OPTION 260 ! #define TOK_YES 261 ! #define TOK_NO 262 ! #define TOK_FLAG 263 ! #define TOK_ONOFF 264 ! #define TOK_STRING 265 ! #define TOK_STRING_WITH_SPACES 266 ! #define TOK_CHAR 267 ! #define TOK_ARGTYPE 268 #line 7 "parser.y" --- 1,19 ---- /* A Bison parser, made from parser.y ! by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ ! #define TOK_PACKAGE 257 ! #define TOK_VERSION 258 ! #define TOK_OPTION 259 ! #define TOK_YES 260 ! #define TOK_NO 261 ! #define TOK_FLAG 262 ! #define TOK_ONOFF 263 ! #define TOK_STRING 264 ! #define TOK_STRING_WITH_SPACES 265 ! #define TOK_CHAR 266 ! #define TOK_ARGTYPE 267 #line 7 "parser.y" *************** *** 60,64 **** #define YYNTBASE 15 ! #define YYTRANSLATE(x) ((unsigned)(x) <= 268 ? yytranslate[x] : 20) static const char yytranslate[] = { 0, --- 59,63 ---- #define YYNTBASE 15 ! #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 20) static const char yytranslate[] = { 0, *************** *** 88,93 **** 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ! 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, ! 6, 7, 8, 9, 10, 11, 12, 13 }; --- 87,92 ---- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ! 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, ! 7, 8, 9, 10, 11, 12, 13 }; *************** *** 169,173 **** }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ ! #line 3 "/usr/share/bison.simple" /* Skeleton output parser for bison, --- 168,173 ---- }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ ! #line 3 "//usr/lib/bison.simple" ! /* This file comes from bison-1.28. */ /* Skeleton output parser for bison, *************** *** 186,190 **** You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software ! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, when this file is copied by Bison into a --- 186,191 ---- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, ! Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a *************** *** 193,229 **** in version 1.24 of Bison. */ ! #ifndef alloca #ifdef __GNUC__ #define alloca __builtin_alloca #else /* not GNU C. */ ! #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) #include #else /* not sparc */ ! #if defined (MSDOS) && !defined (__TURBOC__) #include #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) ! #include #pragma alloca ! #else /* not MSDOS, __TURBOC__, or _AIX */ ! #ifdef __hpux ! #ifdef __cplusplus ! extern "C" { ! void *alloca (unsigned int); ! }; ! #else /* not __cplusplus */ ! void *alloca (); ! #endif /* not __cplusplus */ #endif /* __hpux */ #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ ! #endif /* not sparc. */ ! #endif /* not GNU C. */ ! #endif /* alloca not defined. */ ! /* This is the parser code that is written into each bison parser ! when the %semantic_parser declaration is not specified in the grammar. ! It was written by Richard Stallman by simplifying the hairy parser ! used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. --- 194,249 ---- in version 1.24 of Bison. */ ! /* This is the parser code that is written into each bison parser ! when the %semantic_parser declaration is not specified in the grammar. ! It was written by Richard Stallman by simplifying the hairy parser ! used when %semantic_parser is specified. */ ! ! #ifndef YYSTACK_USE_ALLOCA ! #ifdef alloca ! #define YYSTACK_USE_ALLOCA ! #else /* alloca not defined */ #ifdef __GNUC__ + #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ ! #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) ! #define YYSTACK_USE_ALLOCA #include #else /* not sparc */ ! /* We think this test detects Watcom and Microsoft C. */ ! /* This used to test MSDOS, but that is a bad idea ! since that symbol is in the user namespace. */ ! #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) ! #if 0 /* No need for malloc.h, which pollutes the namespace; ! instead, just don't use alloca. */ #include + #endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) ! /* I don't know what this was needed for, but it pollutes the namespace. ! So I turned it off. rms, 2 May 1997. */ ! /* #include */ #pragma alloca ! #define YYSTACK_USE_ALLOCA ! #else /* not MSDOS, or __TURBOC__, or _AIX */ ! #if 0 ! #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, ! and on HPUX 10. Eventually we can turn this on. */ ! #define YYSTACK_USE_ALLOCA ! #define alloca __builtin_alloca #endif /* __hpux */ + #endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ ! #endif /* not sparc */ ! #endif /* not GNU C */ ! #endif /* alloca not defined */ ! #endif /* YYSTACK_USE_ALLOCA not defined */ ! #ifdef YYSTACK_USE_ALLOCA ! #define YYSTACK_ALLOC alloca ! #else ! #define YYSTACK_ALLOC malloc ! #endif /* Note: there must be only one dollar sign in this file. *************** *** 235,240 **** #define YYEMPTY -2 #define YYEOF 0 ! #define YYACCEPT return(0) ! #define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. --- 255,260 ---- #define YYEMPTY -2 #define YYEOF 0 ! #define YYACCEPT goto yyacceptlab ! #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. *************** *** 317,330 **** #define YYMAXDEPTH 10000 #endif - - #ifndef YYPARSE_RETURN_TYPE - #define YYPARSE_RETURN_TYPE int - #endif - - /* Prevent warning if -Wstrict-prototypes. */ - #ifdef __GNUC__ - YYPARSE_RETURN_TYPE yyparse (void); - #endif #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) --- 337,346 ---- #define YYMAXDEPTH 10000 #endif + /* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) *************** *** 338,342 **** char *to; char *from; ! int count; { register char *f = from; --- 354,358 ---- char *to; char *from; ! unsigned int count; { register char *f = from; *************** *** 353,360 **** in available built-in functions on various systems. */ static void ! __yy_memcpy (char *to, char *from, int count) { - register char *f = from; register char *t = to; register int i = count; --- 369,376 ---- in available built-in functions on various systems. */ static void ! __yy_memcpy (char *to, char *from, unsigned int count) { register char *t = to; + register char *f = from; register int i = count; *************** *** 366,370 **** #endif ! #line 196 "/usr/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed --- 382,386 ---- #endif ! #line 217 "//usr/lib/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed *************** *** 387,391 **** #endif /* not YYPARSE_PARAM */ ! YYPARSE_RETURN_TYPE yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL --- 403,416 ---- #endif /* not YYPARSE_PARAM */ ! /* Prevent warning if -Wstrict-prototypes. */ ! #ifdef __GNUC__ ! #ifdef YYPARSE_PARAM ! int yyparse (void *); ! #else ! int yyparse (void); ! #endif ! #endif ! ! int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL *************** *** 415,418 **** --- 440,444 ---- int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; #ifdef YYPURE *************** *** 499,502 **** --- 525,536 ---- { yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); + #ifdef YYLSP_NEEDED + free (yyls); + #endif + } return 2; } *************** *** 504,514 **** if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; ! yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); ! __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); ! yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); ! __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); ! #ifdef YYLSP_NEEDED ! yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); ! __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ --- 538,554 ---- if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; ! #ifndef YYSTACK_USE_ALLOCA ! yyfree_stacks = 1; ! #endif ! yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); ! __yy_memcpy ((char *)yyss, (char *)yyss1, ! size * (unsigned int) sizeof (*yyssp)); ! yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); ! __yy_memcpy ((char *)yyvs, (char *)yyvs1, ! size * (unsigned int) sizeof (*yyvsp)); ! #ifdef YYLSP_NEEDED ! yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); ! __yy_memcpy ((char *)yyls, (char *)yyls1, ! size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ *************** *** 708,712 **** } /* the action file gets copied in in place of this dollarsign */ ! #line 498 "/usr/share/bison.simple" yyvsp -= yylen; --- 748,752 ---- } /* the action file gets copied in in place of this dollarsign */ ! #line 543 "//usr/lib/bison.simple" yyvsp -= yylen; *************** *** 903,906 **** --- 943,970 ---- yystate = yyn; goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); + #ifdef YYLSP_NEEDED + free (yyls); + #endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); + #ifdef YYLSP_NEEDED + free (yyls); + #endif + } + return 1; } #line 93 "parser.y" diff -rc2P gengetopt-2.0/src/parser.h gengetopt-2.1/src/parser.h *** gengetopt-2.0/src/parser.h Mon Jul 31 17:43:26 2000 --- gengetopt-2.1/src/parser.h Sat Aug 5 17:51:39 2000 *************** *** 5,19 **** int bool; } YYSTYPE; ! #define TOK_PACKAGE 258 ! #define TOK_VERSION 259 ! #define TOK_OPTION 260 ! #define TOK_YES 261 ! #define TOK_NO 262 ! #define TOK_FLAG 263 ! #define TOK_ONOFF 264 ! #define TOK_STRING 265 ! #define TOK_STRING_WITH_SPACES 266 ! #define TOK_CHAR 267 ! #define TOK_ARGTYPE 268 --- 5,19 ---- int bool; } YYSTYPE; ! #define TOK_PACKAGE 257 ! #define TOK_VERSION 258 ! #define TOK_OPTION 259 ! #define TOK_YES 260 ! #define TOK_NO 261 ! #define TOK_FLAG 262 ! #define TOK_ONOFF 263 ! #define TOK_STRING 264 ! #define TOK_STRING_WITH_SPACES 265 ! #define TOK_CHAR 266 ! #define TOK_ARGTYPE 267 diff -rc2P gengetopt-2.0/src/scanner.c gengetopt-2.1/src/scanner.c *** gengetopt-2.0/src/scanner.c Mon Jul 31 17:43:27 2000 --- gengetopt-2.1/src/scanner.c Sat Aug 5 17:51:40 2000 *************** *** 570,574 **** { register yy_state_type yy_current_state; ! register char *yy_cp, *yy_bp; register int yy_act; --- 570,574 ---- { register yy_state_type yy_current_state; ! register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act;