genparse-0.9.1/0000777000076600001440000000000011732700534010336 500000000000000genparse-0.9.1/config.sub0000755000076600001440000010071111667213343012241 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-12-05' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: genparse-0.9.1/configure.ac0000644000076600001440000000752011732677026012555 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([src/genparse.cc]) dnl set up for automake AM_INIT_AUTOMAKE(genparse,0.9.1) dnl set up automake header file AC_CONFIG_HEADERS([config.h:config.in]) dnl get host name and system dnl AC_CANONICAL_TARGET([]) AC_PROG_CC gl_EARLY gl_INIT dnl check for lex and yacc AC_PROG_YACC AM_PROG_LEX AC_CHECK_PROGS(HAVE_JAVA, [java]) AM_CONDITIONAL(HAVE_JAVA, test "$HAVE_JAVA") AC_CHECK_PROGS(HAVE_JAVAC, [javac]) AM_CONDITIONAL(HAVE_JAVAC, test "$HAVE_JAVAC") dnl check for C and C++ compilers and make AC_PROG_CXXCPP dnl check for installer AC_PROG_INSTALL AC_PROG_RANLIB dnl check for header files. AC_CHECK_HEADERS(time.h stdlib.h unistd.h sys/param.h sys/utsname.h sys/time.h sys/types.h pwd.h getopt.h) dnl need this cuz AM_PROG_LEX is slightly braindead AC_CHECK_LIB(l, main) dnl Check for typedefs, structures, and compiler characteristics. AC_C_CONST AC_HEADER_TIME AC_TYPE_PID_T AC_STRUCT_TM dnl check for library functions. AC_FUNC_STRFTIME AC_CHECK_FUNCS(mktime gethostname gettimeofday strdup strerror uname getdomainname getopt_long) dnl check for java Getopt class AC_CHECK_CLASS(gnu.getopt.Getopt) if test "x$ac_cv_class_gnu_getopt_Getopt" = xyes ; then AC_SUBST(HAVE_GETOPT_JAVA, "yes") else AC_MSG_WARN([Java class gnu.getopt.Getopt not found. You can build genparse anyway but not its test suite for the java output.]) fi AM_CONDITIONAL(HAVE_GETOPT_JAVA, test "$HAVE_GETOPT_JAVA") dnl check for cunit AC_CHECK_LIB(cunit, CU_initialize_registry, HAVE_CUNIT="yes") if test x$HAVE_CUNIT != xyes; then AC_MSG_WARN([CUnit not found. You can build Genparse anyway but not its test suite for the C output.]) fi AM_CONDITIONAL(HAVE_CUNIT, test "$HAVE_CUNIT") dnl check for cppunit ifdef([AM_PATH_CPPUNIT], [AM_PATH_CPPUNIT(1.10.0)]) if test "x$CPPUNIT_LIBS" = x ; then AC_MSG_WARN([CPPUnit not found. You can build Genparse anyway but not its test suite for the C++ output.]) fi AM_CONDITIONAL(HAVE_CPPUNIT, test "$CPPUNIT_LIBS") dnl check for junit ifdef([AC_CHECK_JUNIT], [AC_CHECK_JUNIT]) if test "x$JAVA_JUNIT" = x ; then AC_MSG_WARN([JUnit not found. You can build Genparse anyway but not its test suite for the Java output.]) fi AM_CONDITIONAL(HAVE_JUNIT, test "$JAVA_JUNIT") dnl check for doxygen AC_CHECK_PROGS(DOXYGEN, [doxygen], no) if test x$DOXYGEN = xno; then AC_MSG_WARN([Doxygen not found, Doxygen documentation will not be built]) else dnl check if graphviz / dot is installed (used by doxygen) AC_CHECK_PROGS(DOT, [dot], no) if test x$DOT = xno; then AC_MSG_WARN([graphviz / dot not found, Doxygen documentation will not be built]) fi fi AM_CONDITIONAL(HAVE_DOXYGEN, test "$DOXYGEN" != no -a "$DOT" != no) dnl set directory in which doxygen searches for sources dnl relative to doc because doxygen is executed from there AC_SUBST(DOXYGEN_SRC_DIRECTORY) DOXYGEN_SRC_DIRECTORY=$srcdir/../src dnl check for texi2html AC_CHECK_PROGS(TEXI2HTML, [texi2html], no) if test x$TEXI2HTML = xno; then AC_MSG_WARN([texi2html not found, html version of info pages will not be built]) fi AM_CONDITIONAL(HAVE_TEXI2HTML, test "$TEXI2HTML" != no) dnl check if texi2pdf is installed AC_CHECK_PROGS(TEXI2PDF, [texi2pdf], no) if test x$TEXI2PDF = xno; then AC_MSG_WARN([texi2pdf not found, pdf version of info pages will not be built]) fi AM_CONDITIONAL(HAVE_TEXI2PDF, test "$TEXI2PDF" != no) dnl check if man2html is installed AC_CHECK_PROGS(MAN2HTML, [man2html], no) if test x$MAN2HTML = xno; then AC_MSG_WARN([man2html not found, html version of man page will not be built]) fi AM_CONDITIONAL(HAVE_MAN2HTML, test "$MAN2HTML" != no) gl_XSTRTOL AC_CONFIG_FILES([Makefile gnulib/Makefile gnulib/lib/Makefile src/Makefile doc/Makefile \ examples/Makefile tests/Makefile tests/ccheck/Makefile tests/cppcheck/Makefile tests/javacheck/Makefile tests/misc/Makefile doc/Doxyfile]) AC_OUTPUT genparse-0.9.1/src/0000777000076600001440000000000011732700534011125 500000000000000genparse-0.9.1/src/parser.h0000644000076600001440000001062211673365613012520 00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { SLASH = 258, RANGE_SPEC1 = 259, RANGE_SPEC2 = 260, FUNC_SPEC = 261, NONE = 262, OPEN_BRACE = 263, CLOSE_BRACE = 264, OPEN_SQUARE_BRACE = 265, CLOSE_SQUARE_BRACE = 266, EQUAL = 267, INCLUDE = 268, LT = 269, GT = 270, MANDATORY = 271, EXIT_VALUE = 272, BREAK_LINES = 273, DOUBLEQUOTE = 274, ASTERISK = 275, EXCLAMATIONMARK = 276, STORE_LONGINDEX = 277, EXPORT_LONG_OPTIONS = 278, GP_INCLUDE = 279, ERR_MSG = 280, COMMENT = 281, DO_NOT_DOCUMENT = 282, OPEN_ROUND_BRACE = 283, CLOSE_ROUND_BRACE = 284, COLON = 285, ADD_FLAG = 286, NO_STRUCT = 287, CODE_END = 288, QUOTED = 289, FIRST_QUOTED = 290, C_VAR = 291, ALNUM = 292, FILENAME = 293, CHAR_VAL = 294, FIRST_STR = 295, USAGE_LINE = 296, CODE_LINE = 297, OPT_NAME = 298, COMMENT_STR = 299, FUNCTION = 300, FLAG = 301, INT = 302, LONG = 303, ULONG = 304, INTMAX = 305, UINTMAX = 306, FLOAT = 307, DOUBLE = 308, CHAR = 309, STRING = 310 }; #endif /* Tokens. */ #define SLASH 258 #define RANGE_SPEC1 259 #define RANGE_SPEC2 260 #define FUNC_SPEC 261 #define NONE 262 #define OPEN_BRACE 263 #define CLOSE_BRACE 264 #define OPEN_SQUARE_BRACE 265 #define CLOSE_SQUARE_BRACE 266 #define EQUAL 267 #define INCLUDE 268 #define LT 269 #define GT 270 #define MANDATORY 271 #define EXIT_VALUE 272 #define BREAK_LINES 273 #define DOUBLEQUOTE 274 #define ASTERISK 275 #define EXCLAMATIONMARK 276 #define STORE_LONGINDEX 277 #define EXPORT_LONG_OPTIONS 278 #define GP_INCLUDE 279 #define ERR_MSG 280 #define COMMENT 281 #define DO_NOT_DOCUMENT 282 #define OPEN_ROUND_BRACE 283 #define CLOSE_ROUND_BRACE 284 #define COLON 285 #define ADD_FLAG 286 #define NO_STRUCT 287 #define CODE_END 288 #define QUOTED 289 #define FIRST_QUOTED 290 #define C_VAR 291 #define ALNUM 292 #define FILENAME 293 #define CHAR_VAL 294 #define FIRST_STR 295 #define USAGE_LINE 296 #define CODE_LINE 297 #define OPT_NAME 298 #define COMMENT_STR 299 #define FUNCTION 300 #define FLAG 301 #define INT 302 #define LONG 303 #define ULONG 304 #define INTMAX 305 #define UINTMAX 306 #define FLOAT 307 #define DOUBLE 308 #define CHAR 309 #define STRING 310 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 1676 of yacc.c */ #line 57 "parser.yy" char *str; /* string */ int i; param_type p; /* Line 1676 of yacc.c */ #line 170 "parser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; genparse-0.9.1/src/eh.cc0000644000076600001440000000472411716257231011756 00000000000000/** @file eh.cc \brief Methods for the error handler class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "eh.h" // default dispostion is to halt upon errors eh_disp_t EH::_disposition = EH_DISP_HALT; // default callback function is set to nothing void (*EH::_callback)(string) = NULL; //--------------------------------------------------------------------------- // // EH::EH () // // Constructor method. Do something intelligent with the error string. // //--------------------------------------------------------------------------- EH::EH (string s) { action (s, "", 0); } //--------------------------------------------------------------------------- // // EH::EH (string, string, int) // // Constructor method. Do something intelligent with the error string. // //--------------------------------------------------------------------------- EH::EH (string s, string f, int l) { action (s, f, l); } //--------------------------------------------------------------------------- // // EH::action () // // Decides what to do based on the current disposition // //--------------------------------------------------------------------------- void EH::action (string s, string f, int l) { ostringstream oss; if (!f.empty ()) oss << f << ":" << l << " " << s; else oss << s; switch (_disposition) { case EH_DISP_HALT: cerr << oss.str () << endl; abort (); break; case EH_DISP_CONTINUE: cerr << oss.str () << endl; break; case EH_DISP_IGNORE: break; case EH_DISP_CALLBACK: if (_callback == NULL) { cerr << "EH: must set callback function" << endl; abort (); } _callback (s); break; } return; } genparse-0.9.1/src/cldesc.cc0000644000076600001440000000242211716257231012610 00000000000000/** @file cldesc.cc \brief Methods for class Cldesc */ /* * Copyright (C) 2007 - 2012 * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "cldesc.h" /** Constructor method. Initialize some of the variables. */ Cldesc::Cldesc () { _start_1st_col = false; } /** Constructor method. */ Cldesc::Cldesc (const string &description, bool start_1st_col) { _description = description; _start_1st_col = start_1st_col; } /** Copy constructor */ Cldesc& Cldesc::operator=(const Cldesc &rhs) { // guard against self-assignment if (this != &rhs) _description = rhs._description; _start_1st_col = rhs._start_1st_col; return *this; } genparse-0.9.1/src/genparse_util.h0000644000076600001440000000227411716257231014063 00000000000000/** @file genparse_util.h \brief Utilities used within the genparse project */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef GENPARSE_UTIL_H #define GENPARSE_UTIL_H #include namespace genparse_util { using namespace std; string str2upper (string); string C_comment (const string s); string full_path (const string directory, const string filename); char minus_to_underscore (const char c); string str2C (string s); } #endif // GENPARSE_UTIL_H genparse-0.9.1/src/parse_cl.cc0000644000076600001440000001150711341041451013134 00000000000000/****************************************************************************** ** ** parse_cl.cc ** ** Sun Nov 16 13:14:13 2008 ** Linux 2.6.23 (#9 Sun Jan 27 22:29:05 CET 2008) i686 ** linux@mgpc (Michael Geng) ** ** Definition of command line parser class ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include "parse_cl.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) { extern char *optarg; extern int optind; int c; static struct option long_options[] = { {"cppext", required_argument, NULL, 'c'}, {"directory", required_argument, NULL, 'D'}, {"logfile", required_argument, NULL, 'f'}, {"gnulib", no_argument, NULL, 'g'}, {"internationalize", no_argument, NULL, 'i'}, {"language", required_argument, NULL, 'l'}, {"longmembers", no_argument, NULL, 'm'}, {"outfile", required_argument, NULL, 'o'}, {"parsefunc", required_argument, NULL, 'p'}, {"manyprints", no_argument, NULL, 'P'}, {"quiet", no_argument, NULL, 'q'}, {"static-headers", no_argument, NULL, 's'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; _program_name += argv[0]; /* default values */ _c = "cc"; _d = false; _f = "genparse.log"; _g = false; _i = false; _l = "c"; _m = false; _o = "parse_cl"; _p = "Cmdline"; _P = false; _q = false; _s = false; _h = false; _v = false; optind = 0; while ((c = getopt_long (argc, argv, "c:dD:f:gil:mo:p:Pqshv", long_options, &optind)) != - 1) { switch (c) { case 'c': _c = optarg; break; case 'd': _d = true; break; case 'D': _D = optarg; break; case 'f': _f = optarg; break; case 'g': _g = true; break; case 'i': _i = true; break; case 'l': _l = optarg; break; case 'm': _m = true; break; case 'o': _o = optarg; break; case 'p': _p = optarg; break; case 'P': _P = true; break; case 'q': _q = true; break; case 's': _s = true; break; case 'h': _h = true; this->usage (EXIT_SUCCESS); break; case 'v': _v = true; break; default: this->usage (EXIT_FAILURE); } } /* while */ _optind = optind; } /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) { if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else { std::cout << "\ usage: " << _program_name << " [ -cdDfgilmopPqshv ] file\n\ [ -c ] [ --cppext ] (type=STRING, default=cc)\n\ C++ file extension.\n\ [ -d ] (type=FLAG)\n\ Turns on logging.\n\ [ -D ] [ --directory ] (type=STRING)\n\ Directory for storing results.\n\ [ -f ] [ --logfile ] (type=STRING, default=genparse.log)\n\ Log file name.\n\ [ -g ] [ --gnulib ] (type=FLAG)\n\ Use GNU Portability Library (Gnulib).\n\ [ -i ] [ --internationalize ] (type=FLAG)\n\ Put internationalization macro _() around text output.\n\ [ -l ] [ --language ] (type=STRING, default=c)\n\ Output language.\n\ [ -m ] [ --longmembers ] (type=FLAG)\n\ Use long names for class members.\n\ [ -o ] [ --outfile ] (type=STRING, default=parse_cl)\n\ Output file name.\n\ [ -p ] [ --parsefunc ] (type=STRING, default=Cmdline)\n\ Name of parsing function / class.\n\ [ -P ] [ --manyprints ] (type=FLAG)\n\ Output help text for every command line parameter in a\n\ separate print command.\n\ [ -q ] [ --quiet ] (type=FLAG)\n\ Turns on quiet mode.\n\ [ -s ] [ --static-headers ] (type=FLAG)\n\ Keep headers of generated files static. Don't add\n\ creation date, username, kernel version etc.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n"; } exit (status); } genparse-0.9.1/src/userinfo.h0000644000076600001440000000330211716257231013045 00000000000000/** @file userinfo.h \brief Class definition for UNIX information on the user (caller) */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef USERINFO_H #define USERINFO_H #include #include "eh_system.h" //--------------------------------------------------------------------------- // // class Userinfo // //--------------------------------------------------------------------------- class Userinfo { private: string _userid; string _username; string _hostname; string _domainname; public: // Constructor and destructor Userinfo () throw (EH_system); ~Userinfo (){} // functions to retrieve the values string userid () { return _userid; } string username () { return _username; } string hostname () { return _hostname; } string domainname () { return _domainname; } // format the output into "userid@host (name)" string format () { return _userid + "@" + _hostname + _domainname + " (" + _username + ")"; } }; #endif genparse-0.9.1/src/parser.cc0000644000076600001440000020510711673365613012662 00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 22 "parser.yy" #include #include #include #include #include "genparse.h" #include "clparam_list.h" #include "logfile.h" #include "unique_int.h" #define YYDEBUG 1 // These prototypes are necessary for C++ compilation int yyerror (char *); int yylex (); void dump_short_reps (char *); void add_param_to_list (); void dump_param_type (param_type); // These are all defined in genparse.cc extern Clparam_list *my_params; extern Unique_Int longopt_value; extern Logfile mylog; extern int yylineno; extern char *yyfilename; // This is an object we use over and over to read in parameters Clparam *param; /* Line 189 of yacc.c */ #line 106 "parser.cc" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { SLASH = 258, RANGE_SPEC1 = 259, RANGE_SPEC2 = 260, FUNC_SPEC = 261, NONE = 262, OPEN_BRACE = 263, CLOSE_BRACE = 264, OPEN_SQUARE_BRACE = 265, CLOSE_SQUARE_BRACE = 266, EQUAL = 267, INCLUDE = 268, LT = 269, GT = 270, MANDATORY = 271, EXIT_VALUE = 272, BREAK_LINES = 273, DOUBLEQUOTE = 274, ASTERISK = 275, EXCLAMATIONMARK = 276, STORE_LONGINDEX = 277, EXPORT_LONG_OPTIONS = 278, GP_INCLUDE = 279, ERR_MSG = 280, COMMENT = 281, DO_NOT_DOCUMENT = 282, OPEN_ROUND_BRACE = 283, CLOSE_ROUND_BRACE = 284, COLON = 285, ADD_FLAG = 286, NO_STRUCT = 287, CODE_END = 288, QUOTED = 289, FIRST_QUOTED = 290, C_VAR = 291, ALNUM = 292, FILENAME = 293, CHAR_VAL = 294, FIRST_STR = 295, USAGE_LINE = 296, CODE_LINE = 297, OPT_NAME = 298, COMMENT_STR = 299, FUNCTION = 300, FLAG = 301, INT = 302, LONG = 303, ULONG = 304, INTMAX = 305, UINTMAX = 306, FLOAT = 307, DOUBLE = 308, CHAR = 309, STRING = 310 }; #endif /* Tokens. */ #define SLASH 258 #define RANGE_SPEC1 259 #define RANGE_SPEC2 260 #define FUNC_SPEC 261 #define NONE 262 #define OPEN_BRACE 263 #define CLOSE_BRACE 264 #define OPEN_SQUARE_BRACE 265 #define CLOSE_SQUARE_BRACE 266 #define EQUAL 267 #define INCLUDE 268 #define LT 269 #define GT 270 #define MANDATORY 271 #define EXIT_VALUE 272 #define BREAK_LINES 273 #define DOUBLEQUOTE 274 #define ASTERISK 275 #define EXCLAMATIONMARK 276 #define STORE_LONGINDEX 277 #define EXPORT_LONG_OPTIONS 278 #define GP_INCLUDE 279 #define ERR_MSG 280 #define COMMENT 281 #define DO_NOT_DOCUMENT 282 #define OPEN_ROUND_BRACE 283 #define CLOSE_ROUND_BRACE 284 #define COLON 285 #define ADD_FLAG 286 #define NO_STRUCT 287 #define CODE_END 288 #define QUOTED 289 #define FIRST_QUOTED 290 #define C_VAR 291 #define ALNUM 292 #define FILENAME 293 #define CHAR_VAL 294 #define FIRST_STR 295 #define USAGE_LINE 296 #define CODE_LINE 297 #define OPT_NAME 298 #define COMMENT_STR 299 #define FUNCTION 300 #define FLAG 301 #define INT 302 #define LONG 303 #define ULONG 304 #define INTMAX 305 #define UINTMAX 306 #define FLOAT 307 #define DOUBLE 308 #define CHAR 309 #define STRING 310 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 214 of yacc.c */ #line 57 "parser.yy" char *str; /* string */ int i; param_type p; /* Line 214 of yacc.c */ #line 260 "parser.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 272 "parser.cc" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 26 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 125 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 56 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 42 /* YYNRULES -- Number of rules. */ #define YYNRULES 103 /* YYNRULES -- Number of states. */ #define YYNSTATES 137 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 310 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 7, 10, 11, 14, 16, 18, 20, 22, 24, 26, 28, 30, 35, 40, 43, 46, 49, 52, 54, 56, 58, 61, 63, 64, 67, 69, 73, 74, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 102, 104, 109, 111, 113, 117, 121, 126, 129, 131, 135, 139, 141, 144, 147, 149, 152, 155, 158, 161, 165, 167, 170, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 205, 209, 213, 216, 218, 220, 221, 223, 225, 228, 230, 232, 233, 236, 238, 240, 243, 245, 248, 250, 252, 254, 256 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 57, 0, -1, 58, 67, 93, -1, 58, 93, -1, -1, 58, 59, -1, 59, -1, 60, -1, 61, -1, 62, -1, 63, -1, 64, -1, 65, -1, 66, -1, 13, 14, 38, 15, -1, 13, 19, 38, 19, -1, 16, 36, -1, 17, 36, -1, 17, 37, -1, 18, 37, -1, 23, -1, 32, -1, 91, -1, 67, 68, -1, 68, -1, -1, 69, 70, -1, 77, -1, 78, 85, 71, -1, -1, 71, 72, -1, 72, -1, 86, -1, 87, -1, 91, -1, 73, -1, 22, -1, 74, -1, 31, -1, 27, -1, 76, -1, 95, -1, 73, 92, -1, 92, -1, 25, 28, 75, 29, -1, 37, -1, 34, -1, 37, 30, 36, -1, 34, 30, 36, -1, 26, 28, 44, 29, -1, 24, 38, -1, 79, -1, 7, 3, 80, -1, 79, 3, 80, -1, 40, -1, 40, 20, -1, 40, 21, -1, 83, -1, 83, 81, -1, 83, 82, -1, 12, 36, -1, 12, 43, -1, 10, 81, 11, -1, 84, -1, 84, 20, -1, 84, 21, -1, 37, -1, 36, -1, 47, -1, 48, -1, 49, -1, 50, -1, 51, -1, 52, -1, 53, -1, 55, -1, 54, -1, 46, -1, 37, -1, 39, -1, 8, 34, 9, -1, 10, 88, 11, -1, 37, 90, 89, -1, 90, 89, -1, 37, -1, 36, -1, -1, 4, -1, 5, -1, 45, 6, -1, 34, -1, 35, -1, -1, 93, 94, -1, 94, -1, 41, -1, 95, 96, -1, 96, -1, 97, 33, -1, 33, -1, 42, -1, 28, -1, 29, -1, 97, 97, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 81, 81, 82, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 99, 105, 113, 121, 127, 135, 143, 150, 157, 164, 165, 169, 169, 176, 179, 186, 187, 188, 191, 197, 198, 203, 204, 209, 210, 215, 220, 221, 224, 225, 228, 231, 238, 245, 255, 266, 273, 280, 287, 292, 300, 301, 305, 311, 312, 313, 316, 321, 328, 334, 335, 339, 345, 351, 359, 360, 368, 376, 384, 392, 393, 401, 402, 403, 406, 407, 408, 411, 414, 420, 424, 430, 436, 439, 440, 443, 446, 452, 460, 461, 462, 465, 473, 474, 477, 483, 490, 493, 497, 501 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "SLASH", "RANGE_SPEC1", "RANGE_SPEC2", "FUNC_SPEC", "NONE", "OPEN_BRACE", "CLOSE_BRACE", "OPEN_SQUARE_BRACE", "CLOSE_SQUARE_BRACE", "EQUAL", "INCLUDE", "LT", "GT", "MANDATORY", "EXIT_VALUE", "BREAK_LINES", "DOUBLEQUOTE", "ASTERISK", "EXCLAMATIONMARK", "STORE_LONGINDEX", "EXPORT_LONG_OPTIONS", "GP_INCLUDE", "ERR_MSG", "COMMENT", "DO_NOT_DOCUMENT", "OPEN_ROUND_BRACE", "CLOSE_ROUND_BRACE", "COLON", "ADD_FLAG", "NO_STRUCT", "CODE_END", "QUOTED", "FIRST_QUOTED", "C_VAR", "ALNUM", "FILENAME", "CHAR_VAL", "FIRST_STR", "USAGE_LINE", "CODE_LINE", "OPT_NAME", "COMMENT_STR", "FUNCTION", "FLAG", "INT", "LONG", "ULONG", "INTMAX", "UINTMAX", "FLOAT", "DOUBLE", "CHAR", "STRING", "$accept", "all", "globals", "global", "include", "mandatory", "exit_value", "break_lines", "export_long_options", "no_struct", "global_callback", "entries", "entry", "$@1", "new_entry", "options", "option", "descs", "err_msg", "err_msg_arg", "comment", "gp_include", "param", "short_params", "long_param", "mandatory_opt_name", "optional_opt_name", "multi_long_option", "long_option", "type", "default", "range", "contiguous_range", "more_range", "range_spec", "callback", "desc", "usages", "usage", "code_lines", "code_line", "single_code_line", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 56, 57, 57, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 61, 62, 62, 63, 64, 65, 66, 67, 67, 69, 68, 68, 70, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 74, 75, 75, 75, 75, 76, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 82, 83, 83, 83, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 87, 88, 88, 89, 89, 89, 90, 90, 91, 92, 92, 93, 93, 93, 94, 95, 95, 96, 96, 97, 97, 97, 97 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 3, 2, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 2, 2, 2, 2, 1, 1, 1, 2, 1, 0, 2, 1, 3, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 3, 3, 4, 2, 1, 3, 3, 1, 2, 2, 1, 2, 2, 2, 2, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 4, 0, 0, 0, 0, 20, 21, 0, 0, 25, 6, 7, 8, 9, 10, 11, 12, 13, 22, 0, 0, 16, 17, 18, 19, 89, 1, 0, 95, 5, 25, 24, 0, 27, 3, 94, 0, 0, 50, 23, 2, 0, 54, 26, 0, 51, 93, 14, 15, 0, 55, 56, 77, 68, 69, 70, 71, 72, 73, 74, 76, 75, 29, 0, 67, 66, 52, 57, 63, 0, 0, 36, 0, 0, 39, 101, 102, 38, 99, 90, 91, 78, 79, 100, 28, 31, 35, 37, 40, 32, 33, 34, 43, 41, 97, 0, 53, 0, 0, 58, 59, 64, 65, 0, 87, 88, 0, 0, 86, 0, 0, 30, 42, 96, 98, 103, 0, 60, 61, 80, 86, 81, 85, 84, 83, 46, 45, 0, 0, 62, 82, 0, 0, 44, 49, 48, 47 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 30, 31, 32, 43, 84, 85, 86, 87, 127, 88, 33, 44, 45, 66, 99, 100, 67, 68, 62, 89, 90, 107, 124, 108, 18, 92, 34, 35, 93, 94, 95 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -90 static const yytype_int8 yypact[] = { 51, 19, -26, 34, -17, -90, -90, 16, 61, 0, -90, -90, -90, -90, -90, -90, -90, -90, -90, 27, 59, -90, -90, -90, -90, -90, -90, 60, -90, -90, 1, -90, -3, -90, -7, -90, 42, 80, -90, -90, -7, 97, 52, -90, 38, 98, -90, -90, -90, 39, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, 21, 39, -90, -90, -90, -1, 57, 68, -2, -90, 75, 76, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, 21, -90, 45, -90, -90, -90, -90, -90, -90, -21, -90, -14, -90, 93, 8, -90, -90, -90, -90, 99, -90, -90, 77, 95, 58, 25, 63, -90, -90, -90, -90, 11, 100, -90, -90, -90, 58, -90, -90, -90, -90, 79, 82, 81, 84, -90, -90, 78, 83, -90, -90, -90, -90 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -90, -90, -90, 106, -90, -90, -90, -90, -90, -90, -90, -90, 86, -90, -90, -90, 33, -90, -90, -90, -90, -90, -90, -90, 55, 23, -90, -90, -90, -90, -90, -90, -90, 2, 15, -57, 37, 94, -4, -90, 32, -89 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -93 static const yytype_int16 yytable[] = { -92, -92, 104, 105, 41, 91, 115, 75, 76, 97, 21, 98, 78, 1, 75, 76, 2, 3, 4, 114, 24, 83, 25, 5, 27, 27, 115, 91, 83, 69, 46, 70, 6, 19, 28, 106, 46, 42, 20, 75, 76, 28, 28, 71, 117, 7, 72, 73, 74, 75, 76, 118, 77, 83, 78, 79, 80, 47, 81, 125, 82, 26, 126, 83, 1, 36, 7, 2, 3, 4, 22, 23, 50, 51, 5, 64, 65, 101, 102, 79, 80, 104, 105, 6, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 122, 123, 7, 37, 38, 48, 49, 63, 103, 109, 110, 98, 121, 128, 119, 131, 133, 129, 132, 134, 135, 29, 39, 111, 96, 136, 116, 120, 130, 112, 40, 113 }; static const yytype_uint8 yycheck[] = { 0, 0, 4, 5, 7, 62, 95, 28, 29, 10, 36, 12, 33, 13, 28, 29, 16, 17, 18, 33, 37, 42, 6, 23, 24, 24, 115, 84, 42, 8, 34, 10, 32, 14, 41, 37, 40, 40, 19, 28, 29, 41, 41, 22, 36, 45, 25, 26, 27, 28, 29, 43, 31, 42, 33, 34, 35, 15, 37, 34, 39, 0, 37, 42, 13, 38, 45, 16, 17, 18, 36, 37, 20, 21, 23, 36, 37, 20, 21, 34, 35, 4, 5, 32, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 36, 37, 45, 38, 38, 19, 3, 3, 34, 28, 28, 12, 11, 44, 9, 30, 29, 11, 30, 29, 36, 9, 30, 84, 63, 36, 97, 106, 120, 86, 30, 93 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 13, 16, 17, 18, 23, 32, 45, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 91, 14, 19, 36, 36, 37, 37, 6, 0, 24, 41, 59, 67, 68, 69, 77, 93, 94, 38, 38, 38, 68, 93, 7, 40, 70, 78, 79, 94, 15, 19, 3, 20, 21, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 85, 3, 36, 37, 80, 83, 84, 8, 10, 22, 25, 26, 27, 28, 29, 31, 33, 34, 35, 37, 39, 42, 71, 72, 73, 74, 76, 86, 87, 91, 92, 95, 96, 97, 80, 10, 12, 81, 82, 20, 21, 34, 4, 5, 37, 88, 90, 28, 28, 72, 92, 96, 33, 97, 81, 36, 43, 9, 90, 11, 36, 37, 89, 34, 37, 75, 44, 11, 89, 30, 30, 29, 29, 36, 36 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 14: /* Line 1455 of yacc.c */ #line 100 "parser.yy" { my_params->add_include ((string)"<" + (yyvsp[(3) - (4)].str) + ">"); mylog.write ((string) "adding include file: <" + (yyvsp[(3) - (4)].str) + ">"); free ((yyvsp[(3) - (4)].str)); } break; case 15: /* Line 1455 of yacc.c */ #line 106 "parser.yy" { my_params->add_include ((string)"\"" + (yyvsp[(3) - (4)].str) + "\""); mylog.write ((string) "adding include file: \"" + (yyvsp[(3) - (4)].str) + "\""); free ((yyvsp[(3) - (4)].str)); } break; case 16: /* Line 1455 of yacc.c */ #line 114 "parser.yy" { my_params->add_mandatory ((yyvsp[(2) - (2)].str)); mylog.write ((string) "adding mandatory: " + (yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 17: /* Line 1455 of yacc.c */ #line 122 "parser.yy" { my_params->set_exit_value ((yyvsp[(2) - (2)].str)); mylog.write ((string) "adding exit value: " + (yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 18: /* Line 1455 of yacc.c */ #line 128 "parser.yy" { my_params->set_exit_value ((yyvsp[(2) - (2)].str)); mylog.write ((string) "adding exit value: " + (yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 19: /* Line 1455 of yacc.c */ #line 136 "parser.yy" { my_params->set_break_lines ((yyvsp[(2) - (2)].str)); mylog.write ((string) "breaking lines to a width of: " + (yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 20: /* Line 1455 of yacc.c */ #line 144 "parser.yy" { my_params->set_export_long_options (true); mylog.write ((string) "exporting long options struct"); } break; case 21: /* Line 1455 of yacc.c */ #line 151 "parser.yy" { my_params->set_no_struct (true); mylog.write ((string) "do not auto generate a struct / class for parsing results"); } break; case 22: /* Line 1455 of yacc.c */ #line 158 "parser.yy" { my_params->set_global_callback ((yyvsp[(1) - (1)].str)); mylog.write ((string) "setting global callback: " + (yyvsp[(1) - (1)].str)); } break; case 25: /* Line 1455 of yacc.c */ #line 169 "parser.yy" { param = new Clparam; mylog.write ("reading parameter..."); } break; case 26: /* Line 1455 of yacc.c */ #line 173 "parser.yy" { add_param_to_list (); } break; case 28: /* Line 1455 of yacc.c */ #line 180 "parser.yy" { param->set_type ((yyvsp[(2) - (3)].p)); dump_param_type ((yyvsp[(2) - (3)].p)); } break; case 32: /* Line 1455 of yacc.c */ #line 192 "parser.yy" { param->set_default_value ((yyvsp[(1) - (1)].str)); mylog.write ((string) " default value: " + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 34: /* Line 1455 of yacc.c */ #line 199 "parser.yy" { param->set_callback ((yyvsp[(1) - (1)].str)); mylog.write ((string) " callback: " + (yyvsp[(1) - (1)].str)); } break; case 36: /* Line 1455 of yacc.c */ #line 205 "parser.yy" { param->set_store_longindex (true); mylog.write ((string) " longindex for this parameter must be stored"); } break; case 38: /* Line 1455 of yacc.c */ #line 211 "parser.yy" { param->set_add_flag (true); mylog.write ((string) " this parameter also gets a flag"); } break; case 39: /* Line 1455 of yacc.c */ #line 216 "parser.yy" { param->set_do_not_document (true); mylog.write ((string) " do not document this parameter"); } break; case 45: /* Line 1455 of yacc.c */ #line 232 "parser.yy" { param->set_err_msg ((yyvsp[(1) - (1)].str)); mylog.write ((string) " conversion error message: " + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 46: /* Line 1455 of yacc.c */ #line 239 "parser.yy" { param->set_err_msg (string("\"") + (yyvsp[(1) - (1)].str) + '\"'); mylog.write ((string) " conversion error message: \"" + (yyvsp[(1) - (1)].str) + '\"'); free ((yyvsp[(1) - (1)].str)); } break; case 47: /* Line 1455 of yacc.c */ #line 246 "parser.yy" { param->set_err_msg ((yyvsp[(1) - (3)].str)); mylog.write ((string) " conversion error message: " + (yyvsp[(1) - (3)].str)); param->set_err_msg_conv ((yyvsp[(3) - (3)].str)); mylog.write ((string) " conversion function for erraneous argument: " + (yyvsp[(3) - (3)].str)); free ((yyvsp[(1) - (3)].str)); free ((yyvsp[(3) - (3)].str)); } break; case 48: /* Line 1455 of yacc.c */ #line 256 "parser.yy" { param->set_err_msg (string("\"") + (yyvsp[(1) - (3)].str) + '\"'); mylog.write ((string) " conversion error message: \"" + (yyvsp[(1) - (3)].str) + '\"'); param->set_err_msg_conv ((yyvsp[(3) - (3)].str)); mylog.write ((string) " conversion function for erraneous argument: " + (yyvsp[(3) - (3)].str)); free ((yyvsp[(1) - (3)].str)); free ((yyvsp[(3) - (3)].str)); } break; case 49: /* Line 1455 of yacc.c */ #line 267 "parser.yy" { param->set_comment ((yyvsp[(3) - (4)].str)); mylog.write ((string) " comment: " + (yyvsp[(3) - (4)].str)); free ((yyvsp[(3) - (4)].str)); } break; case 50: /* Line 1455 of yacc.c */ #line 274 "parser.yy" { mylog.write ((string) "including genparse file" + (yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 51: /* Line 1455 of yacc.c */ #line 281 "parser.yy" { param->set_short_reps ((yyvsp[(1) - (1)].str)); dump_short_reps ((yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 52: /* Line 1455 of yacc.c */ #line 288 "parser.yy" { param->set_longopt_value (longopt_value.get ()); param->set_long_only (true); } break; case 53: /* Line 1455 of yacc.c */ #line 293 "parser.yy" { param->set_short_reps ((yyvsp[(1) - (3)].str)); dump_short_reps ((yyvsp[(1) - (3)].str)); free ((yyvsp[(1) - (3)].str)); } break; case 55: /* Line 1455 of yacc.c */ #line 302 "parser.yy" { param->set_short_has_arg (optional_argument); } break; case 56: /* Line 1455 of yacc.c */ #line 306 "parser.yy" { param->set_short_has_arg (no_argument); } break; case 60: /* Line 1455 of yacc.c */ #line 317 "parser.yy" { param->set_opt_name ((yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 61: /* Line 1455 of yacc.c */ #line 322 "parser.yy" { param->set_opt_name ((yyvsp[(2) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; case 62: /* Line 1455 of yacc.c */ #line 329 "parser.yy" { param->set_opt_name_in_square_braces (true); } break; case 63: /* Line 1455 of yacc.c */ #line 334 "parser.yy" {} break; case 64: /* Line 1455 of yacc.c */ #line 336 "parser.yy" { param->set_long_has_arg (optional_argument); } break; case 65: /* Line 1455 of yacc.c */ #line 340 "parser.yy" { param->set_long_has_arg (no_argument); } break; case 66: /* Line 1455 of yacc.c */ #line 346 "parser.yy" { param->set_long_rep ((yyvsp[(1) - (1)].str)); mylog.write ((string) " long representation: " + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 67: /* Line 1455 of yacc.c */ #line 352 "parser.yy" { param->set_long_rep ((yyvsp[(1) - (1)].str)); mylog.write ((string) " long representation: " + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 68: /* Line 1455 of yacc.c */ #line 359 "parser.yy" { (yyval.p) = int_type; } break; case 69: /* Line 1455 of yacc.c */ #line 361 "parser.yy" { if (my_params->get_use_gnulib ()) (yyval.p) = long_type; else yyerror ("type long only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } break; case 70: /* Line 1455 of yacc.c */ #line 369 "parser.yy" { if (my_params->get_use_gnulib ()) (yyval.p) = ulong_type; else yyerror ("type ulong only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } break; case 71: /* Line 1455 of yacc.c */ #line 377 "parser.yy" { if (my_params->get_use_gnulib ()) (yyval.p) = intmax_type; else yyerror ("type intmax_t only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } break; case 72: /* Line 1455 of yacc.c */ #line 385 "parser.yy" { if (my_params->get_use_gnulib ()) (yyval.p) = uintmax_type; else yyerror ("type uintmax_t only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } break; case 73: /* Line 1455 of yacc.c */ #line 392 "parser.yy" { (yyval.p) = float_type; } break; case 74: /* Line 1455 of yacc.c */ #line 394 "parser.yy" { if (my_params->get_use_gnulib ()) (yyval.p) = double_type; else yyerror ("type double only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } break; case 75: /* Line 1455 of yacc.c */ #line 401 "parser.yy" { (yyval.p) = string_type; } break; case 76: /* Line 1455 of yacc.c */ #line 402 "parser.yy" { (yyval.p) = char_type; } break; case 77: /* Line 1455 of yacc.c */ #line 403 "parser.yy" { (yyval.p) = flag_type; } break; case 80: /* Line 1455 of yacc.c */ #line 408 "parser.yy" { (yyval.str) = (yyvsp[(2) - (3)].str); } break; case 82: /* Line 1455 of yacc.c */ #line 415 "parser.yy" { param->set_low_range ((yyvsp[(1) - (3)].str)); mylog.write ((string)" parameter range: " + (yyvsp[(1) - (3)].str) + ".."); free ((yyvsp[(1) - (3)].str)); } break; case 84: /* Line 1455 of yacc.c */ #line 425 "parser.yy" { param->set_high_range ((yyvsp[(1) - (1)].str)); mylog.write ((string)" parameter range: .." + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 85: /* Line 1455 of yacc.c */ #line 431 "parser.yy" { param->set_high_range ((yyvsp[(1) - (1)].str)); mylog.write ((string)" parameter range: .." + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 89: /* Line 1455 of yacc.c */ #line 443 "parser.yy" { (yyval.str) = (yyvsp[(1) - (2)].str); } break; case 90: /* Line 1455 of yacc.c */ #line 447 "parser.yy" { param->add_description ((yyvsp[(1) - (1)].str), false); mylog.write ((string) " description: " + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 91: /* Line 1455 of yacc.c */ #line 453 "parser.yy" { param->add_description ((yyvsp[(1) - (1)].str), true); mylog.write ((string) " description starting in 1st column: " + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 95: /* Line 1455 of yacc.c */ #line 466 "parser.yy" { my_params->append_usage_line ((yyvsp[(1) - (1)].str)); mylog.write ((string)" usage string:" + (yyvsp[(1) - (1)].str)); free ((yyvsp[(1) - (1)].str)); } break; case 98: /* Line 1455 of yacc.c */ #line 478 "parser.yy" { param->add_code_line ((yyvsp[(1) - (2)].str)); mylog.write ((string)" code string:" + (yyvsp[(1) - (2)].str)); free ((yyvsp[(1) - (2)].str)); } break; case 99: /* Line 1455 of yacc.c */ #line 484 "parser.yy" { param->add_code_line (""); mylog.write ((string)" code string:"); } break; case 100: /* Line 1455 of yacc.c */ #line 491 "parser.yy" { } break; case 101: /* Line 1455 of yacc.c */ #line 494 "parser.yy" { (yyval.str) = strdup ((string ("(")).c_str ()); } break; case 102: /* Line 1455 of yacc.c */ #line 498 "parser.yy" { (yyval.str) = strdup ((string (")")).c_str ()); } break; case 103: /* Line 1455 of yacc.c */ #line 502 "parser.yy" { (yyval.str) = strdup ((string ((yyvsp[(1) - (2)].str)) + (yyvsp[(2) - (2)].str)).c_str ()); free ((yyvsp[(1) - (2)].str)); free ((yyvsp[(2) - (2)].str)); } break; /* Line 1455 of yacc.c */ #line 2224 "parser.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 508 "parser.yy" int yyerror (char *s) { cerr << s << " in " << yyfilename << ": " << yylineno << endl; return 1; } void dump_short_reps (char *s) { mylog.write (LOG_OPTION_NO_CR, " short representation: "); mylog.write (LOG_OPTION_NO_TS, s); } void add_param_to_list () { mylog.write ("done reading parameter...adding to list"); my_params->add (*param); delete param; } void dump_param_type (param_type p) { mylog.write (LOG_OPTION_NO_CR, " parameter type: "); switch (p) { case int_type: mylog.write (LOG_OPTION_NO_TS, "int"); break; case long_type: mylog.write (LOG_OPTION_NO_TS, "long int"); break; case ulong_type: mylog.write (LOG_OPTION_NO_TS, "unsigned long int"); break; case intmax_type: mylog.write (LOG_OPTION_NO_TS, "intmax_t"); break; case uintmax_type: mylog.write (LOG_OPTION_NO_TS, "uintmax_t"); break; case float_type: mylog.write (LOG_OPTION_NO_TS, "float"); break; case double_type: mylog.write (LOG_OPTION_NO_TS, "double"); break; case string_type: mylog.write (LOG_OPTION_NO_TS, "string"); break; case char_type: mylog.write (LOG_OPTION_NO_TS, "char"); break; case flag_type: mylog.write (LOG_OPTION_NO_TS, "flag"); break; default: break; } } genparse-0.9.1/src/getopt.h0000644000076600001440000001312511716257231012521 00000000000000/** @file getopt.h \brief Declarations for getopt */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if defined __STDC__ && __STDC__ const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if defined __STDC__ && __STDC__ # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int __argc, char *const *__argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ genparse-0.9.1/src/userinfo.cc0000644000076600001440000000511511716257231013207 00000000000000/** @file userinfo.cc \brief Methods for the user information class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "userinfo.h" #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif //--------------------------------------------------------------------------- // // Userinfo::Userinfo () // // Constructor method. Does most of the work // //--------------------------------------------------------------------------- Userinfo::Userinfo () throw (EH_system) { struct passwd *pw; char host[MAXHOSTNAMELEN]; char domain[MAXHOSTNAMELEN]; string::size_type annoying_comma; // Get userid and name pw = getpwuid (getuid ()); if (pw == NULL) { EH_system e ("cannot get user info"); throw e; } // Store locally _userid = pw->pw_name; _username = pw->pw_gecos; // Get rid of annoying ,,, if its in the name annoying_comma = _username.find (','); if (annoying_comma != string::npos) _username.erase (annoying_comma); // Get host name if (gethostname (host, MAXHOSTNAMELEN) < 0) { EH_system e ("cannot get host name"); throw e; } _hostname = host; // Get the domain name _domainname = ""; /* * The getdomainame () call is not supported on many systems, so we make * sure to check for it. In particular, since autoconf is broken under * cygwin and getdomainname () is not present, we specifically check for * __CYGWIN__ */ #if defined (HAVE_GETDOMAINNAME) && !defined (__CYGWIN__) if (getdomainname (domain, MAXHOSTNAMELEN) == -1) { EH_system e ("cannot get domain name"); throw e; } _domainname = domain; if (_domainname == "(none)") _domainname = ""; else _domainname = "." + _domainname; #endif } genparse-0.9.1/src/clparam_list_factory.h0000644000076600001440000000234111716257231015416 00000000000000/** @file clparam_list_factory.h \brief Definition of the class which constructs the command line parser class Clparam_list */ /* * Copyright (C) 2006 - 2012 * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CLPARAM_LIST_FACTORY_H #define CLPARAM_LIST_FACTORY_H #include "clparam_list.h" #include "eh.h" /** \brief Constructs a language specific command line parser class. */ class Clparam_list_factory { public: Clparam_list_factory () {} ~Clparam_list_factory () {} Clparam_list *Create_Clparam_list (const string &language) const throw (EH); }; #endif // CLPARAM_LIST_FACTORY_H genparse-0.9.1/src/logfile.h0000644000076600001440000000464511716257231012647 00000000000000/** @file logfile.h \brief Class definition for logfiles */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LOGFILE_H #define LOGFILE_H #include #include #include "systime.h" #include "eh.h" enum log_option_t { LOG_OPTION_NORMAL, // send timestamp and carriage return LOG_OPTION_NO_CR, // don't send the carriage return LOG_OPTION_NO_TS // don't send the timestamp }; //--------------------------------------------------------------------------- // // class Logfile // // Instead of subclassing ofstream, we roll our own. This way we have // the flexibility to add a timestamp to the beginning of each line, which // is very useful for debugging real-time code. // //--------------------------------------------------------------------------- class Logfile { private: string _filename; ofstream _log; bool _active; bool _is_open; // write a timestamp - called by public write () functions void write_ts () { Systime t; _log << t.hms () << "." << t.microseconds () << ": "; } public: // Constructor and destructor Logfile (); ~Logfile (){} // open the log file void open (string) throw (EH); // close the log file void close (); // check if the logfile is active bool is_active () { return _active; } // suspend logging w/o closing the file void suspend () { _active = false; } // resume suspended logging void resume () { _active = true; } // functions to retrieve the values string filename () { return _filename; } // Call one of these to write to the log file void write_separator (); void write (string); void write (log_option_t, string); void write (char); void write (log_option_t, char); }; #endif genparse-0.9.1/src/genparse.h0000644000076600001440000000162311716257231013023 00000000000000/** @file genparse.h \brief This file will be included by the flex and bison files */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif genparse-0.9.1/src/lexer.cc0000644000076600001440000034775411347173775012530 00000000000000 #line 3 "lexer.cc" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 33 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 72 #define YY_END_OF_BUFFER 73 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_acclist[1672] = { 0, 1, 1, 66, 66, 45, 45, 52, 52, 1, 1, 1, 1, 73, 65, 68, 72, 1, 65, 68, 72, 1, 68, 72, 32, 65, 68, 72, 25, 65, 68, 72, 65, 68, 72, 65, 68, 72, 9, 65, 68, 72, 10, 65, 68, 72, 31, 65, 68, 72, 33, 65, 68, 72, 59, 65, 68, 72, 11, 65, 68, 72, 23, 65, 68, 72, 30, 65, 68, 72, 24, 65, 68, 72, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72,16440, 7, 65, 68, 72, 8, 65, 68, 72, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72, 16440, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72,16440, 54, 59, 65, 68, 72, 16440, 5, 65, 68, 72, 6, 65, 68, 72, 25, 65, 68, 72, 4, 59, 65, 68, 72, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72,16440, 4, 54, 59, 65, 68, 72, 16440, 66, 68, 72, 68, 72, 66, 68, 72, 67, 68, 72, 28, 68, 72, 26, 68, 72, 27, 68, 72, 57, 68, 72, 29, 68, 72, 68, 72, 68, 70, 72, 68, 71, 72, 45, 68, 72, 43, 68, 72, 44, 68, 72, 52, 68, 72, 53, 68, 72, 50, 68, 72, 51, 68, 72, 58, 59, 65, 68, 72, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72,16440, 54, 58, 59, 65, 68, 72, 16440, 5, 58, 65, 68, 72, 58, 65, 68, 72, 6, 58, 65, 68, 72, 4, 58, 59, 65, 68, 72, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72, 16440, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72,16440, 4, 54, 58, 59, 65, 68, 72,16440, 65, 68, 72, 54, 59, 65, 68, 72,16440, 1, 63, 64, 55, 59, 2, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59, 16440, 62, 63, 4, 59, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59, 16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59, 16440, 4, 54, 59,16440, 66, 66, 57, 57, 70, 71, 71, 45, 52, 58, 59, 58, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 4, 58, 59, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 60, 54, 59,16440, 59, 8248, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 12, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59, 16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 12, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 12, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 4, 54, 58, 59, 16440, 4, 54, 58, 59,16440, 4, 54, 58, 59, 16440, 4, 54, 58, 59,16440, 4, 54, 58, 59, 16440, 4, 12, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 61, 54, 59, 16440, 54, 59,16440, 3, 54, 59,16440, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 19, 54, 59,16440, 54, 59,16440, 21, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 13, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 3, 4, 54, 59,16440, 4, 19, 54, 59,16440, 4, 54, 59,16440, 4, 21, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 13, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 66, 3, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 19, 54, 58, 59,16440, 54, 58, 59,16440, 21, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 13, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 3, 4, 54, 58, 59,16440, 4, 19, 54, 58, 59, 16440, 4, 54, 58, 59,16440, 4, 21, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 13, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59, 16440, 54, 59,16440, 17, 54, 59,16440, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 14, 54, 59, 16440, 4, 54, 59,16440, 4, 17, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 54, 59,16440, 4, 14, 54, 59,16440, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 17, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 14, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 17, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 54, 58, 59,16440, 4, 14, 54, 58, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59, 16440, 54, 59,16440, 18, 54, 59,16440, 15, 54, 59,16440, 20, 54, 59,16440, 54, 59,16440, 4, 18, 54, 59,16440, 4, 15, 54, 59,16440, 4, 20, 54, 59,16440, 4, 54, 59,16440, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 18, 54, 58, 59,16440, 15, 54, 58, 59,16440, 20, 54, 58, 59,16440, 54, 58, 59,16440, 4, 18, 54, 58, 59,16440, 4, 15, 54, 58, 59,16440, 4, 20, 54, 58, 59,16440, 4, 54, 58, 59, 16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 16, 54, 59,16440, 4, 16, 54, 59,16440, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 16, 54, 58, 59,16440, 4, 16, 54, 58, 59,16440, 54, 59,16440, 54, 59,16440, 22, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 49, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 54, 59,16440, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 34, 38, 54, 59,16440, 54, 59, 16440, 54, 59,16440, 54, 59,16440, 48, 66, 54, 58, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 35, 69, 54, 59,16440, 42, 54, 59, 16440, 54, 59,16440, 39, 54, 59,16440, 54, 58, 59,16440, 42, 54, 58, 59,16440, 54, 58, 59, 16440, 39, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 36, 47, 41, 54, 59,16440, 54, 59,16440, 41, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 59,16440, 54, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 54, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 54, 59,16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 54, 59,16440, 54, 58, 59,16440, 54, 58, 59, 16440, 54, 59,16440, 54, 59,16440, 54, 58, 59, 16440, 54, 58, 59,16440, 54, 59,16440, 54, 59, 16440, 54, 58, 59,16440, 54, 58, 59,16440, 54, 59,16440, 40, 54, 59,16440, 40, 54, 58, 59, 16440, 46, 54, 58, 59,16440, 46, 54, 59,16440, 37 } ; static yyconst flex_int16_t yy_accept[528] = { 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 24, 28, 32, 35, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 80, 86, 90, 94, 100, 106, 112, 118, 124, 130, 136, 142, 146, 150, 154, 159, 166, 173, 180, 187, 194, 201, 208, 215, 222, 225, 227, 230, 233, 236, 239, 242, 245, 248, 250, 253, 256, 259, 262, 265, 268, 271, 274, 277, 282, 289, 296, 303, 310, 317, 324, 331, 338, 345, 352, 357, 361, 366, 372, 380, 388, 396, 404, 412, 420, 428, 436, 444, 447, 453, 454, 454, 455, 455, 455, 455, 455, 455, 455, 455, 455, 456, 457, 458, 458, 459, 459, 459, 462, 465, 468, 471, 474, 477, 480, 483, 486, 489, 492, 492, 494, 496, 500, 504, 508, 512, 516, 520, 524, 528, 532, 536, 537, 538, 539, 540, 540, 541, 542, 543, 544, 545, 547, 548, 552, 556, 560, 564, 568, 572, 576, 580, 584, 588, 592, 595, 600, 605, 610, 615, 620, 625, 630, 635, 640, 645, 646, 649, 649, 649, 649, 649, 649, 649, 649, 650, 651, 654, 657, 660, 663, 666, 669, 672, 675, 678, 682, 685, 688, 691, 694, 698, 702, 706, 710, 714, 719, 723, 727, 731, 735, 736, 740, 744, 748, 752, 756, 760, 764, 768, 772, 776, 781, 785, 789, 793, 797, 802, 807, 812, 817, 822, 828, 833, 838, 843, 848, 849, 852, 855, 855, 855, 855, 855, 855, 855, 855, 855, 859, 862, 865, 868, 871, 875, 878, 882, 885, 888, 892, 895, 898, 901, 906, 911, 915, 920, 924, 928, 933, 937, 941, 945, 946, 951, 955, 959, 963, 967, 971, 976, 980, 985, 989, 993, 998, 1002, 1006, 1010, 1016, 1022, 1027, 1033, 1038, 1043, 1049, 1054, 1059, 1064, 1067, 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1073, 1076, 1079, 1082, 1085, 1089, 1092, 1095, 1098, 1102, 1106, 1111, 1115, 1119, 1123, 1128, 1129, 1133, 1137, 1141, 1145, 1149, 1153, 1158, 1162, 1166, 1170, 1175, 1180, 1186, 1191, 1196, 1201, 1207, 1210, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1216, 1219, 1222, 1225, 1229, 1233, 1237, 1240, 1245, 1250, 1255, 1259, 1260, 1264, 1268, 1272, 1276, 1280, 1285, 1290, 1295, 1299, 1305, 1311, 1317, 1322, 1325, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1331, 1334, 1337, 1340, 1344, 1349, 1350, 1354, 1358, 1362, 1366, 1370, 1375, 1381, 1384, 1387, 1387, 1387, 1387, 1387, 1388, 1388, 1388, 1388, 1391, 1394, 1397, 1400, 1401, 1405, 1409, 1413, 1417, 1421, 1425, 1428, 1428, 1428, 1428, 1428, 1428, 1428, 1428, 1431, 1434, 1437, 1440, 1441, 1445, 1449, 1453, 1457, 1461, 1464, 1464, 1464, 1464, 1464, 1465, 1466, 1466, 1469, 1472, 1475, 1478, 1480, 1484, 1488, 1492, 1496, 1500, 1503, 1503, 1504, 1504, 1505, 1505, 1508, 1512, 1515, 1519, 1523, 1528, 1532, 1537, 1541, 1544, 1545, 1545, 1546, 1550, 1553, 1558, 1562, 1566, 1569, 1569, 1572, 1576, 1580, 1583, 1583, 1586, 1590, 1594, 1597, 1597, 1600, 1604, 1608, 1611, 1611, 1614, 1618, 1622, 1625, 1625, 1628, 1632, 1636, 1639, 1639, 1642, 1646, 1650, 1653, 1653, 1657, 1662, 1667, 1671, 1672, 1672 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 1, 1, 1, 7, 8, 9, 10, 1, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 16, 17, 18, 19, 1, 1, 20, 21, 22, 23, 24, 25, 26, 21, 27, 21, 21, 28, 29, 30, 31, 21, 21, 32, 33, 34, 35, 21, 21, 36, 21, 21, 37, 1, 38, 1, 39, 1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 21, 49, 50, 51, 52, 53, 54, 21, 55, 56, 57, 58, 59, 21, 60, 61, 21, 62, 63, 64, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[65] = { 0, 1, 2, 3, 1, 1, 1, 1, 4, 5, 1, 1, 6, 6, 7, 8, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9 } ; static yyconst flex_int16_t yy_base[551] = { 0, 0, 64, 126, 127, 133, 197, 148, 149, 261, 325, 152, 154, 166, 169, 389, 453, 143, 145, 1134, 2899, 177, 183, 2899, 1127, 178, 1116, 1089, 2899, 2899, 2899, 1084, 1063, 2899, 2899, 2899, 179, 215, 2899, 2899, 181, 235, 237, 295, 298, 307, 516, 518, 2899, 2899, 1064, 219, 279, 344, 525, 532, 539, 541, 548, 557, 582, 0, 2899, 1010, 2899, 2899, 2899, 2899, 1054, 2899, 238, 2899, 1053, 0, 2899, 2899, 0, 2899, 2899, 2899, 304, 590, 597, 604, 611, 623, 632, 676, 689, 697, 714, 0, 0, 0, 309, 705, 717, 780, 733, 796, 799, 813, 816, 879, 1047, 625, 249, 1052, 2899, 994, 988, 992, 981, 988, 971, 965, 1007, 2899, 2899, 996, 992, 2899, 236, 992, 281, 837, 357, 828, 881, 893, 895, 902, 909, 911, 918, 993, 2899, 273, 936, 943, 945, 957, 964, 966, 979, 981, 998, 1000, 0, 924, 954, 0, 519, 2899, 949, 0, 0, 0, 711, 0, 1014, 1017, 1080, 876, 657, 1018, 1032, 1039, 331, 1063, 767, 873, 140, 254, 334, 533, 658, 328, 205, 507, 527, 598, 948, 1097, 916, 247, 911, 898, 882, 893, 888, 910, 2899, 1082, 1099, 1116, 1123, 1125, 1137, 1150, 1062, 1153, 1162, 1165, 1174, 1177, 1186, 1193, 1202, 1217, 1231, 1234, 1247, 1263, 1276, 1279, 1288, 862, 1204, 1228, 1283, 1288, 1306, 1311, 1326, 1331, 1338, 1343, 1355, 1367, 1372, 1379, 1394, 591, 607, 498, 572, 664, 599, 686, 299, 475, 822, 2899, 1413, 1396, 850, 831, 831, 834, 815, 821, 801, 807, 1195, 1420, 1427, 1429, 1445, 1447, 1459, 1461, 1468, 1476, 1483, 1485, 1492, 1499, 1511, 1518, 1520, 1527, 1534, 1536, 1550, 1559, 1566, 1575, 802, 1442, 1531, 1570, 1562, 1586, 1600, 1605, 1612, 1617, 1624, 1631, 1636, 1643, 1650, 1664, 526, 538, 615, 621, 766, 707, 622, 938, 715, 949, 1677, 1690, 798, 798, 767, 765, 755, 770, 749, 758, 1703, 1705, 1717, 1720, 1733, 1736, 1748, 1750, 1762, 1770, 1777, 1779, 1786, 1793, 1801, 1815, 750, 1811, 1829, 1837, 1849, 1854, 1861, 1869, 1875, 1887, 1892, 1904, 755, 683, 984, 1170, 995, 735, 1928, 1936, 745, 712, 713, 716, 707, 692, 688, 698, 1888, 1943, 1835, 1945, 1952, 1964, 1967, 1976, 1979, 1988, 1991, 2000, 682, 1999, 1987, 2011, 2023, 2031, 2039, 2045, 2051, 2057, 783, 784, 806, 1066, 2074, 2081, 670, 663, 661, 643, 648, 630, 598, 601, 2083, 2090, 2102, 2110, 2117, 2119, 585, 2117, 2124, 2129, 2144, 2149, 2156, 821, 2173, 2182, 578, 561, 558, 549, 2899, 549, 558, 553, 2185, 2194, 2201, 2217, 530, 2200, 2212, 2227, 2232, 2239, 2229, 2262, 515, 505, 505, 499, 475, 462, 315, 2269, 2271, 2284, 2286, 315, 2280, 2294, 2299, 2306, 2318, 2335, 270, 269, 253, 252, 2899, 2899, 240, 2342, 2344, 2351, 2359, 0, 2353, 2367, 2379, 2385, 2393, 2366, 200, 2899, 196, 2899, 181, 2417, 2419, 2426, 2433, 2420, 2427, 2441, 2446, 2458, 2475, 2899, 186, 2899, 2484, 2487, 2482, 2488, 2504, 2505, 168, 2517, 2516, 2528, 2551, 164, 2554, 2549, 2563, 2582, 119, 2589, 2584, 2589, 2608, 125, 2616, 2603, 2611, 2640, 111, 2643, 2638, 2645, 2662, 107, 2677, 2671, 2676, 2695, 75, 2709, 2703, 2708, 2727, 2899, 2899, 2741, 2750, 2759, 2768, 2777, 2786, 2795, 2799, 2806, 2814, 2818, 2825, 2833, 2837, 2840, 2848, 2857, 2861, 2869, 2871, 2875, 2883, 2887, 2890 } ; static yyconst flex_int16_t yy_def[551] = { 0, 526, 526, 527, 527, 528, 528, 6, 6, 529, 529, 530, 530, 531, 531, 526, 526, 1, 2, 526, 526, 526, 526, 526, 532, 526, 533, 526, 526, 526, 526, 534, 526, 526, 526, 526, 535, 535, 526, 526, 535, 535, 535, 535, 535, 535, 535, 535, 526, 526, 536, 537, 538, 538, 538, 538, 538, 538, 538, 538, 538, 539, 526, 539, 526, 526, 526, 526, 540, 526, 526, 526, 541, 542, 526, 526, 543, 526, 526, 526, 544, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 546, 546, 546, 547, 548, 548, 548, 548, 548, 548, 548, 548, 548, 526, 535, 526, 532, 526, 526, 526, 526, 526, 526, 526, 526, 533, 526, 526, 534, 526, 526, 526, 526, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 536, 526, 537, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 539, 539, 540, 549, 526, 526, 541, 550, 542, 543, 544, 546, 545, 545, 545, 162, 162, 162, 162, 162, 162, 162, 162, 547, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 526, 535, 526, 526, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 539, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 526, 535, 535, 526, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 539, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 535, 535, 526, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, 538, 538, 538, 538, 538, 538, 539, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 103, 103, 103, 103, 103, 103, 535, 535, 526, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 535, 535, 535, 535, 538, 538, 538, 538, 539, 162, 162, 162, 162, 162, 162, 162, 162, 162, 103, 103, 103, 103, 535, 535, 526, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 535, 538, 539, 162, 162, 162, 162, 162, 162, 103, 535, 535, 526, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 539, 162, 162, 162, 162, 162, 535, 535, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 539, 162, 162, 162, 162, 162, 535, 526, 526, 526, 526, 526, 526, 526, 535, 535, 535, 535, 539, 162, 162, 162, 162, 162, 535, 526, 526, 526, 526, 526, 535, 535, 535, 535, 162, 162, 162, 162, 162, 535, 526, 526, 526, 535, 535, 162, 162, 162, 535, 526, 535, 162, 162, 535, 526, 535, 162, 162, 535, 526, 535, 162, 162, 535, 526, 535, 162, 162, 535, 526, 535, 162, 162, 535, 526, 535, 162, 162, 535, 526, 535, 162, 162, 535, 526, 0, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526 } ; static yyconst flex_int16_t yy_nxt[2964] = { 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 20, 32, 31, 20, 33, 34, 35, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 37, 36, 36, 36, 36, 36, 36, 38, 39, 40, 36, 36, 41, 42, 36, 43, 36, 36, 44, 36, 45, 36, 36, 36, 36, 36, 46, 36, 47, 36, 36, 36, 48, 20, 49, 20, 21, 22, 23, 50, 25, 26, 27, 28, 29, 30, 31, 20, 32, 51, 20, 33, 34, 35, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 52, 52, 52, 52, 52, 52, 38, 39, 40, 52, 52, 54, 55, 52, 56, 52, 52, 57, 52, 58, 52, 52, 52, 52, 52, 59, 52, 60, 52, 52, 52, 48, 20, 49, 62, 64, 525, 63, 63, 62, 62, 62, 62, 65, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 66, 62, 67, 69, 69, 62, 104, 62, 104, 520, 74, 75, 74, 75, 515, 62, 62, 62, 62, 77, 62, 62, 77, 510, 78, 79, 505, 78, 79, 106, 106, 122, 105, 122, 105, 106, 106, 123, 172, 123, 172, 119, 120, 119, 120, 62, 62, 62, 62, 62, 62, 62, 65, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 66, 62, 67, 122, 500, 109, 126, 495, 110, 123, 111, 490, 112, 119, 120, 113, 114, 119, 120, 483, 62, 62, 115, 122, 122, 122, 152, 152, 482, 123, 123, 123, 125, 119, 120, 119, 120, 106, 106, 172, 153, 172, 481, 239, 119, 62, 62, 62, 62, 70, 70, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 71, 62, 62, 62, 122, 127, 122, 233, 119, 120, 123, 470, 123, 128, 119, 120, 119, 120, 247, 469, 122, 62, 62, 122, 248, 172, 123, 172, 468, 123, 119, 120, 122, 119, 120, 119, 467, 466, 123, 119, 120, 124, 119, 120, 119, 120, 62, 62, 62, 62, 70, 70, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 71, 62, 62, 62, 129, 122, 301, 158, 172, 130, 160, 123, 160, 160, 160, 119, 120, 459, 122, 131, 454, 62, 62, 160, 123, 159, 159, 159, 119, 120, 159, 159, 159, 234, 139, 172, 194, 172, 195, 196, 197, 172, 124, 172, 238, 230, 62, 62, 62, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 20, 32, 80, 20, 33, 34, 35, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 81, 81, 81, 81, 81, 81, 38, 39, 83, 81, 81, 84, 85, 81, 86, 81, 81, 87, 81, 88, 81, 81, 81, 81, 81, 89, 81, 90, 81, 81, 81, 91, 92, 93, 20, 21, 22, 23, 50, 25, 26, 27, 28, 29, 30, 31, 20, 32, 94, 20, 33, 34, 35, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 95, 95, 95, 95, 95, 95, 38, 39, 83, 95, 95, 97, 98, 95, 99, 95, 95, 100, 95, 101, 95, 95, 95, 95, 95, 102, 95, 103, 95, 95, 95, 91, 92, 93, 122, 453, 122, 152, 152, 172, 123, 172, 123, 122, 119, 120, 119, 120, 302, 123, 122, 153, 452, 119, 120, 296, 123, 122, 451, 122, 119, 120, 172, 123, 172, 123, 122, 119, 120, 119, 120, 172, 123, 172, 450, 122, 119, 120, 240, 449, 124, 123, 133, 448, 134, 119, 120, 124, 140, 132, 172, 172, 172, 172, 124, 241, 124, 172, 441, 172, 122, 141, 172, 124, 172, 142, 123, 235, 122, 143, 119, 120, 124, 436, 123, 122, 435, 144, 119, 120, 434, 123, 122, 433, 432, 119, 120, 431, 123, 122, 145, 294, 119, 120, 297, 123, 172, 124, 172, 119, 120, 122, 430, 122, 161, 422, 146, 123, 147, 123, 122, 119, 120, 119, 120, 172, 123, 172, 417, 162, 119, 120, 172, 172, 172, 172, 299, 242, 159, 159, 159, 172, 416, 172, 163, 159, 159, 159, 295, 172, 183, 342, 159, 159, 159, 172, 172, 172, 172, 159, 159, 159, 164, 160, 122, 160, 160, 160, 165, 415, 123, 159, 159, 159, 119, 120, 160, 122, 414, 413, 159, 159, 159, 123, 236, 122, 412, 119, 120, 411, 298, 123, 172, 122, 172, 119, 120, 237, 172, 123, 172, 225, 122, 119, 120, 122, 410, 400, 123, 119, 120, 123, 119, 120, 166, 119, 120, 172, 300, 172, 172, 122, 172, 393, 159, 159, 159, 123, 167, 392, 160, 119, 120, 344, 173, 391, 390, 159, 159, 159, 168, 172, 160, 172, 389, 159, 159, 159, 169, 172, 170, 172, 346, 159, 159, 159, 388, 387, 160, 159, 159, 159, 159, 159, 159, 159, 159, 159, 122, 172, 386, 172, 175, 160, 123, 160, 160, 160, 119, 120, 370, 159, 159, 159, 122, 380, 160, 122, 357, 172, 123, 172, 356, 123, 119, 120, 355, 119, 120, 354, 172, 122, 172, 353, 122, 160, 232, 123, 352, 343, 123, 119, 120, 174, 119, 120, 122, 172, 172, 172, 172, 160, 123, 351, 160, 122, 119, 120, 159, 159, 159, 123, 176, 350, 330, 119, 120, 177, 160, 313, 172, 160, 172, 312, 159, 159, 159, 159, 159, 159, 311, 310, 178, 193, 198, 172, 172, 172, 172, 179, 303, 159, 159, 159, 159, 159, 159, 122, 309, 122, 308, 119, 120, 123, 307, 123, 306, 119, 120, 119, 120, 122, 160, 122, 160, 160, 160, 123, 278, 123, 122, 119, 120, 119, 120, 160, 123, 122, 158, 122, 119, 120, 224, 123, 160, 123, 122, 119, 120, 119, 120, 191, 123, 180, 253, 181, 119, 120, 252, 200, 251, 159, 159, 159, 122, 199, 250, 159, 159, 159, 123, 122, 201, 122, 119, 120, 249, 123, 202, 123, 203, 119, 120, 119, 120, 122, 246, 243, 155, 205, 204, 123, 122, 151, 122, 119, 120, 206, 123, 207, 123, 124, 119, 120, 119, 120, 217, 122, 124, 122, 124, 208, 172, 123, 172, 123, 345, 119, 120, 119, 120, 347, 124, 172, 136, 172, 122, 192, 122, 124, 210, 124, 123, 191, 123, 120, 119, 120, 119, 120, 117, 209, 122, 211, 124, 122, 124, 190, 123, 212, 189, 123, 119, 120, 188, 119, 120, 213, 172, 187, 172, 383, 214, 124, 160, 124, 160, 160, 160, 172, 381, 172, 186, 218, 185, 184, 215, 160, 160, 216, 160, 160, 160, 108, 226, 160, 182, 160, 160, 160, 122, 160, 155, 151, 149, 136, 123, 227, 160, 121, 119, 120, 159, 159, 159, 159, 159, 159, 122, 160, 122, 160, 160, 160, 123, 228, 123, 229, 119, 120, 119, 120, 160, 120, 118, 122, 219, 122, 220, 221, 222, 123, 254, 123, 261, 119, 120, 119, 120, 223, 172, 231, 172, 194, 122, 244, 196, 197, 255, 117, 123, 122, 407, 122, 119, 120, 245, 123, 108, 123, 526, 119, 120, 119, 120, 122, 526, 526, 159, 159, 159, 123, 526, 256, 526, 119, 120, 526, 122, 526, 257, 122, 526, 258, 123, 526, 526, 123, 119, 120, 122, 119, 120, 122, 526, 526, 123, 526, 526, 123, 119, 120, 122, 119, 120, 122, 526, 526, 123, 526, 526, 123, 119, 120, 122, 119, 120, 260, 259, 262, 123, 122, 526, 122, 119, 120, 526, 123, 526, 123, 122, 119, 120, 119, 120, 526, 123, 264, 526, 263, 119, 120, 382, 268, 172, 122, 172, 526, 265, 526, 160, 123, 160, 160, 279, 119, 120, 526, 124, 122, 266, 526, 122, 160, 267, 123, 526, 124, 123, 119, 120, 526, 119, 120, 160, 122, 160, 280, 160, 526, 526, 123, 124, 269, 270, 119, 120, 160, 526, 526, 526, 122, 526, 526, 526, 526, 124, 123, 526, 124, 272, 119, 120, 271, 122, 526, 526, 122, 526, 526, 123, 526, 124, 123, 119, 120, 122, 119, 120, 526, 526, 526, 123, 526, 273, 526, 119, 120, 124, 160, 526, 160, 160, 160, 160, 274, 160, 160, 160, 526, 281, 124, 160, 526, 124, 282, 526, 160, 526, 526, 275, 526, 160, 124, 160, 160, 160, 160, 526, 160, 160, 160, 276, 526, 283, 160, 277, 526, 526, 526, 160, 284, 160, 526, 160, 160, 160, 160, 526, 160, 160, 160, 526, 526, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 526, 526, 526, 160, 286, 526, 526, 160, 160, 160, 160, 160, 526, 285, 526, 288, 287, 526, 526, 160, 160, 160, 160, 160, 160, 526, 160, 160, 160, 526, 122, 160, 160, 160, 160, 160, 123, 160, 289, 526, 119, 120, 526, 526, 160, 290, 160, 122, 160, 160, 160, 526, 291, 123, 122, 526, 526, 119, 120, 160, 123, 122, 305, 122, 119, 120, 526, 123, 292, 123, 526, 119, 120, 119, 120, 314, 304, 526, 293, 122, 526, 122, 526, 526, 526, 123, 526, 123, 315, 119, 120, 119, 120, 122, 160, 122, 160, 160, 160, 123, 316, 123, 122, 119, 120, 119, 120, 160, 123, 317, 122, 526, 119, 120, 526, 526, 123, 122, 526, 122, 119, 120, 526, 123, 526, 123, 122, 119, 120, 119, 120, 526, 123, 122, 526, 526, 119, 120, 526, 123, 526, 318, 526, 119, 120, 122, 526, 526, 320, 526, 526, 123, 122, 526, 122, 119, 120, 319, 123, 526, 123, 122, 119, 120, 119, 120, 526, 123, 122, 321, 122, 119, 120, 526, 123, 322, 123, 323, 119, 120, 119, 120, 124, 160, 122, 160, 331, 160, 526, 124, 123, 124, 526, 122, 119, 120, 160, 526, 124, 123, 122, 526, 324, 119, 120, 124, 123, 124, 326, 122, 119, 120, 526, 526, 160, 123, 160, 160, 160, 119, 120, 124, 160, 325, 160, 160, 160, 160, 526, 526, 124, 332, 526, 333, 526, 160, 526, 124, 160, 526, 160, 160, 160, 327, 526, 526, 124, 526, 526, 328, 334, 160, 160, 329, 160, 160, 160, 160, 526, 160, 160, 160, 526, 335, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 526, 526, 160, 160, 160, 160, 160, 526, 160, 160, 526, 160, 160, 160, 160, 160, 160, 160, 160, 526, 336, 160, 160, 160, 160, 160, 526, 160, 160, 338, 160, 160, 160, 526, 160, 526, 526, 122, 526, 337, 526, 160, 160, 123, 160, 160, 160, 119, 120, 526, 122, 526, 526, 339, 526, 160, 123, 526, 348, 340, 119, 120, 526, 122, 315, 122, 526, 526, 341, 123, 526, 123, 526, 119, 120, 119, 120, 122, 526, 349, 122, 526, 526, 123, 526, 526, 123, 119, 120, 526, 119, 120, 359, 122, 526, 526, 122, 526, 526, 123, 358, 526, 123, 119, 120, 360, 119, 120, 122, 526, 122, 526, 526, 526, 123, 526, 123, 361, 119, 120, 119, 120, 122, 526, 526, 526, 526, 526, 123, 526, 122, 526, 119, 120, 526, 362, 123, 122, 526, 122, 119, 120, 526, 123, 526, 123, 122, 119, 120, 119, 120, 526, 123, 122, 364, 526, 119, 120, 526, 123, 365, 122, 526, 119, 120, 526, 363, 123, 526, 526, 526, 119, 120, 526, 124, 122, 124, 526, 526, 366, 526, 123, 526, 124, 526, 119, 120, 526, 526, 160, 124, 160, 160, 160, 526, 122, 526, 368, 124, 369, 526, 123, 160, 526, 367, 119, 120, 160, 371, 160, 160, 160, 124, 526, 526, 160, 372, 160, 160, 160, 160, 526, 526, 526, 396, 373, 526, 160, 160, 160, 160, 160, 160, 526, 160, 160, 160, 526, 526, 160, 160, 160, 160, 160, 375, 160, 374, 160, 122, 160, 160, 160, 160, 160, 123, 160, 160, 160, 119, 120, 160, 526, 526, 376, 526, 160, 160, 160, 160, 160, 160, 394, 160, 160, 160, 526, 526, 526, 160, 526, 526, 526, 160, 160, 160, 160, 160, 526, 122, 526, 379, 378, 526, 377, 123, 160, 122, 526, 119, 120, 526, 526, 123, 122, 526, 122, 119, 120, 526, 123, 384, 123, 122, 119, 120, 119, 120, 526, 123, 526, 526, 526, 119, 120, 122, 395, 385, 122, 526, 526, 123, 526, 397, 123, 119, 120, 122, 119, 120, 122, 526, 526, 123, 526, 526, 123, 119, 120, 122, 119, 120, 122, 526, 526, 123, 526, 526, 123, 119, 120, 122, 119, 120, 526, 526, 160, 123, 160, 160, 402, 119, 120, 526, 526, 526, 526, 124, 160, 160, 160, 160, 160, 401, 526, 526, 124, 526, 526, 124, 160, 160, 160, 160, 160, 398, 526, 526, 124, 526, 526, 403, 160, 160, 160, 160, 160, 526, 526, 526, 160, 404, 160, 160, 405, 160, 526, 526, 160, 399, 160, 160, 160, 160, 160, 526, 160, 160, 160, 526, 160, 160, 160, 160, 160, 122, 160, 160, 160, 160, 160, 123, 122, 160, 122, 119, 120, 526, 123, 160, 123, 122, 119, 120, 119, 120, 526, 123, 526, 526, 526, 119, 120, 122, 409, 526, 526, 526, 526, 123, 418, 122, 408, 119, 120, 526, 406, 123, 122, 419, 122, 119, 120, 526, 123, 526, 123, 526, 119, 120, 119, 120, 526, 526, 526, 420, 160, 526, 160, 160, 160, 526, 421, 160, 423, 160, 160, 160, 160, 160, 160, 160, 160, 424, 526, 526, 160, 124, 526, 526, 526, 160, 425, 160, 526, 160, 160, 160, 160, 526, 160, 160, 160, 526, 122, 160, 426, 160, 160, 160, 123, 160, 526, 122, 119, 120, 122, 427, 160, 123, 526, 526, 123, 119, 120, 122, 119, 120, 526, 526, 526, 123, 122, 526, 437, 119, 120, 526, 123, 526, 526, 428, 119, 120, 526, 526, 526, 526, 122, 442, 429, 160, 160, 160, 123, 526, 526, 438, 119, 120, 122, 160, 160, 160, 160, 160, 123, 526, 526, 439, 119, 120, 440, 526, 160, 443, 160, 526, 160, 160, 160, 160, 526, 160, 160, 160, 526, 445, 160, 160, 160, 160, 160, 122, 160, 444, 446, 526, 526, 123, 122, 160, 122, 119, 120, 526, 123, 526, 123, 526, 119, 120, 119, 120, 526, 122, 526, 122, 526, 447, 526, 123, 526, 123, 455, 119, 120, 119, 120, 160, 526, 160, 160, 160, 526, 460, 457, 526, 526, 456, 526, 526, 160, 160, 526, 160, 160, 160, 160, 526, 160, 462, 160, 526, 458, 160, 160, 160, 160, 160, 526, 160, 461, 526, 526, 526, 122, 160, 160, 160, 160, 160, 123, 122, 463, 122, 119, 120, 464, 123, 160, 123, 122, 119, 120, 119, 120, 526, 123, 526, 122, 526, 119, 120, 526, 465, 123, 122, 526, 526, 119, 120, 160, 123, 160, 160, 160, 119, 120, 526, 471, 473, 472, 526, 526, 160, 160, 526, 160, 160, 160, 475, 526, 526, 526, 480, 526, 474, 160, 160, 160, 160, 160, 526, 160, 476, 160, 160, 160, 477, 526, 160, 160, 526, 160, 160, 160, 160, 122, 526, 122, 526, 479, 478, 123, 160, 123, 122, 119, 120, 119, 120, 526, 123, 122, 526, 526, 119, 120, 160, 123, 160, 160, 160, 119, 120, 160, 485, 160, 160, 160, 526, 160, 526, 526, 484, 526, 526, 486, 160, 160, 526, 487, 160, 160, 160, 526, 160, 160, 160, 526, 526, 526, 160, 526, 526, 122, 160, 160, 160, 160, 160, 123, 488, 526, 122, 119, 120, 122, 526, 160, 123, 526, 526, 123, 119, 120, 526, 119, 120, 489, 160, 526, 160, 160, 160, 122, 160, 526, 160, 160, 160, 123, 526, 160, 526, 119, 120, 122, 526, 160, 491, 492, 160, 123, 160, 160, 160, 119, 120, 493, 494, 526, 526, 526, 160, 160, 160, 160, 160, 526, 526, 526, 526, 497, 496, 526, 160, 160, 160, 160, 160, 122, 526, 526, 122, 526, 498, 123, 526, 160, 123, 119, 120, 526, 119, 120, 526, 160, 526, 160, 160, 502, 526, 526, 526, 526, 501, 526, 526, 499, 160, 160, 122, 160, 503, 160, 526, 526, 123, 122, 526, 526, 119, 120, 160, 123, 526, 526, 526, 119, 120, 526, 160, 504, 160, 160, 160, 160, 122, 160, 160, 508, 507, 526, 123, 160, 122, 506, 119, 120, 160, 160, 123, 160, 160, 160, 119, 120, 526, 160, 509, 160, 160, 160, 160, 512, 526, 526, 526, 526, 122, 526, 160, 122, 526, 513, 123, 526, 511, 123, 119, 120, 526, 119, 120, 526, 160, 526, 160, 160, 160, 526, 122, 160, 526, 160, 160, 160, 123, 160, 526, 526, 119, 120, 514, 517, 160, 122, 526, 526, 516, 526, 518, 123, 526, 526, 526, 119, 120, 160, 526, 160, 160, 160, 160, 122, 160, 160, 160, 519, 526, 123, 160, 526, 526, 119, 120, 160, 522, 122, 526, 526, 526, 523, 521, 123, 526, 526, 526, 119, 120, 160, 526, 160, 160, 160, 160, 122, 160, 160, 160, 526, 524, 123, 160, 526, 526, 119, 120, 160, 61, 61, 61, 61, 61, 61, 61, 61, 61, 68, 68, 68, 68, 68, 68, 68, 68, 68, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 76, 76, 76, 76, 76, 76, 76, 76, 76, 107, 107, 107, 107, 107, 107, 107, 107, 107, 116, 116, 526, 116, 116, 116, 116, 116, 116, 119, 526, 119, 124, 526, 124, 526, 124, 526, 124, 135, 135, 135, 135, 135, 135, 135, 135, 135, 137, 526, 137, 138, 526, 138, 526, 138, 526, 138, 148, 148, 526, 148, 148, 148, 148, 148, 148, 150, 150, 150, 154, 154, 154, 156, 156, 526, 526, 526, 156, 156, 156, 156, 157, 157, 526, 526, 526, 157, 157, 157, 157, 158, 526, 158, 158, 160, 526, 160, 526, 160, 526, 160, 160, 159, 159, 171, 526, 171, 171, 172, 526, 172, 526, 172, 526, 172, 172, 151, 151, 151, 155, 155, 155, 19, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526 } ; static yyconst flex_int16_t yy_chk[2964] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 520, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 8, 11, 17, 12, 18, 515, 11, 11, 12, 12, 510, 7, 8, 7, 8, 13, 5, 5, 14, 505, 13, 13, 500, 14, 14, 21, 21, 36, 17, 40, 18, 22, 22, 36, 172, 40, 172, 36, 36, 40, 40, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 37, 495, 25, 40, 490, 25, 37, 25, 482, 25, 37, 37, 25, 25, 51, 51, 470, 6, 6, 25, 41, 122, 42, 70, 70, 468, 41, 122, 42, 37, 41, 41, 42, 42, 106, 106, 178, 70, 178, 466, 178, 51, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 52, 41, 124, 173, 137, 137, 52, 454, 124, 42, 52, 52, 124, 124, 185, 451, 43, 9, 9, 44, 185, 173, 43, 173, 450, 44, 43, 43, 45, 44, 44, 137, 449, 448, 45, 80, 80, 52, 45, 45, 94, 94, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 43, 53, 240, 94, 240, 44, 168, 53, 168, 168, 168, 53, 53, 441, 126, 45, 436, 10, 10, 168, 126, 80, 80, 80, 126, 126, 94, 94, 94, 174, 53, 177, 126, 177, 126, 126, 126, 174, 53, 174, 177, 168, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 46, 435, 47, 152, 152, 241, 46, 241, 47, 54, 46, 46, 47, 47, 241, 54, 55, 152, 434, 54, 54, 235, 55, 56, 433, 57, 55, 55, 235, 56, 235, 57, 58, 56, 56, 57, 57, 179, 58, 179, 432, 59, 58, 58, 179, 431, 54, 59, 47, 430, 47, 59, 59, 55, 54, 46, 294, 180, 294, 180, 56, 180, 57, 175, 422, 175, 60, 55, 295, 58, 295, 56, 60, 175, 81, 57, 60, 60, 59, 417, 81, 82, 416, 58, 81, 81, 415, 82, 83, 413, 412, 82, 82, 411, 83, 84, 59, 233, 83, 83, 236, 84, 236, 60, 236, 84, 84, 85, 410, 105, 82, 400, 60, 85, 60, 105, 86, 85, 85, 105, 105, 233, 86, 233, 393, 83, 86, 86, 181, 238, 181, 238, 238, 181, 81, 81, 81, 234, 392, 234, 84, 82, 82, 82, 234, 296, 105, 296, 83, 83, 83, 297, 300, 297, 300, 84, 84, 84, 85, 164, 87, 164, 164, 164, 86, 391, 87, 85, 85, 85, 87, 87, 164, 88, 390, 389, 86, 86, 86, 88, 176, 89, 388, 88, 88, 387, 237, 89, 176, 95, 176, 89, 89, 176, 237, 95, 237, 164, 90, 95, 95, 96, 386, 370, 90, 158, 158, 96, 90, 90, 87, 96, 96, 343, 239, 343, 239, 98, 239, 357, 87, 87, 87, 98, 88, 356, 95, 98, 98, 299, 96, 355, 354, 88, 88, 88, 89, 299, 96, 299, 353, 89, 89, 89, 90, 302, 90, 302, 302, 95, 95, 95, 352, 351, 98, 158, 158, 158, 90, 90, 90, 96, 96, 96, 97, 347, 350, 347, 98, 170, 97, 170, 170, 170, 97, 97, 330, 98, 98, 98, 99, 342, 170, 100, 313, 342, 99, 342, 312, 100, 99, 99, 311, 100, 100, 310, 298, 101, 298, 309, 102, 97, 170, 101, 308, 298, 102, 101, 101, 97, 102, 102, 127, 380, 381, 380, 381, 99, 127, 307, 100, 125, 127, 127, 97, 97, 97, 125, 99, 306, 278, 125, 125, 100, 101, 253, 382, 102, 382, 252, 99, 99, 99, 100, 100, 100, 251, 250, 101, 125, 127, 407, 242, 407, 242, 102, 242, 101, 101, 101, 102, 102, 102, 103, 249, 128, 248, 171, 171, 103, 247, 128, 246, 103, 103, 128, 128, 129, 163, 130, 163, 163, 163, 129, 217, 130, 131, 129, 129, 130, 130, 163, 131, 132, 171, 133, 131, 131, 163, 132, 103, 133, 134, 132, 132, 133, 133, 191, 134, 103, 190, 103, 134, 134, 189, 129, 188, 171, 171, 171, 138, 128, 187, 103, 103, 103, 138, 139, 129, 140, 138, 138, 186, 139, 130, 140, 131, 139, 139, 140, 140, 141, 184, 182, 154, 133, 132, 141, 142, 150, 143, 141, 141, 134, 142, 139, 143, 138, 142, 142, 143, 143, 149, 144, 139, 145, 140, 140, 301, 144, 301, 145, 301, 144, 144, 145, 145, 303, 141, 303, 135, 303, 146, 123, 147, 142, 142, 143, 146, 120, 147, 119, 146, 146, 147, 147, 116, 141, 160, 142, 144, 161, 145, 115, 160, 143, 114, 161, 160, 160, 113, 161, 161, 144, 344, 112, 344, 346, 145, 146, 165, 147, 165, 165, 165, 346, 344, 346, 111, 161, 110, 109, 146, 165, 166, 147, 166, 166, 166, 107, 165, 167, 104, 167, 167, 167, 200, 166, 72, 68, 63, 50, 200, 165, 167, 32, 200, 200, 160, 160, 160, 161, 161, 161, 162, 169, 193, 169, 169, 169, 162, 166, 193, 167, 162, 162, 193, 193, 169, 31, 27, 183, 162, 194, 162, 162, 162, 183, 193, 194, 200, 183, 183, 194, 194, 162, 383, 169, 383, 183, 195, 183, 183, 183, 194, 26, 195, 196, 383, 197, 195, 195, 183, 196, 24, 197, 19, 196, 196, 197, 197, 198, 0, 0, 162, 162, 162, 198, 0, 195, 0, 198, 198, 0, 199, 0, 196, 201, 0, 197, 199, 0, 0, 201, 199, 199, 202, 201, 201, 203, 0, 0, 202, 0, 0, 203, 202, 202, 204, 203, 203, 205, 0, 0, 204, 0, 0, 205, 204, 204, 206, 205, 205, 199, 198, 201, 206, 207, 0, 254, 206, 206, 0, 207, 0, 254, 208, 207, 207, 254, 254, 0, 208, 203, 0, 202, 208, 208, 345, 207, 345, 209, 345, 0, 204, 0, 218, 209, 218, 218, 218, 209, 209, 0, 207, 210, 205, 0, 211, 218, 206, 210, 0, 208, 211, 210, 210, 0, 211, 211, 219, 212, 219, 219, 219, 0, 0, 212, 209, 208, 209, 212, 212, 219, 0, 0, 0, 213, 0, 0, 0, 0, 210, 213, 0, 211, 211, 213, 213, 210, 214, 0, 0, 215, 0, 0, 214, 0, 212, 215, 214, 214, 216, 215, 215, 0, 0, 0, 216, 0, 212, 0, 216, 216, 213, 220, 0, 220, 220, 220, 221, 213, 221, 221, 221, 0, 220, 214, 220, 0, 215, 221, 0, 221, 0, 0, 214, 0, 222, 216, 222, 222, 222, 223, 0, 223, 223, 223, 215, 0, 222, 222, 216, 0, 0, 0, 223, 223, 224, 0, 224, 224, 224, 225, 0, 225, 225, 225, 0, 0, 226, 224, 226, 226, 226, 227, 225, 227, 227, 227, 0, 0, 0, 226, 225, 0, 0, 228, 227, 228, 228, 228, 0, 224, 0, 227, 226, 0, 0, 229, 228, 229, 229, 229, 230, 0, 230, 230, 230, 0, 245, 231, 229, 231, 231, 231, 245, 230, 228, 0, 245, 245, 0, 0, 231, 229, 232, 244, 232, 232, 232, 0, 230, 244, 255, 0, 0, 244, 244, 232, 255, 256, 245, 257, 255, 255, 0, 256, 231, 257, 0, 256, 256, 257, 257, 255, 244, 0, 232, 258, 0, 259, 0, 0, 0, 258, 0, 259, 256, 258, 258, 259, 259, 260, 279, 261, 279, 279, 279, 260, 257, 261, 262, 260, 260, 261, 261, 279, 262, 258, 263, 0, 262, 262, 0, 0, 263, 264, 0, 265, 263, 263, 0, 264, 0, 265, 266, 264, 264, 265, 265, 0, 266, 267, 0, 0, 266, 266, 0, 267, 0, 260, 0, 267, 267, 268, 0, 0, 263, 0, 0, 268, 269, 0, 270, 268, 268, 262, 269, 0, 270, 271, 269, 269, 270, 270, 0, 271, 272, 265, 273, 271, 271, 0, 272, 266, 273, 267, 272, 272, 273, 273, 268, 280, 274, 280, 280, 280, 0, 269, 274, 270, 0, 275, 274, 274, 280, 0, 271, 275, 276, 0, 270, 275, 275, 272, 276, 273, 273, 277, 276, 276, 0, 0, 282, 277, 282, 282, 282, 277, 277, 274, 281, 272, 281, 281, 281, 282, 0, 0, 275, 281, 0, 282, 0, 281, 0, 276, 283, 0, 283, 283, 283, 275, 0, 0, 277, 0, 0, 276, 283, 283, 284, 277, 284, 284, 284, 285, 0, 285, 285, 285, 0, 284, 286, 284, 286, 286, 286, 287, 285, 287, 287, 287, 0, 0, 288, 286, 288, 288, 288, 0, 287, 289, 0, 289, 289, 289, 290, 288, 290, 290, 290, 0, 286, 291, 289, 291, 291, 291, 0, 290, 292, 289, 292, 292, 292, 0, 291, 0, 0, 304, 0, 288, 0, 292, 293, 304, 293, 293, 293, 304, 304, 0, 305, 0, 0, 291, 0, 293, 305, 0, 304, 292, 305, 305, 0, 314, 304, 315, 0, 0, 293, 314, 0, 315, 0, 314, 314, 315, 315, 316, 0, 305, 317, 0, 0, 316, 0, 0, 317, 316, 316, 0, 317, 317, 315, 318, 0, 0, 319, 0, 0, 318, 314, 0, 319, 318, 318, 316, 319, 319, 320, 0, 321, 0, 0, 0, 320, 0, 321, 317, 320, 320, 321, 321, 322, 0, 0, 0, 0, 0, 322, 0, 323, 0, 322, 322, 0, 318, 323, 324, 0, 325, 323, 323, 0, 324, 0, 325, 326, 324, 324, 325, 325, 0, 326, 327, 321, 0, 326, 326, 0, 327, 322, 328, 0, 327, 327, 0, 320, 328, 0, 0, 0, 328, 328, 0, 324, 329, 325, 0, 0, 324, 0, 329, 0, 326, 0, 329, 329, 0, 0, 331, 327, 331, 331, 331, 0, 360, 0, 327, 328, 328, 0, 360, 331, 0, 326, 360, 360, 332, 331, 332, 332, 332, 329, 0, 0, 333, 332, 333, 333, 333, 332, 0, 0, 0, 360, 333, 0, 334, 333, 334, 334, 334, 335, 0, 335, 335, 335, 0, 0, 336, 334, 336, 336, 336, 335, 335, 334, 337, 358, 337, 337, 337, 336, 338, 358, 338, 338, 338, 358, 358, 337, 0, 0, 336, 0, 339, 338, 339, 339, 339, 340, 358, 340, 340, 340, 0, 0, 0, 339, 0, 0, 0, 341, 340, 341, 341, 341, 0, 348, 0, 340, 339, 0, 338, 348, 341, 349, 0, 348, 348, 0, 0, 349, 359, 0, 361, 349, 349, 0, 359, 348, 361, 362, 359, 359, 361, 361, 0, 362, 0, 0, 0, 362, 362, 363, 359, 349, 364, 0, 0, 363, 0, 361, 364, 363, 363, 365, 364, 364, 366, 0, 0, 365, 0, 0, 366, 365, 365, 367, 366, 366, 368, 0, 0, 367, 0, 0, 368, 367, 367, 369, 368, 368, 0, 0, 372, 369, 372, 372, 372, 369, 369, 0, 0, 0, 0, 366, 371, 372, 371, 371, 371, 371, 0, 0, 367, 0, 0, 368, 373, 371, 373, 373, 373, 365, 0, 0, 369, 0, 0, 373, 374, 373, 374, 374, 374, 0, 0, 0, 375, 374, 375, 375, 375, 374, 0, 0, 376, 369, 376, 376, 376, 375, 377, 0, 377, 377, 377, 0, 378, 376, 378, 378, 378, 384, 379, 377, 379, 379, 379, 384, 385, 378, 394, 384, 384, 0, 385, 379, 394, 395, 385, 385, 394, 394, 0, 395, 0, 0, 0, 395, 395, 396, 385, 0, 0, 0, 0, 396, 394, 397, 384, 396, 396, 0, 379, 397, 398, 395, 399, 397, 397, 0, 398, 0, 399, 0, 398, 398, 399, 399, 0, 0, 0, 396, 401, 0, 401, 401, 401, 0, 397, 402, 401, 402, 402, 402, 403, 401, 403, 403, 403, 402, 0, 0, 402, 399, 0, 0, 0, 403, 403, 404, 0, 404, 404, 404, 405, 0, 405, 405, 405, 0, 408, 406, 404, 406, 406, 406, 408, 405, 0, 409, 408, 408, 418, 405, 406, 409, 0, 0, 418, 409, 409, 419, 418, 418, 0, 0, 0, 419, 420, 0, 418, 419, 419, 0, 420, 0, 0, 408, 420, 420, 0, 0, 0, 0, 421, 423, 409, 423, 423, 423, 421, 0, 0, 419, 421, 421, 428, 424, 423, 424, 424, 424, 428, 0, 0, 420, 428, 428, 421, 0, 424, 424, 425, 0, 425, 425, 425, 426, 0, 426, 426, 426, 0, 426, 427, 425, 427, 427, 427, 429, 426, 425, 427, 0, 0, 429, 437, 427, 438, 429, 429, 0, 437, 0, 438, 0, 437, 437, 438, 438, 0, 439, 0, 440, 0, 429, 0, 439, 0, 440, 437, 439, 439, 440, 440, 442, 0, 442, 442, 442, 0, 442, 439, 0, 0, 438, 0, 0, 442, 443, 0, 443, 443, 443, 444, 0, 444, 444, 444, 0, 440, 445, 443, 445, 445, 445, 0, 444, 443, 0, 0, 0, 447, 446, 445, 446, 446, 446, 447, 455, 445, 456, 447, 447, 446, 455, 446, 456, 457, 455, 455, 456, 456, 0, 457, 0, 458, 0, 457, 457, 0, 447, 458, 465, 0, 0, 458, 458, 460, 465, 460, 460, 460, 465, 465, 0, 455, 457, 456, 0, 0, 460, 461, 0, 461, 461, 461, 460, 0, 0, 0, 465, 0, 458, 462, 461, 462, 462, 462, 0, 463, 461, 463, 463, 463, 462, 0, 462, 464, 0, 464, 464, 464, 463, 471, 0, 472, 0, 464, 463, 471, 464, 472, 473, 471, 471, 472, 472, 0, 473, 474, 0, 0, 473, 473, 475, 474, 475, 475, 475, 474, 474, 476, 473, 476, 476, 476, 0, 475, 0, 0, 471, 0, 0, 475, 476, 477, 0, 477, 477, 477, 478, 0, 478, 478, 478, 0, 0, 0, 477, 0, 0, 480, 479, 478, 479, 479, 479, 480, 479, 0, 484, 480, 480, 485, 0, 479, 484, 0, 0, 485, 484, 484, 0, 485, 485, 480, 486, 0, 486, 486, 486, 489, 487, 0, 487, 487, 487, 489, 0, 486, 0, 489, 489, 491, 0, 487, 485, 487, 488, 491, 488, 488, 488, 491, 491, 488, 489, 0, 0, 0, 492, 488, 492, 492, 492, 0, 0, 0, 0, 492, 491, 0, 493, 492, 493, 493, 493, 494, 0, 0, 496, 0, 493, 494, 0, 493, 496, 494, 494, 0, 496, 496, 0, 497, 0, 497, 497, 497, 0, 0, 0, 0, 496, 0, 0, 494, 497, 498, 499, 498, 498, 498, 0, 0, 499, 501, 0, 0, 499, 499, 498, 501, 0, 0, 0, 501, 501, 0, 502, 499, 502, 502, 502, 503, 504, 503, 503, 503, 502, 0, 504, 502, 506, 501, 504, 504, 503, 507, 506, 507, 507, 507, 506, 506, 0, 508, 504, 508, 508, 508, 507, 507, 0, 0, 0, 0, 509, 0, 508, 511, 0, 508, 509, 0, 506, 511, 509, 509, 0, 511, 511, 0, 512, 0, 512, 512, 512, 0, 514, 513, 0, 513, 513, 513, 514, 512, 0, 0, 514, 514, 509, 512, 513, 516, 0, 0, 511, 0, 513, 516, 0, 0, 0, 516, 516, 517, 0, 517, 517, 517, 518, 519, 518, 518, 518, 514, 0, 519, 517, 0, 0, 519, 519, 518, 517, 521, 0, 0, 0, 518, 516, 521, 0, 0, 0, 521, 521, 522, 0, 522, 522, 522, 523, 524, 523, 523, 523, 0, 519, 524, 522, 0, 0, 524, 524, 523, 527, 527, 527, 527, 527, 527, 527, 527, 527, 528, 528, 528, 528, 528, 528, 528, 528, 528, 529, 529, 529, 529, 529, 529, 529, 529, 529, 530, 530, 530, 530, 530, 530, 530, 530, 530, 531, 531, 531, 531, 531, 531, 531, 531, 531, 532, 532, 532, 532, 532, 532, 532, 532, 532, 533, 533, 0, 533, 533, 533, 533, 533, 533, 534, 0, 534, 535, 0, 535, 0, 535, 0, 535, 536, 536, 536, 536, 536, 536, 536, 536, 536, 537, 0, 537, 538, 0, 538, 0, 538, 0, 538, 539, 539, 0, 539, 539, 539, 539, 539, 539, 540, 540, 540, 541, 541, 541, 542, 542, 0, 0, 0, 542, 542, 542, 542, 543, 543, 0, 0, 0, 543, 543, 543, 543, 544, 0, 544, 544, 545, 0, 545, 0, 545, 0, 545, 545, 546, 546, 547, 0, 547, 547, 548, 0, 548, 0, 548, 0, 548, 548, 549, 549, 549, 550, 550, 550, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[73] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, }; extern int yy_flex_debug; int yy_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; static int yy_looking_for_trail_begin = 0; static int yy_full_lp; static int *yy_full_state; #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ (yy_lp) = yy_full_lp; /* restore orig. accepting pos. */ \ (yy_state_ptr) = yy_full_state; /* restore orig. state */ \ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ ++(yy_lp); \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lexer.ll" /* * $Id: lexer.cc,v 1.25 2010/03/14 14:51:17 mgeng Exp $ * * Copyright (C) 2000, 2006, 2007, 2008 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #line 27 "lexer.ll" /* * Definitions section */ #include #include #include "clparam.h" #include "parser.h" #include "genparse.h" /* * Help with debugging */ #ifdef DEBUG #define return_token(x) { fprintf (stderr,"LEX: Token %s: '%s'\n",#x,yytext); return x; } #else #define return_token(x) { return (x); } #endif #define MAX_INCLUDE_DEPTH 10 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; int include_stack_ptr = 0; int old_start_condition; int brace_level; /* * More definitions */ #line 1560 "lexer.cc" #define INITIAL 0 #define usage 1 #define include 2 #define include_doublequote 3 #define gp_include 4 #define comment 5 #define __code__ 6 #define before_type 7 #define after_type 8 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 80 "lexer.ll" #line 1727 "lexer.cc" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 527 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 2899 ); yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; if ( yy_act & YY_TRAILING_HEAD_MASK || yy_looking_for_trail_begin ) { if ( yy_act == yy_looking_for_trail_begin ) { yy_looking_for_trail_begin = 0; yy_act &= ~YY_TRAILING_HEAD_MASK; break; } } else if ( yy_act & YY_TRAILING_MASK ) { yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; } else { (yy_full_match) = yy_cp; yy_full_state = (yy_state_ptr); yy_full_lp = (yy_lp); break; } ++(yy_lp); goto find_rule; } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) yylineno++; ; } do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 82 "lexer.ll" ; /* do nothing on whitespace */ YY_BREAK case 2: YY_RULE_SETUP #line 84 "lexer.ll" { /* Ignore C comments */ int c1 = 0; int c2 = yyinput (); for (;;) { if (c2 == EOF) break; if (c1 == '*' && c2 == '/') break; c1 = c2; c2 = yyinput (); } } YY_BREAK case 3: YY_RULE_SETUP #line 97 "lexer.ll" { BEGIN (before_type); return_token (NONE); } YY_BREAK case 4: YY_RULE_SETUP #line 101 "lexer.ll" { BEGIN (before_type); yylval.str = strdup (yytext); return_token (FIRST_STR); } YY_BREAK case 5: YY_RULE_SETUP #line 106 "lexer.ll" return_token (OPEN_BRACE); YY_BREAK case 6: YY_RULE_SETUP #line 107 "lexer.ll" return_token (CLOSE_BRACE); YY_BREAK case 7: YY_RULE_SETUP #line 108 "lexer.ll" return_token (OPEN_SQUARE_BRACE); YY_BREAK case 8: YY_RULE_SETUP #line 109 "lexer.ll" return_token (CLOSE_SQUARE_BRACE); YY_BREAK case 9: YY_RULE_SETUP #line 110 "lexer.ll" return_token (OPEN_ROUND_BRACE); YY_BREAK case 10: YY_RULE_SETUP #line 111 "lexer.ll" return_token (CLOSE_ROUND_BRACE); YY_BREAK case 11: YY_RULE_SETUP #line 112 "lexer.ll" return_token (SLASH); YY_BREAK case 12: YY_RULE_SETUP #line 113 "lexer.ll" { BEGIN (after_type); return_token (INT); } YY_BREAK case 13: YY_RULE_SETUP #line 117 "lexer.ll" { BEGIN (after_type); return_token (LONG); } YY_BREAK case 14: YY_RULE_SETUP #line 121 "lexer.ll" { BEGIN (after_type); return_token (ULONG); } YY_BREAK case 15: YY_RULE_SETUP #line 125 "lexer.ll" { BEGIN (after_type); return_token (INTMAX); } YY_BREAK case 16: YY_RULE_SETUP #line 129 "lexer.ll" { BEGIN (after_type); return_token (UINTMAX); } YY_BREAK case 17: YY_RULE_SETUP #line 133 "lexer.ll" { BEGIN (after_type); return_token (FLOAT); } YY_BREAK case 18: YY_RULE_SETUP #line 137 "lexer.ll" { BEGIN (after_type); return_token (DOUBLE); } YY_BREAK case 19: YY_RULE_SETUP #line 141 "lexer.ll" { BEGIN (after_type); return_token (CHAR); } YY_BREAK case 20: YY_RULE_SETUP #line 145 "lexer.ll" { BEGIN (after_type); return_token (STRING); } YY_BREAK case 21: YY_RULE_SETUP #line 149 "lexer.ll" { BEGIN (after_type); return_token (FLAG); } YY_BREAK case 22: YY_RULE_SETUP #line 153 "lexer.ll" { old_start_condition = YY_START; BEGIN (include); return_token (INCLUDE); } YY_BREAK case 23: YY_RULE_SETUP #line 158 "lexer.ll" return_token (LT); YY_BREAK case 24: YY_RULE_SETUP #line 159 "lexer.ll" return_token (GT); YY_BREAK case 25: YY_RULE_SETUP #line 160 "lexer.ll" return_token (DOUBLEQUOTE); YY_BREAK case 26: YY_RULE_SETUP #line 161 "lexer.ll" return_token (LT); YY_BREAK case 27: YY_RULE_SETUP #line 162 "lexer.ll" { BEGIN (old_start_condition); return_token (GT); } YY_BREAK case 28: YY_RULE_SETUP #line 166 "lexer.ll" { BEGIN (include_doublequote); return_token (DOUBLEQUOTE); } YY_BREAK case 29: YY_RULE_SETUP #line 170 "lexer.ll" { BEGIN (old_start_condition); return_token (DOUBLEQUOTE); } YY_BREAK case 30: YY_RULE_SETUP #line 174 "lexer.ll" return_token (EQUAL); YY_BREAK case 31: YY_RULE_SETUP #line 175 "lexer.ll" return_token (ASTERISK); YY_BREAK case 32: YY_RULE_SETUP #line 176 "lexer.ll" return_token (EXCLAMATIONMARK); YY_BREAK case 33: YY_RULE_SETUP #line 177 "lexer.ll" return_token (COLON); YY_BREAK case 34: YY_RULE_SETUP #line 178 "lexer.ll" return_token (MANDATORY); YY_BREAK case 35: YY_RULE_SETUP #line 179 "lexer.ll" return_token (EXIT_VALUE); YY_BREAK case 36: YY_RULE_SETUP #line 180 "lexer.ll" return_token (BREAK_LINES); YY_BREAK case 37: YY_RULE_SETUP #line 181 "lexer.ll" return_token (EXPORT_LONG_OPTIONS); YY_BREAK case 38: YY_RULE_SETUP #line 182 "lexer.ll" return_token (NO_STRUCT); YY_BREAK case 39: YY_RULE_SETUP #line 183 "lexer.ll" return_token (ERR_MSG); YY_BREAK case 40: YY_RULE_SETUP #line 184 "lexer.ll" return_token (DO_NOT_DOCUMENT); YY_BREAK case 41: YY_RULE_SETUP #line 185 "lexer.ll" return_token (ADD_FLAG); YY_BREAK case 42: YY_RULE_SETUP #line 186 "lexer.ll" { old_start_condition = YY_START; BEGIN (comment); return_token (COMMENT); } YY_BREAK case 43: YY_RULE_SETUP #line 191 "lexer.ll" return_token (OPEN_ROUND_BRACE); YY_BREAK case 44: YY_RULE_SETUP #line 192 "lexer.ll" { BEGIN (old_start_condition); return_token (CLOSE_ROUND_BRACE); } YY_BREAK case 45: YY_RULE_SETUP #line 196 "lexer.ll" { yylval.str = strdup (yytext); return_token (COMMENT_STR); } YY_BREAK case 46: YY_RULE_SETUP #line 200 "lexer.ll" return_token (STORE_LONGINDEX); YY_BREAK case 47: YY_RULE_SETUP #line 201 "lexer.ll" BEGIN (usage); YY_BREAK case 48: YY_RULE_SETUP #line 202 "lexer.ll" BEGIN (0); YY_BREAK case 49: YY_RULE_SETUP #line 204 "lexer.ll" { old_start_condition = YY_START; brace_level = 0; BEGIN (__code__); } YY_BREAK case 50: YY_RULE_SETUP #line 210 "lexer.ll" { brace_level++; if (brace_level > 1) return (OPEN_ROUND_BRACE); } YY_BREAK case 51: YY_RULE_SETUP #line 215 "lexer.ll" { brace_level--; if (brace_level < 0) throw EH ("unexpected ) at " + string(yytext)); if (brace_level > 0) { return (CLOSE_ROUND_BRACE); } else { BEGIN (old_start_condition); return (CODE_END); } } YY_BREAK case 52: YY_RULE_SETUP #line 230 "lexer.ll" { if (brace_level <= 0) throw EH ("missing opening ( at " + string(yytext)); yylval.str = strdup (yytext); return_token (CODE_LINE); } YY_BREAK case 53: /* rule 53 can match eol */ YY_RULE_SETUP #line 237 "lexer.ll" { return_token (CODE_END); } YY_BREAK case 54: YY_RULE_SETUP #line 241 "lexer.ll" { yylval.str = strdup (yytext); return_token (C_VAR); } YY_BREAK case 55: YY_RULE_SETUP #line 246 "lexer.ll" return_token (FUNC_SPEC); YY_BREAK case 56: YY_RULE_SETUP #line 248 "lexer.ll" { yylval.str = strdup (yytext); return_token (FUNCTION); } YY_BREAK case 57: YY_RULE_SETUP #line 253 "lexer.ll" { yylval.str = strdup (yytext); return_token (FILENAME); } YY_BREAK case 58: YY_RULE_SETUP #line 258 "lexer.ll" { yylval.str = strdup (yytext); return_token (OPT_NAME); } YY_BREAK case 59: YY_RULE_SETUP #line 263 "lexer.ll" { yylval.str = strdup (yytext); return_token (ALNUM); } YY_BREAK case 60: YY_RULE_SETUP #line 268 "lexer.ll" return_token (RANGE_SPEC1); YY_BREAK case 61: YY_RULE_SETUP #line 269 "lexer.ll" return_token (RANGE_SPEC2); YY_BREAK case 62: /* rule 62 can match eol */ YY_RULE_SETUP #line 270 "lexer.ll" { yylval.str = strdup (yytext+1); yylval.str[strlen (yylval.str)-1]='\0'; return_token (FIRST_QUOTED); } YY_BREAK case 63: /* rule 63 can match eol */ YY_RULE_SETUP #line 275 "lexer.ll" { yylval.str = strdup (yytext+1); yylval.str[strlen (yylval.str)-1]='\0'; return_token (QUOTED); } YY_BREAK case 64: YY_RULE_SETUP #line 280 "lexer.ll" { yylval.str = strdup (yytext); return_token (CHAR_VAL); } YY_BREAK case 65: YY_RULE_SETUP #line 285 "lexer.ll" { /* error */ fprintf (stderr,"parser error in line %d ('%s') \n",yylineno,yytext); exit (1); } YY_BREAK case 66: YY_RULE_SETUP #line 290 "lexer.ll" { yylval.str = strdup (yytext); return_token (USAGE_LINE); } YY_BREAK case 67: /* rule 67 can match eol */ YY_RULE_SETUP #line 295 "lexer.ll" { yylval.str = strdup (""); return_token (USAGE_LINE); } YY_BREAK case 68: /* rule 68 can match eol */ YY_RULE_SETUP #line 300 "lexer.ll" /* Don't print unmatched characters in start conditions */ YY_BREAK case 69: YY_RULE_SETUP #line 303 "lexer.ll" { old_start_condition = YY_START; BEGIN (gp_include); return_token (GP_INCLUDE); } YY_BREAK case 70: /* rule 70 can match eol */ YY_RULE_SETUP #line 308 "lexer.ll" /* do nothing on whitespace */ YY_BREAK case 71: YY_RULE_SETUP #line 309 "lexer.ll" { /* include file name */ if (include_stack_ptr >= MAX_INCLUDE_DEPTH) throw EH ("gp_includes nested too deeply"); include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; yyin = fopen (yytext, "r"); if (!yyin) throw EH ("failed to open gp_include file " + string(yytext)); yy_switch_to_buffer (yy_create_buffer (yyin, YY_BUF_SIZE)); BEGIN (old_start_condition); yylval.str = strdup (yytext); return_token (FILENAME); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(usage): case YY_STATE_EOF(include): case YY_STATE_EOF(include_doublequote): case YY_STATE_EOF(gp_include): case YY_STATE_EOF(comment): case YY_STATE_EOF(__code__): case YY_STATE_EOF(before_type): case YY_STATE_EOF(after_type): #line 327 "lexer.ll" { if (--include_stack_ptr < 0) { yyterminate (); } else { yy_delete_buffer (YY_CURRENT_BUFFER); yy_switch_to_buffer (include_stack[include_stack_ptr]); } } YY_BREAK case 72: YY_RULE_SETUP #line 338 "lexer.ll" ECHO; YY_BREAK #line 2391 "lexer.cc" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 527 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 527 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 526); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; if ( c == '\n' ){ --yylineno; } (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) yylineno++; ; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 338 "lexer.ll" genparse-0.9.1/src/c_clparam_list.h0000644000076600001440000000434511716257231014177 00000000000000/** @file c_clparam_list.h \brief C implementation of the command line parser */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef C_CLPARAM_LIST_H #define C_CLPARAM_LIST_H #include #include "clparam_list.h" /** \brief C implementation of class Clparam_list Generates C output files for parsing a command line. 3 Files can be generated: - a C header file - a C source file containing the parser class - a C source file containing callback functions */ class C_Clparam_list: public Clparam_list { private: /** Add internationalization macro _() */ string add_i18n_macro (string s) const { return "_(" + s + ')'; } void output_print_command (ofstream& o, const string &text, const string &args) const; void output_usage ( ofstream& o) const; void output_get_long_options (ofstream& o) const; bool implementation_requires_error_h (void) const; bool implementation_requires_xstrtol_h (void) const; bool implementation_requires_xstrtod_h (void) const; bool implementation_requires_strtod_h (void) const; bool interface_requires_xstrtol_h (void) const; const string string_type_str (void) const { return "char *"; } // output C code void output_interface ( string filename_without_extension) const throw (EH); void output_implementation (string filename_without_extension) const throw (EH); void output_callbacks ( string filename_without_extension) const throw (EH); public: C_Clparam_list () {} ~C_Clparam_list () {} }; #endif // C_CLPARAM_LIST_H genparse-0.9.1/src/eh_system.h0000644000076600001440000000241311716257231013215 00000000000000/** @file eh_system.h \brief Class definition system call error handler */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef EH_SYSTEM_H #define EH_SYSTEM_H #include #include "eh.h" //--------------------------------------------------------------------------- // // class EH_system // // Derived from EH // //--------------------------------------------------------------------------- class EH_system: public EH { public: // Constructor, destructor EH_system (string); EH_system (string, string, int); ~EH_system (){} }; #endif genparse-0.9.1/src/cpp_clparam_list.cc0000644000076600001440000006001011732675404014670 00000000000000/** @file cpp_clparam_list.cc \brief Methods for the C++ implementation of the command line parser */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "cpp_clparam_list.h" #include "sysinfo.h" #include "systime.h" #include "userinfo.h" #include "genparse_util.h" using genparse_util::C_comment; using genparse_util::full_path; /** Helper function for output_usage (). Output one print command. */ void CPP_Clparam_list::output_print_command ( /** open stream where to print */ ofstream& o, /** Text which must be printed. Must contain starting double quotes '"', ending double quotes are appended in this function. */ const string &text) const { o << " std::cout << \"\\" << endl; o << text << "\";" << endl; } /** set flag if Gnu Portability Library (Gnulib) shall be used */ void CPP_Clparam_list::set_use_gnulib (bool b) throw (EH) { if (b) throw EH ("Use of GNU Portability library not supported for C++ output"); } void CPP_Clparam_list::check_parameters (void) const { if (get_internationalization ()) cerr << "Warning: Internationalization not implemented for C++ output" << endl; } /** Output a class comment banner */ void CPP_Clparam_list::output_comments_class (ofstream& o, string classname, string comment) const { o << "/*----------------------------------------------------------------------------" << endl; o << "**" << endl; o << "** class " << classname << endl; o << "**" << endl; o << "** " << comment << endl; o << "**" << endl; o << "**--------------------------------------------------------------------------*/" << endl; } /** Output a C++ header file containing the interface of the parser class */ void CPP_Clparam_list::output_interface (const string filename_without_extension) const throw (EH) { // make file .h extension const string filename = filename_without_extension + ".h"; const string path = full_path (get_directory (), filename); list params = get_params (); list::const_iterator iter; list::const_iterator str_iter; if (get_no_struct ()) throw EH ("#no_struct not yet implemented for C++ output."); // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the header file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Header file for command line parser class"); // do the ifdef o << "#ifndef " << genparse_util::str2upper (get_parsefunc ()) << "_H" << endl; o << "#define " << genparse_util::str2upper (get_parsefunc ()) << "_H" << endl; o << endl; // print the includes o << "#include " << endl; o << "#include " << endl; output_includes (o); // dump the class output_comments_class (o, get_parsefunc (), "command line parser class"); o << endl; o << "class " << get_parsefunc () << endl; o << "{" << endl; // private section o << "private:" << endl; o << " " << C_comment ("parameters") << endl; for (iter = params.begin (); iter != params.end (); iter++) { o << " " << type2str (iter->get_type ()) << " _" << get_parameter_name (*iter) << ";" << endl; if (iter->requires_additional_flag_arg ()) o << " " << type2str (flag_type) << " _" << get_parameter_name (*iter) << "_flag;" << endl; if (iter->get_store_longindex ()) o << " " << type2str (int_type) << " _" << get_parameter_name (*iter) << "_li;" << endl; } o << endl; o << " " << C_comment ("other stuff to keep track of") << endl; o << " " << string_type_str () << " _program_name;" << endl; o << " int _optind;" << endl; o << endl; // public section o << "public:" << endl; o << " " << C_comment ("constructor and destructor") << endl; o << " " << get_parsefunc () << " (int, char **) throw (" << string_type_str () << ");" << endl; o << " ~" << get_parsefunc () << " (){}" << endl; o << endl; o << " " << C_comment ("usage function") << endl; o << " void usage (int status);" << endl; o << endl; o << " " << C_comment ("return next (non-option) parameter") << endl; o << " int next_param () { return _optind; }" << endl; o << endl; if (have_callbacks ()) { list param_callback_list; o << " " << C_comment ("callback functions") << endl; /* global callbacks */ if (!get_global_callback ().empty ()) o << " " << boolean_type_str () << ' ' << get_global_callback () << " ();" << endl; /* parameter related callbacks */ for (iter = params.begin (); iter != params.end (); iter++) if (!(iter->get_callback ()).empty ()) /* Print every callback function only once, no matter how many parameters use it. */ if (find (param_callback_list.begin (), param_callback_list.end (), iter->get_callback ()) == param_callback_list.end ()) { o << " " << boolean_type_str () << ' ' << iter->get_callback () << " ();" << endl; param_callback_list.push_back (iter->get_callback ()); } o << endl; } // functions to return parameter values ("getter functions") for (iter = params.begin (); iter != params.end (); iter++) { o << " " << type2str (iter->get_type ()) << ' ' << get_parameter_name (*iter) << " () const { return _" << get_parameter_name (*iter) << "; }" << endl; if (iter->requires_additional_flag_arg ()) o << " " << type2str (flag_type) << ' ' << get_parameter_name (*iter) << "_flag" << " () const { return _" << get_parameter_name (*iter) << "_flag; }" << endl; if (iter->get_store_longindex ()) o << " " << type2str (int_type) << ' ' << get_parameter_name (*iter) << "_li" << " () const { return _" << get_parameter_name (*iter) << "_li; }" << endl; } // closing bracket for class definition o << "};" << endl; o << endl; o << "#endif" << endl; if (!o) throw EH ("can't write to file: " + path); // close the file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } /** Output a C++ source file containing the implementation of the parser class */ void CPP_Clparam_list::output_implementation (const string filename_without_extension) const throw (EH) { // make file extension const string filename = filename_without_extension + "." + get_cppext (); const string path = full_path (get_directory (), filename); list params = get_params (); list::iterator iter; list::const_iterator str_iter; ostringstream usage_stream; // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the header file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Definition of command line parser class"); // includes o << "#include " << endl; o << "#include " << endl; o << "#include \"" << filename_without_extension << ".h\"" << endl; o << endl; // comments for constructor output_function_comment (o, get_parsefunc () + "::" + get_parsefunc (), "Constructor method."); o << endl; // constructor o << get_parsefunc () << "::" << get_parsefunc () << " (int argc, char *argv[]) throw (" << string_type_str () << " )" << endl; o << "{" << endl; // local variables o << " extern char *optarg;" << endl; o << " extern int optind;" << endl; o << " int c;" << endl; o << endl; // options structure o << " static struct option long_options[] =" << endl; o << " {" << endl; for (iter = params.begin (); iter != params.end (); iter++) { if (iter->get_long_rep ().length () > 0) { o << " {\"" << iter->get_long_rep () << "\", "; switch (iter->get_long_has_arg ()) { case no_argument: o << "no_argument"; break; case optional_argument: o << "optional_argument"; break; case required_argument: o << "required_argument"; break; default: break; } o << ", NULL, "; if (iter->get_long_only ()) o << iter->get_longopt_value (); else o << '\'' << iter->get_short_rep (0) << '\''; o << "}," << endl; } } o << " {NULL, 0, NULL, 0}" << endl; o << " };" << endl; o << endl; o << " _program_name += argv[0];" << endl; o << endl; // assign default values o << " " << C_comment ("default values") << endl; for (iter = params.begin (); iter != params.end (); iter++) { switch (iter->get_type ()) { case flag_type: // all flags default to off o << " _" << get_parameter_name (*iter) << " = false;" << endl; break; case string_type: // copy default if there, NULL otherwise if (!iter->get_default_value ().empty ()) o << " _" << get_parameter_name (*iter) << " = \"" << iter->get_default_value () << "\";" << endl; break; default: // all else - copy default if there if (!iter->get_default_value ().empty ()) o << " _" << get_parameter_name (*iter) << " = " << iter->get_default_value () << ";" << endl; } if (iter->requires_additional_flag_arg ()) o << " _" << get_parameter_name (*iter) << "_flag = false;" << endl; if (iter->get_store_longindex ()) o << " _" << get_parameter_name (*iter) << "_li = 0;" << endl; } o << endl; // reset global optind variable, otherwise it would not be possible to instantiate the parser // class multiple times in the same program o << " optind = 0;" << endl; // Make the getopt_long () call o << " while ((c = getopt_long (argc, argv, \""; for (iter = params.begin (); iter != params.end (); iter++) { if (!iter->get_long_only ()) { o << iter->get_short_reps (); if (iter->get_short_has_arg () == required_argument) o << ':'; else if (iter->get_short_has_arg () == optional_argument) o << "::"; } } o << "\", long_options, &optind)) != - 1)" << endl; // do the switch statement o << " {" << endl; o << " switch (c)" << endl; o << " {" << endl; for (iter = params.begin (); iter != params.end (); iter++) { unsigned int indent_width; #define INDENT string (indent_width, ' ') if (iter->get_long_only ()) o << " case " << iter->get_longopt_value () << ": " << endl; else { for (unsigned int i = 0; i < iter->get_num_short_reps ();i++) o << " case '" << iter->get_short_rep (i) << "': " << endl; } indent_width = 10; if (iter->requires_additional_flag_arg ()) { o << INDENT << '_' << get_parameter_name (*iter) << "_flag = true;" << endl; o << INDENT << "if (optarg != NULL)" << endl; indent_width += 2; } o << INDENT << '_' << get_parameter_name (*iter); switch (iter->get_type ()) { case string_type: o << " = optarg;" << endl; break; case int_type: o << " = atoi (optarg);" << endl; break; case float_type: o << " = atof (optarg);" << endl; break; case char_type: o << " = *optarg;" << endl; break; case flag_type: o << " = true;" << endl; if (iter->get_long_rep () == "help") o << INDENT << "this->usage (EXIT_SUCCESS);" << endl; break; default: break; } if (iter->get_store_longindex ()) o << INDENT << '_' << get_parameter_name (*iter) << "_li = optind;" << endl; // do low range checking if (!iter->get_low_range ().empty ()) { o << INDENT << "if (_" << get_parameter_name (*iter) << " < " << iter->get_low_range () << ")" << endl; indent_width += 2; o << INDENT << '{' << endl; indent_width += 2; o << INDENT << string_type_str () << " s;" << endl; o << INDENT << "s += \"parameter range error: " << get_parameter_name (*iter) << " must be >= " << iter->get_low_range () << "\";" << endl; o << INDENT << "throw (s);" << endl; indent_width -= 2; o << INDENT << '}' << endl; indent_width -= 2; } // do high range checking if (!iter->get_high_range ().empty ()) { o << INDENT << "if (_" << get_parameter_name (*iter) << " > " << iter->get_high_range () << ")" << endl; indent_width += 2; o << INDENT << '{' << endl; indent_width += 2; o << INDENT << string_type_str () << " s;" << endl; o << INDENT << "s += \"parameter range error: " << get_parameter_name (*iter) << " must be <= " << iter->get_high_range () << "\";" << endl; o << INDENT << "throw (s);" << endl; indent_width -= 2; o << INDENT << '}' << endl; indent_width -= 2; } // write user defined code for this parameter list code_lines = iter->get_code_lines (); list::const_iterator code_iter; for (code_iter = code_lines.begin (); code_iter != code_lines.end (); code_iter++) o << INDENT << *code_iter << endl; // do callbacks if (!iter->get_callback ().empty ()) { o << INDENT << "if (!" << iter->get_callback () << " ())" << endl; indent_width += 2; o << INDENT << "this->usage (" << get_exit_value () << ");" << endl; indent_width -= 2; } // do break statement o << INDENT << "break;" << endl << endl; } // print default action for unknown parameters o << " default:" << endl; o << " this->usage (" << get_exit_value () << ");" << endl << endl; o << " }" << endl; o << " } /* while */" << endl << endl; // save a pointer to the next argument o << " _optind = optind;" << endl; // do global callbacks if (!get_global_callback ().empty ()) { o << " if (!" << get_global_callback () << " ())" << endl; o << " usage (" << get_exit_value () << ");" << endl << endl; } o << "}" << endl; o << endl; // comments for usage () output_function_comment (o, get_parsefunc () + "::usage", "Print out usage information, then exit."); o << endl; // usage function o << "void " << get_parsefunc () << "::usage (int status)" << endl; o << "{" << endl; o << " if (status != EXIT_SUCCESS)" << endl; o << " std::cerr << \"Try `\" << _program_name << \" --help' for more information.\\n\";" << endl; o << " else" << endl; o << " {" << endl; list usage_list = get_usage (); for (str_iter = usage_list.begin (); str_iter != usage_list.end (); str_iter++) { string::size_type macro_pos, arg_start_pos, arg_end_pos, closing_bracket_pos; string macro_argument; bool line_manipulated; string line = *str_iter; do { if ((macro_pos = line.find (string ("__PROGRAM_NAME__"))) != string::npos) { line.replace (macro_pos, 16, string ("\" << _program_name << \"")); } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__STRING__", line)) != string::npos) { macro_argument = string (line, arg_start_pos, arg_end_pos - arg_start_pos + 1); line.replace (macro_pos, closing_bracket_pos - macro_pos + 1, string ("\" << ") + macro_argument + string (" << \"")); } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__INT__", line)) != string::npos) { macro_argument = string (line, arg_start_pos, arg_end_pos - arg_start_pos + 1); line.replace (macro_pos, closing_bracket_pos - macro_pos + 1, string ("\" << ") + macro_argument + string (" << \"")); } } while (macro_pos != string::npos); if (line.find ("__DO_NOT_DOCUMENT__") == string::npos) { line_manipulated = false; do { if ((macro_pos = line.find (string ("__NEW_PRINT__"))) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << string (line, 0, macro_pos); usage_stream << "\\n"; } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); usage_stream.str (""); /* Remove __NEW_PRINT__ and any characters before */ line.erase (0, macro_pos + 13); line_manipulated = true; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__CODE__", line)) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << string (line, 0, macro_pos); usage_stream << "\\n"; } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); o << " " << line.substr (arg_start_pos, closing_bracket_pos - arg_start_pos) << endl; usage_stream.str (""); /* Remove __CODE__() and any characters before */ line.erase (0, closing_bracket_pos + 1); line_manipulated = true; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__COMMENT__", line)) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << string (line, 0, macro_pos); usage_stream << "\\n"; } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); usage_stream.str (""); o << " // " << line.substr (arg_start_pos, closing_bracket_pos - arg_start_pos) << endl; /* Remove __COMMENT__() and any characters before */ line.erase (0, closing_bracket_pos + 1); line_manipulated = true; } } while (macro_pos != string::npos); if (!line_manipulated || !line.empty ()) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << line << "\\n"; } } } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); o << " }" << endl; o << " exit (status);" << endl; o << "}" << endl; if (!o) throw EH ("can't write to file: " + path); // close the C++ file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } /** Output a C++ source file containing the default implementation of the callback functions */ void CPP_Clparam_list::output_callbacks (const string filename_without_extension) const throw (EH) { list params = get_params (); list::const_iterator str_iter; list::const_iterator iter; // first figure out if we have to do anything at all - no callbacks = no // callback file if (have_callbacks ()) { // make file extension const string filename = filename_without_extension + "_cb." + get_cppext (); const string path = full_path (get_directory (), filename); list param_callback_list; // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the callbacks file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Callbacks for command line parser class"); // includes o << "#include \"" << filename_without_extension << ".h\"" << endl; // loop through global callbacks if (!get_global_callback ().empty ()) { o << endl; // comments for output_function_comment (o, get_parsefunc () + "::" + get_global_callback (), "Global callback."); o << endl; o << boolean_type_str () << ' ' << get_parsefunc () << "::" << get_global_callback () << " ()" << endl; o << "{" << endl; o << " return true;" << endl; o << "}" << endl; } // do the parameter callbacks for (iter = params.begin (); iter != params.end (); iter++) if (!iter->get_callback ().empty ()) /* Print every callback function only once, no matter how many parameters use it. */ if (find (param_callback_list.begin (), param_callback_list.end (), iter->get_callback ()) == param_callback_list.end ()) { o << endl; output_function_comment (o, get_parsefunc () + "::" + iter->get_callback (), "Parameter callback."); o << endl; o << boolean_type_str () << ' ' << get_parsefunc () << "::" << iter->get_callback () << " ()" << endl; o << "{" << endl; o << " return true;" << endl; o << "}" << endl; param_callback_list.push_back (iter->get_callback ()); } if (!o) throw EH ("can't write to file: " + path); // close the callback file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } // if } genparse-0.9.1/src/getopt.cc0000644000076600001440000007555111716257231012672 00000000000000/** @file getopt.cc \brief getopt entry points */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef HAVE_GETOPT_LONG /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "getopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } int getopt (int argc, char * const * argv, const char * optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifndef _NO_PROTO #define _NO_PROTO #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #if defined (WIN32) && !defined (__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #define getpid () GetCurrentProcessId () #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ extern char * getenv (const char *); static char * my_index (const char *str, int chr) { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; extern pid_t __libc_pid; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } text_set_element (__libc_subinit, store_args_and_env); # define SWAP_FLAGS (ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS (ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (&new_str[nonoption_flags_max_len], '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { memcpy (__getopt_nonoption_flags, orig_str, len); memset (&__getopt_nonoption_flags[len], '\0', nonoption_flags_max_len - len); } } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else { /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } #endif /* Not ELIDE_CODE. */ #endif genparse-0.9.1/src/parse_cl.h0000644000076600001440000000336411110011723012771 00000000000000/****************************************************************************** ** ** parse_cl.h ** ** Sun Nov 16 13:14:13 2008 ** Linux 2.6.23 (#9 Sun Jan 27 22:29:05 CET 2008) i686 ** linux@mgpc (Michael Geng) ** ** Header file for command line parser class ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #ifndef CMDLINE_H #define CMDLINE_H #include #include /*---------------------------------------------------------------------------- ** ** class Cmdline ** ** command line parser class ** **--------------------------------------------------------------------------*/ class Cmdline { private: /* parameters */ std::string _c; bool _d; std::string _D; std::string _f; bool _g; bool _i; std::string _l; bool _m; std::string _o; std::string _p; bool _P; bool _q; bool _s; bool _h; bool _v; /* other stuff to keep track of */ std::string _program_name; int _optind; public: /* constructor and destructor */ Cmdline (int, char **) throw (std::string); ~Cmdline (){} /* usage function */ void usage (int status); /* return next (non-option) parameter */ int next_param () { return _optind; } std::string c () { return _c; } bool d () { return _d; } std::string D () { return _D; } std::string f () { return _f; } bool g () { return _g; } bool i () { return _i; } std::string l () { return _l; } bool m () { return _m; } std::string o () { return _o; } std::string p () { return _p; } bool P () { return _P; } bool q () { return _q; } bool s () { return _s; } bool h () { return _h; } bool v () { return _v; } }; #endif genparse-0.9.1/src/eh_system.cc0000644000076600001440000000374311716257231013362 00000000000000/** @file eh_system.cc \brief Methods for the sytem call error handler class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "eh_system.h" //--------------------------------------------------------------------------- // // EH_system::EH_system () // // Constructor method. Get system call error message. // //--------------------------------------------------------------------------- EH_system::EH_system (string s) { char *syserr; // First, get the error string from the system syserr = strerror (errno); // add it to the user string s += ": "; while (*syserr != '\0') { s += *syserr; syserr++; } action (s, "", 0); } //--------------------------------------------------------------------------- // // EH_system::EH_system (string, string, int) // // Constructor method. Get system call error message, dump file and line # // //--------------------------------------------------------------------------- EH_system::EH_system (string s, string f, int l) { char *syserr; // First, get the error string from the system syserr = strerror (errno); // add it to the user string s += ": "; while (*syserr != '\0') { s +=*syserr; syserr++; } action (s, f, l); } genparse-0.9.1/src/sysinfo.h0000644000076600001440000000364611716257231012720 00000000000000/** @file sysinfo.h \brief Class definition for UNIX information on the system */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SYSINFO_H #define SYSINFO_H #include #include "eh_system.h" //--------------------------------------------------------------------------- // // class Sysinfo // //--------------------------------------------------------------------------- class Sysinfo { private: string _name; // name of the operating system, e.g., "Linux" string _release; // kernel verion, e.g., "2.2.13" string _build; // date of kernel compilation, etc. string _hardware; // type of processor, e.g., i686 string _domainname; // Domain name - this doesn't work on linux... public: // Constructor and destructor Sysinfo () throw (EH_system); ~Sysinfo () {} // functions to retrieve the values string name () { return _name; } string release () { return _release; } string build () { return _build; } string hardware () { return _hardware; } string domainname () { return _domainname; } // format the output into somthing I like string format () { return _name + " " + _release + " (" + _build + ") " + _hardware; } }; #endif genparse-0.9.1/src/cpp_clparam_list.h0000644000076600001440000000364511716257231014541 00000000000000/** @file cpp_clparam_list.h \brief C++ implementation of the command line parser */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CPP_CLPARAM_LIST_H #define CPP_CLPARAM_LIST_H #include #include "clparam_list.h" /** \brief C++ implementation of class Clparam_list Generates C++ output files for parsing a command line. 3 Files can be generated: - a C++ header file - a C++ source file containing the parser class - a C++ source file containing callback functions */ class CPP_Clparam_list: public Clparam_list { private: void output_print_command (ofstream& o, const string &text) const; void check_parameters (void) const; void output_comments_class (ofstream& o, string classname, string comment) const; const string string_type_str (void) const { return "std::string"; } // output C++ code void output_interface ( string filename_without_extension) const throw (EH); void output_implementation (string filename_without_extension) const throw (EH); void output_callbacks ( string filename_without_extension) const throw (EH); public: CPP_Clparam_list () {} ~CPP_Clparam_list () {} void set_use_gnulib (bool b) throw (EH); }; #endif // CPP_CLPARAM_LIST_H genparse-0.9.1/src/unique_int.h0000644000076600001440000000253111716257231013376 00000000000000/** @file unique_int.h \brief Class definition for a generator of unique, monotonically increasing integers. Probably not safe until we check for out of range error. */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef UNIQUE_INT_H #define UNIQUE_INT_H //--------------------------------------------------------------------------- // // class Unique_Int // //--------------------------------------------------------------------------- class Unique_Int { private: int _i; public: // Constructor and destructor Unique_Int (int j) { _i = j; } ~Unique_Int (){} // Gets the next highest int int get (); }; #endif genparse-0.9.1/src/systime.h0000644000076600001440000000364411716257231012721 00000000000000/** @file systime.h \brief Class definition for system time (wall clock time) */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SYSTIME_H #define SYSTIME_H #include #include #include #include "eh_system.h" //--------------------------------------------------------------------------- // // class Systime // //--------------------------------------------------------------------------- class Systime { private: struct timeval _tv; // Store absolute time here struct tm * _tp; // seconds since unix epoch, broken down (relative) public: // Constructor and destructor Systime (); ~Systime (){} // Operator overrides Systime& operator= (const Systime&); Systime operator- (const Systime); // Read the clock again void refresh () throw (EH_system); // functions to display the time int microseconds () { return _tv.tv_usec; } int seconds () { return _tv.tv_sec; } int sec () { return _tp->tm_sec; } int minute () { return _tp->tm_min; } int hour () { return _tp->tm_hour; } int year () { return _tp->tm_year; } string hms (); string month (); string day (); string unix_ctime (); }; #endif genparse-0.9.1/src/eh.h0000644000076600001440000000377011716257231011620 00000000000000/** @file eh.h \brief Class definition generic error handler */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef EH_H #define EH_H #include using namespace std; // types of dispositions enum eh_disp_t { EH_DISP_HALT, // print msg then terminate EH_DISP_CONTINUE, // print msg then continue where we left off EH_DISP_IGNORE, // do nothing, just return EH_DISP_CALLBACK // pass the msg to a callback function }; #define EH_LOCATION __FILE__,__LINE__ //--------------------------------------------------------------------------- // // class EH // //--------------------------------------------------------------------------- class EH { protected: static eh_disp_t _disposition; static void (*_callback) (string); // determines what to do based on disposition void action (string, string, int); public: // Constructor, destructor EH (string); EH (string, string, int); // for passing __FILE__ and __LINE__ EH () {} // for inherited classes, we don't need to do anything ~EH (){} // disposition functions static eh_disp_t disposition () { return _disposition; } static void disposition (eh_disp_t d) { _disposition = d; } // callback function static void callback (void (*f)(string)) { _callback = f; } }; #endif genparse-0.9.1/src/parser.yy0000644000076600001440000002657311673365613012746 00000000000000/* * $Id: parser.yy,v 1.32 2011/12/10 10:00:07 mgeng Exp $ * * Copyright (C) 2000, 2006, 2007, 2008, 2009, 2010, 2011 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ %{ #include #include #include #include #include "genparse.h" #include "clparam_list.h" #include "logfile.h" #include "unique_int.h" #define YYDEBUG 1 // These prototypes are necessary for C++ compilation int yyerror (char *); int yylex (); void dump_short_reps (char *); void add_param_to_list (); void dump_param_type (param_type); // These are all defined in genparse.cc extern Clparam_list *my_params; extern Unique_Int longopt_value; extern Logfile mylog; extern int yylineno; extern char *yyfilename; // This is an object we use over and over to read in parameters Clparam *param; %} %expect 34 /* Report a warning only if this number of shift / reduce conflicts doesn't match */ %union { char *str; /* string */ int i; param_type p; } %token SLASH RANGE_SPEC1 RANGE_SPEC2 FUNC_SPEC NONE OPEN_BRACE CLOSE_BRACE %token OPEN_SQUARE_BRACE CLOSE_SQUARE_BRACE EQUAL INCLUDE LT GT %token MANDATORY EXIT_VALUE BREAK_LINES DOUBLEQUOTE ASTERISK EXCLAMATIONMARK %token STORE_LONGINDEX EXPORT_LONG_OPTIONS GP_INCLUDE ERR_MSG COMMENT DO_NOT_DOCUMENT %token OPEN_ROUND_BRACE CLOSE_ROUND_BRACE COLON ADD_FLAG NO_STRUCT CODE_END %token QUOTED FIRST_QUOTED C_VAR ALNUM FILENAME CHAR_VAL FIRST_STR USAGE_LINE CODE_LINE %token OPT_NAME COMMENT_STR FUNCTION %token FLAG INT LONG ULONG INTMAX UINTMAX FLOAT DOUBLE CHAR STRING %type desc short_params callback default single_code_line %type

type %% /* * Rules section */ all: globals entries usages | globals usages ; globals: /* empty */ | globals global | global ; global: include | mandatory | exit_value | break_lines | export_long_options | no_struct | global_callback ; include: INCLUDE LT FILENAME GT { my_params->add_include ((string)"<" + $3 + ">"); mylog.write ((string) "adding include file: <" + $3 + ">"); free ($3); } | INCLUDE DOUBLEQUOTE FILENAME DOUBLEQUOTE { my_params->add_include ((string)"\"" + $3 + "\""); mylog.write ((string) "adding include file: \"" + $3 + "\""); free ($3); } ; mandatory: MANDATORY C_VAR { my_params->add_mandatory ($2); mylog.write ((string) "adding mandatory: " + $2); free ($2); } ; exit_value: EXIT_VALUE C_VAR { my_params->set_exit_value ($2); mylog.write ((string) "adding exit value: " + $2); free ($2); } | EXIT_VALUE ALNUM { my_params->set_exit_value ($2); mylog.write ((string) "adding exit value: " + $2); free ($2); } ; break_lines: BREAK_LINES ALNUM { my_params->set_break_lines ($2); mylog.write ((string) "breaking lines to a width of: " + $2); free ($2); } ; export_long_options: EXPORT_LONG_OPTIONS { my_params->set_export_long_options (true); mylog.write ((string) "exporting long options struct"); } ; no_struct: NO_STRUCT { my_params->set_no_struct (true); mylog.write ((string) "do not auto generate a struct / class for parsing results"); } ; global_callback: callback { my_params->set_global_callback ($1); mylog.write ((string) "setting global callback: " + $1); } ; entries: entries entry | entry ; entry: { param = new Clparam; mylog.write ("reading parameter..."); } new_entry { add_param_to_list (); } | gp_include ; new_entry: param type options { param->set_type ($2); dump_param_type ($2); } ; options: /* empty */ | options option | option ; option: default { param->set_default_value ($1); mylog.write ((string) " default value: " + $1); free ($1); } | range | callback { param->set_callback ($1); mylog.write ((string) " callback: " + $1); } | descs | STORE_LONGINDEX { param->set_store_longindex (true); mylog.write ((string) " longindex for this parameter must be stored"); } | err_msg | ADD_FLAG { param->set_add_flag (true); mylog.write ((string) " this parameter also gets a flag"); } | DO_NOT_DOCUMENT { param->set_do_not_document (true); mylog.write ((string) " do not document this parameter"); } | comment | code_lines ; descs: descs desc | desc ; err_msg: ERR_MSG OPEN_ROUND_BRACE err_msg_arg CLOSE_ROUND_BRACE ; err_msg_arg: ALNUM { param->set_err_msg ($1); mylog.write ((string) " conversion error message: " + $1); free ($1); } | QUOTED { param->set_err_msg (string("\"") + $1 + '\"'); mylog.write ((string) " conversion error message: \"" + $1 + '\"'); free ($1); } | ALNUM COLON C_VAR { param->set_err_msg ($1); mylog.write ((string) " conversion error message: " + $1); param->set_err_msg_conv ($3); mylog.write ((string) " conversion function for erraneous argument: " + $3); free ($1); free ($3); } | QUOTED COLON C_VAR { param->set_err_msg (string("\"") + $1 + '\"'); mylog.write ((string) " conversion error message: \"" + $1 + '\"'); param->set_err_msg_conv ($3); mylog.write ((string) " conversion function for erraneous argument: " + $3); free ($1); free ($3); } ; comment: COMMENT OPEN_ROUND_BRACE COMMENT_STR CLOSE_ROUND_BRACE { param->set_comment ($3); mylog.write ((string) " comment: " + $3); free ($3); } gp_include: GP_INCLUDE FILENAME { mylog.write ((string) "including genparse file" + $2); free ($2); } ; param: short_params { param->set_short_reps ($1); dump_short_reps ($1); free ($1); } | NONE SLASH long_param { param->set_longopt_value (longopt_value.get ()); param->set_long_only (true); } | short_params SLASH long_param { param->set_short_reps ($1); dump_short_reps ($1); free ($1); } ; short_params: FIRST_STR | FIRST_STR ASTERISK { param->set_short_has_arg (optional_argument); } | FIRST_STR EXCLAMATIONMARK { param->set_short_has_arg (no_argument); } ; long_param: multi_long_option | multi_long_option mandatory_opt_name | multi_long_option optional_opt_name ; mandatory_opt_name: EQUAL C_VAR { param->set_opt_name ($2); free ($2); } | EQUAL OPT_NAME { param->set_opt_name ($2); free ($2); } ; optional_opt_name: OPEN_SQUARE_BRACE mandatory_opt_name CLOSE_SQUARE_BRACE { param->set_opt_name_in_square_braces (true); } ; multi_long_option: long_option {} | long_option ASTERISK { param->set_long_has_arg (optional_argument); } | long_option EXCLAMATIONMARK { param->set_long_has_arg (no_argument); } ; long_option: ALNUM { param->set_long_rep ($1); mylog.write ((string) " long representation: " + $1); free ($1); } | C_VAR { param->set_long_rep ($1); mylog.write ((string) " long representation: " + $1); free ($1); } ; type: INT { $$ = int_type; } | LONG { if (my_params->get_use_gnulib ()) $$ = long_type; else yyerror ("type long only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } | ULONG { if (my_params->get_use_gnulib ()) $$ = ulong_type; else yyerror ("type ulong only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } | INTMAX { if (my_params->get_use_gnulib ()) $$ = intmax_type; else yyerror ("type intmax_t only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } | UINTMAX { if (my_params->get_use_gnulib ()) $$ = uintmax_type; else yyerror ("type uintmax_t only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } | FLOAT { $$ = float_type; } | DOUBLE { if (my_params->get_use_gnulib ()) $$ = double_type; else yyerror ("type double only supported if GNU Portability Library is used " "(option --gnulib enables it)"); } | STRING { $$ = string_type; } | CHAR { $$ = char_type; } | FLAG { $$ = flag_type; } ; default: ALNUM | CHAR_VAL | OPEN_BRACE QUOTED CLOSE_BRACE { $$ = $2; } ; range: OPEN_SQUARE_BRACE contiguous_range CLOSE_SQUARE_BRACE ; contiguous_range: ALNUM range_spec more_range { param->set_low_range ($1); mylog.write ((string)" parameter range: " + $1 + ".."); free ($1); } | range_spec more_range ; /* both are needed because of lexing ambiguity */ more_range: ALNUM { param->set_high_range ($1); mylog.write ((string)" parameter range: .." + $1); free ($1); } | C_VAR { param->set_high_range ($1); mylog.write ((string)" parameter range: .." + $1); free ($1); } | ; range_spec: RANGE_SPEC1 | RANGE_SPEC2 ; callback: FUNCTION FUNC_SPEC { $$ = $1; } ; desc: QUOTED { param->add_description ($1, false); mylog.write ((string) " description: " + $1); free ($1); } | FIRST_QUOTED { param->add_description ($1, true); mylog.write ((string) " description starting in 1st column: " + $1); free ($1); } ; usages: /* empty */ | usages usage | usage ; usage: USAGE_LINE { my_params->append_usage_line ($1); mylog.write ((string)" usage string:" + $1); free ($1); } ; code_lines: code_lines code_line | code_line ; code_line: single_code_line CODE_END { param->add_code_line ($1); mylog.write ((string)" code string:" + $1); free ($1); } | CODE_END { param->add_code_line (""); mylog.write ((string)" code string:"); } ; single_code_line: CODE_LINE { } | OPEN_ROUND_BRACE { $$ = strdup ((string ("(")).c_str ()); } | CLOSE_ROUND_BRACE { $$ = strdup ((string (")")).c_str ()); } | single_code_line single_code_line { $$ = strdup ((string ($1) + $2).c_str ()); free ($1); free ($2); } ; %% int yyerror (char *s) { cerr << s << " in " << yyfilename << ": " << yylineno << endl; return 1; } void dump_short_reps (char *s) { mylog.write (LOG_OPTION_NO_CR, " short representation: "); mylog.write (LOG_OPTION_NO_TS, s); } void add_param_to_list () { mylog.write ("done reading parameter...adding to list"); my_params->add (*param); delete param; } void dump_param_type (param_type p) { mylog.write (LOG_OPTION_NO_CR, " parameter type: "); switch (p) { case int_type: mylog.write (LOG_OPTION_NO_TS, "int"); break; case long_type: mylog.write (LOG_OPTION_NO_TS, "long int"); break; case ulong_type: mylog.write (LOG_OPTION_NO_TS, "unsigned long int"); break; case intmax_type: mylog.write (LOG_OPTION_NO_TS, "intmax_t"); break; case uintmax_type: mylog.write (LOG_OPTION_NO_TS, "uintmax_t"); break; case float_type: mylog.write (LOG_OPTION_NO_TS, "float"); break; case double_type: mylog.write (LOG_OPTION_NO_TS, "double"); break; case string_type: mylog.write (LOG_OPTION_NO_TS, "string"); break; case char_type: mylog.write (LOG_OPTION_NO_TS, "char"); break; case flag_type: mylog.write (LOG_OPTION_NO_TS, "flag"); break; default: break; } } genparse-0.9.1/src/clparam_list_factory.cc0000644000076600001440000000320611716257231015555 00000000000000/** @file clparam_list_factory.cc \brief Methods for the command line parameter list factory class */ /* * Copyright (C) 2006 - 2012 * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "clparam_list_factory.h" #include "c_clparam_list.h" #include "cpp_clparam_list.h" #include "java_clparam_list.h" /** Creates the Clparam_list sub class using new which is able to generate language code @param language must be "c" or "C" in order to generate C code, "c++" or "cpp" or "cc" or "cxx" in order to generate C++ code and "java" or "Java" in order to generate Java code. */ Clparam_list *Clparam_list_factory::Create_Clparam_list (const string &language) const throw (EH) { if (language == "c" || language == "C") return new C_Clparam_list; else if (language == "c++" || language == "cpp" || language == "cc" || language == "cxx") return new CPP_Clparam_list; else if (language == "java" || language == "Java") return new Java_Clparam_list; else throw EH ("invalid parameter " + language); } genparse-0.9.1/src/genparse_util.cc0000644000076600001440000000411211716257231014212 00000000000000/** @file genparse_util.cc \brief Utilities used within the genparse project */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "genparse_util.h" namespace genparse_util { /** Convert a string to upper case */ string str2upper (string s) { /* toupper is ambiguous, so use a cast in order to choose the right one */ transform (s.begin (), s.end (), s.begin (), (int (*)(int))toupper); return s; } /** Given a string, return it in C comment form in a new string */ string C_comment (string s) { return "/* " + s + " */"; } /** combine directory and filename to a complete path. */ string full_path (const string directory, const string filename) { if (directory.length () > 0) { return (directory + '/' + filename); } else { return (filename); } } /** Converts '-' to '_' */ char minus_to_underscore (const char c) { if (c == '-') return '_'; else return c; } /** Convert a string to C style. Converts every '-' to '_' and prepend and underscore ('_') to every single digit name */ string str2C (string s) { if (s.length () == 1) { if (isdigit (s[0])) return ('_' + s); } else transform (s.begin (), s.end (), s.begin (), (int (*)(int))minus_to_underscore); return s; } } genparse-0.9.1/src/systime.cc0000644000076600001440000000777511716257231013070 00000000000000/** @file systime.cc \brief Methods for the system time class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "systime.h" #define TIMESTR_LEN 64 //--------------------------------------------------------------------------- // // Systime::Systime () // // Constructor method. Call the function that does the work. // //--------------------------------------------------------------------------- Systime::Systime () { refresh (); } //--------------------------------------------------------------------------- // // Systime::operator=() // // Assignment operator overload // //--------------------------------------------------------------------------- Systime& Systime::operator=(const Systime& rhs) { // guard against self-assignment if (this != &rhs) { _tv = rhs._tv; _tp = localtime ((time_t *) &_tv.tv_sec); } return *this; } //--------------------------------------------------------------------------- // // Systime::operator-() // // Assignment operator overload // //--------------------------------------------------------------------------- Systime Systime::operator-(const Systime st) { Systime temp; temp._tv.tv_sec = _tv.tv_sec - st._tv.tv_sec; temp._tv.tv_usec = _tv.tv_usec - st._tv.tv_usec; temp._tp = localtime ((time_t *) &_tv.tv_sec); return temp; } //--------------------------------------------------------------------------- // // Systime::refresh () // // Update the time. Read the clock again. // //--------------------------------------------------------------------------- void Systime::refresh () throw (EH_system) { // Get the time from the system clock if (gettimeofday (&_tv, (struct timezone *) 0) == -1) { EH_system e ("can't get system time"); throw e; } // Convert them, assign to our structures _tp = localtime ((time_t *) &_tv.tv_sec); } //--------------------------------------------------------------------------- // // Systime::hms () // // Return HH:MM:SS // //--------------------------------------------------------------------------- string Systime::hms () { char timestr[TIMESTR_LEN]; strftime (timestr, TIMESTR_LEN, "%T", _tp); string s = timestr; return s; } //--------------------------------------------------------------------------- // // Systime::month () // // Return the month in a string // //--------------------------------------------------------------------------- string Systime::month () { char timestr[TIMESTR_LEN]; strftime (timestr, TIMESTR_LEN, "%B", _tp); string s = timestr; return s; } //--------------------------------------------------------------------------- // // Systime::day () // // Return the day (e.g., "monday") in a string // //--------------------------------------------------------------------------- string Systime::day () { char timestr[TIMESTR_LEN]; strftime (timestr, TIMESTR_LEN, "%A", _tp); string s = timestr; return s; } //--------------------------------------------------------------------------- // // Systime::unix_ctime () // // Return time in UNIX ctime () format // //--------------------------------------------------------------------------- string Systime::unix_ctime () { time_t tmp; string s; // Convert the time tmp = mktime (_tp); s = ctime (&tmp); return s; } genparse-0.9.1/src/lexer.ll0000644000076600001440000002720711347173775012536 00000000000000/* * $Id: lexer.ll,v 1.24 2010/03/14 14:51:17 mgeng Exp $ * * Copyright (C) 2000, 2006, 2007, 2008 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ %option yylineno %option noyywrap %{ /* * Definitions section */ #include #include #include "clparam.h" #include "parser.h" #include "genparse.h" /* * Help with debugging */ #ifdef DEBUG #define return_token(x) { fprintf (stderr,"LEX: Token %s: '%s'\n",#x,yytext); return x; } #else #define return_token(x) { return (x); } #endif #define MAX_INCLUDE_DEPTH 10 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; int include_stack_ptr = 0; int old_start_condition; int brace_level; %} /* * More definitions */ range1 ".." range2 "..." char [A-Za-z] first_str ^[A-Za-z0-9]+ digit [0-9] alnum [\-a-zA-Z_0-9]+(\.[0-9]+)? c_var [a-zA-Z_][a-zA-Z_0-9]* file [a-zA-Z_][a-zA-Z_0-9/\-]*[\.a-zA-Z_0-9/\-]* opt_name [a-zA-Z_0-9|{}]+ whitespace [ \t\n] doublequote [\"] any . empty_line ^\n any_line .* code_line [^()\n]* comment_str [^()\n]* func_spec "()" space [ \t] %x usage include include_doublequote gp_include comment __code__ %s before_type after_type %% {whitespace}* ; /* do nothing on whitespace */ "/*" { /* Ignore C comments */ int c1 = 0; int c2 = yyinput (); for (;;) { if (c2 == EOF) break; if (c1 == '*' && c2 == '/') break; c1 = c2; c2 = yyinput (); } } "NONE" { BEGIN (before_type); return_token (NONE); } {first_str} { BEGIN (before_type); yylval.str = strdup (yytext); return_token (FIRST_STR); } "{" return_token (OPEN_BRACE); "}" return_token (CLOSE_BRACE); "[" return_token (OPEN_SQUARE_BRACE); "]" return_token (CLOSE_SQUARE_BRACE); "(" return_token (OPEN_ROUND_BRACE); ")" return_token (CLOSE_ROUND_BRACE); "/" return_token (SLASH); "int" { BEGIN (after_type); return_token (INT); } "long" { BEGIN (after_type); return_token (LONG); } "ulong" { BEGIN (after_type); return_token (ULONG); } "intmax" { BEGIN (after_type); return_token (INTMAX); } "uintmax" { BEGIN (after_type); return_token (UINTMAX); } "float" { BEGIN (after_type); return_token (FLOAT); } "double" { BEGIN (after_type); return_token (DOUBLE); } "char" { BEGIN (after_type); return_token (CHAR); } "string" { BEGIN (after_type); return_token (STRING); } "flag" { BEGIN (after_type); return_token (FLAG); } "#include" { old_start_condition = YY_START; BEGIN (include); return_token (INCLUDE); } "<" return_token (LT); ">" return_token (GT); {doublequote} return_token (DOUBLEQUOTE); "<" return_token (LT); ">" { BEGIN (old_start_condition); return_token (GT); } {doublequote} { BEGIN (include_doublequote); return_token (DOUBLEQUOTE); } {doublequote} { BEGIN (old_start_condition); return_token (DOUBLEQUOTE); } "=" return_token (EQUAL); "*" return_token (ASTERISK); "!" return_token (EXCLAMATIONMARK); "," return_token (COLON); "#mandatory" return_token (MANDATORY); "#exit_value" return_token (EXIT_VALUE); "#break_lines" return_token (BREAK_LINES); "#export_long_options" return_token (EXPORT_LONG_OPTIONS); "#no_struct" return_token (NO_STRUCT); "__ERR_MSG__" return_token (ERR_MSG); "__DO_NOT_DOCUMENT__" return_token (DO_NOT_DOCUMENT); "__ADD_FLAG__" return_token (ADD_FLAG); "__COMMENT__" { old_start_condition = YY_START; BEGIN (comment); return_token (COMMENT); } "(" return_token (OPEN_ROUND_BRACE); ")" { BEGIN (old_start_condition); return_token (CLOSE_ROUND_BRACE); } {comment_str} { yylval.str = strdup (yytext); return_token (COMMENT_STR); } "__STORE_LONGINDEX__" return_token (STORE_LONGINDEX); "#usage_begin" BEGIN (usage); "#usage_end" BEGIN (0); "__CODE__" { old_start_condition = YY_START; brace_level = 0; BEGIN (__code__); } <__code__>"(" { brace_level++; if (brace_level > 1) return (OPEN_ROUND_BRACE); } <__code__>")" { brace_level--; if (brace_level < 0) throw EH ("unexpected ) at " + string(yytext)); if (brace_level > 0) { return (CLOSE_ROUND_BRACE); } else { BEGIN (old_start_condition); return (CODE_END); } } <__code__>{code_line} { if (brace_level <= 0) throw EH ("missing opening ( at " + string(yytext)); yylval.str = strdup (yytext); return_token (CODE_LINE); } <__code__>\n { return_token (CODE_END); } {c_var} { yylval.str = strdup (yytext); return_token (C_VAR); } {func_spec} return_token (FUNC_SPEC); {c_var}/{space}*{func_spec} { yylval.str = strdup (yytext); return_token (FUNCTION); } {file} { yylval.str = strdup (yytext); return_token (FILENAME); } {opt_name} { yylval.str = strdup (yytext); return_token (OPT_NAME); } {alnum} { yylval.str = strdup (yytext); return_token (ALNUM); } {range1} return_token (RANGE_SPEC1); {range2} return_token (RANGE_SPEC2); ^"\""[^\"]*"\"" { yylval.str = strdup (yytext+1); yylval.str[strlen (yylval.str)-1]='\0'; return_token (FIRST_QUOTED); } "\""[^\"]*"\"" { yylval.str = strdup (yytext+1); yylval.str[strlen (yylval.str)-1]='\0'; return_token (QUOTED); } "\'"[^\'\n]*"\'" { yylval.str = strdup (yytext); return_token (CHAR_VAL); } {any} { /* error */ fprintf (stderr,"parser error in line %d ('%s') \n",yylineno,yytext); exit (1); } {any_line} { yylval.str = strdup (yytext); return_token (USAGE_LINE); } {empty_line} { yylval.str = strdup (""); return_token (USAGE_LINE); } <*>.|\n /* Don't print unmatched characters in start conditions */ "#gp_include" { old_start_condition = YY_START; BEGIN (gp_include); return_token (GP_INCLUDE); } {whitespace}*; /* do nothing on whitespace */ {file} { /* include file name */ if (include_stack_ptr >= MAX_INCLUDE_DEPTH) throw EH ("gp_includes nested too deeply"); include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; yyin = fopen (yytext, "r"); if (!yyin) throw EH ("failed to open gp_include file " + string(yytext)); yy_switch_to_buffer (yy_create_buffer (yyin, YY_BUF_SIZE)); BEGIN (old_start_condition); yylval.str = strdup (yytext); return_token (FILENAME); } <> { if (--include_stack_ptr < 0) { yyterminate (); } else { yy_delete_buffer (YY_CURRENT_BUFFER); yy_switch_to_buffer (include_stack[include_stack_ptr]); } } %% genparse-0.9.1/src/clparam.h0000644000076600001440000001365711716257231012650 00000000000000/** @file clparam.h \brief Class definition for a single command line parameter */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CLPARAM_H #define CLPARAM_H #include #include #include "cldesc.h" #include "logfile.h" // valid types of parameters enum param_type { null_type = 0, int_type, long_type, ulong_type, intmax_type, uintmax_type, float_type, double_type, char_type, string_type, flag_type }; enum has_arg_type { no_argument = 0, required_argument, optional_argument, argument_undefined }; /** \brief Contains information for 1 command line parameter. */ class Clparam { private: string _short_reps; // single letter representation string _long_rep; // string representation string _opt_name; // e.g. SIZE in --block-size=SIZE, only used on help screen bool _opt_name_in_square_braces; // e.g. in --block*[=SIZE] param_type _type; string _default_value; string _low_range; string _high_range; string _callback; string _err_msg; string _err_msg_conv; string _comment; list _descriptions; list _code_lines; int _longopt_value; bool _long_only; bool _store_longindex; bool _do_not_document; bool _add_flag; has_arg_type _short_has_arg; has_arg_type _long_has_arg; public: // Constructor, destructor and copy constructor Clparam (); ~Clparam () {} Clparam& operator=(const Clparam &); // functions to set the values void set_short_reps (const string &s) { _short_reps = s; } void set_long_rep (const string &s) { _long_rep = s; } void set_opt_name (const string &s) { _opt_name = s; } void set_opt_name_in_square_braces (bool b) { _opt_name_in_square_braces = b; } void set_type (param_type t) { _type = t; } void set_default_value (const string &s) { _default_value = s; } void set_low_range (const string &s) { _low_range = s; } void set_high_range (const string &s) { _high_range = s; } void set_callback (const string &s) { _callback = s; } void set_err_msg (const string &s) { _err_msg = s; } void set_err_msg_conv (const string &s) { _err_msg_conv = s; } void set_comment (const string &s) { _comment = s; } void add_description (const string &description, bool start_1st_col = false); void set_longopt_value (int i) { _longopt_value = i; } void set_long_only (bool b) { _long_only = b; } void set_store_longindex (bool b) { _store_longindex = b; } void set_do_not_document (bool b) { _do_not_document = b; } void set_add_flag (bool b) { _add_flag = b; } void set_short_has_arg (has_arg_type x) { _short_has_arg = x; } void set_long_has_arg (has_arg_type x) { _long_has_arg = x; } void add_code_line (const string & s) { _code_lines.push_back (s); } // functions to retrieve the values bool requires_additional_flag_arg (void) const; char get_short_rep (unsigned int i) const; const string get_short_reps (void) const { return _short_reps; } unsigned int get_num_short_reps (void) const { return _short_reps.length (); } bool contains (char c) const; const string &get_long_rep (void) const { return _long_rep; } const string &get_opt_name (void) const { return _opt_name; } bool get_opt_name_in_square_braces (void) const { return _opt_name_in_square_braces; } param_type get_type (void) const { return _type; } const string &get_default_value (void) const { return _default_value; } const string &get_low_range (void) const { return _low_range; } const string &get_high_range (void) const { return _high_range; } const string &get_callback (void) const { return _callback; } const string &get_err_msg (void) const { return _err_msg; } const string &get_err_msg_conv (void) const { return _err_msg_conv; } const string &get_comment (void) const { return _comment; } int get_longopt_value (void) const { return _longopt_value; } bool get_long_only (void) const { return _long_only; } bool get_store_longindex (void) const { return _store_longindex; } bool get_do_not_document (void) const { return _do_not_document; } bool get_add_flag (void) const { return _add_flag; } has_arg_type get_short_has_arg (void) const { return _short_has_arg; } has_arg_type get_long_has_arg (void) const { return _long_has_arg; } list get_description (unsigned int indentation, unsigned int additional_indentation_following_lines, int break_lines) const; const list &get_code_lines (void) const { return _code_lines; } void normalize_code_lines_indentation (void); bool has_callback (void) const { return !_callback.empty (); } void logdump (Logfile&) const; }; #endif // CLPARAM_H genparse-0.9.1/src/genparse.cc0000644000076600001440000001351211716257231013161 00000000000000/** @file genparse.cc \brief main () function of the command-line parser generator */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "genparse.h" #include "logfile.h" #include "clparam_list.h" #include "clparam_list_factory.h" #include "parse_cl.h" #include "unique_int.h" // Characters are 0-255, so this the first safe value const int FIRST_LONGOPT_VALUE = 256; char *yyfilename; extern FILE *yyin; extern int yyparse (); extern int yydebug; // This is the cat's pajamas - the main object Clparam_list *my_params = NULL; // Declare the logfile object globally so that we can access if from // everywhere Logfile mylog; // The object that will give us longopt numbers Unique_Int longopt_value (FIRST_LONGOPT_VALUE); /*--------------------------------------------------------------------------- * * add_extra_params () * * Add -h, -v *-------------------------------------------------------------------------*/ void add_extra_params (void) { Clparam *p; // if any of the extra parameters are not already set, add them now // start with help mylog.write ("Adding -h / --help parameter"); if (!my_params->contains ("help")) { p = new Clparam (); if (!my_params->contains ('h')) p->set_short_reps (string ("h")); else p->set_long_only (true); p->set_long_rep ("help"); p->set_type (flag_type); p->add_description ("Display this help and exit."); my_params->add (*p); delete p; } // version mylog.write ("Adding -v / --version parameter"); if (!my_params->contains ("version")) { p = new Clparam (); if (!my_params->contains ('v')) p->set_short_reps (string ("v")); else p->set_long_only (true); p->set_long_rep ("version"); p->set_type (flag_type); p->add_description ("Output version information and exit."); my_params->add (*p); delete p; } } /*--------------------------------------------------------------------------- * * main () * *-------------------------------------------------------------------------*/ int main (int argc, char *argv[]) { // Parse my command line parameters // Here's the lowdown: // d = debug (logging) flag // f = filename of log file // o = filename of output file Cmdline cl (argc, argv); // if the user just wants help or the version, do that now then quit if (cl.v ()) { cout << PACKAGE << " v" << VERSION << endl; exit (0); } if (cl.h ()) cl.usage (0); Clparam_list_factory factory; my_params = factory.Create_Clparam_list (cl.l ()); // set quiet mode if specified if (cl.q ()) my_params->set_quiet (); // for debugging purposes, it is useful to traverse the list and make sure // it really has everything that we gave it my_params->logdump (mylog); // set the parsing function / class my_params->set_parsefunc (cl.p ()); // set the directory for output files my_params->set_directory (cl.D ()); // set the c++ extension my_params->set_cppext (cl.c ()); // set longmembers flag (use of long member names in parser class) my_params->set_longmembers (cl.m ()); // set internationalization flag (put internationalization macro _() arount help text) my_params->set_internationalization (cl.i ()); // set --static-headers flag (don't add creation date, user name, kernel version etc.) my_params->set_static_headers (cl.s ()); // set flag if Gnu Portability Library (Gnulib) shall be used my_params->set_use_gnulib (cl.g ()); /** set flag specifying if every command line parameter shall be output in a separate print command */ my_params->set_many_prints (cl.P ()); // make sure that we've got a file to parse if (cl.next_param () >= argc) throw EH ("Must include a genparse file on the command line."); // Start the log file if debugging mode is turned on if (cl.d ()) { mylog.open (cl.f ()); yydebug= 1; } // Open the .gp file for parsing in C style so that the yacc code works FILE *fp = fopen (argv[cl.next_param ()], "r"); if (fp == NULL) throw EH ("can't open input genparse file: " + (string) argv[cl.next_param ()]); yyin = fp; mylog.write ("opened input file: " + (string) argv[cl.next_param ()]); // set the filename and run the parser on the .gp file yyfilename = argv[cl.next_param ()]; if (yyparse ()) exit (1); // add --help and --version params if not already defined add_extra_params (); // required after parsing my_params->post_parser_adjust (); if (!my_params->has_usage ()) { /* No usage function defined in the Genparse file => set default */ my_params->append_usage_line ("usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ __MANDATORIES__"); my_params->append_usage_line ("__GLOSSARY__"); } // if we got here, it parsed successfully, now we clean up a little fclose (fp); mylog.write ("done reading input file"); mylog.write_separator (); // Now we write the output files my_params->output (cl.o ()); // Close the log file before we leave mylog.close (); // quit, and do it nicely! exit (0); } genparse-0.9.1/src/java_clparam_list.h0000644000076600001440000000466011716257231014676 00000000000000/** @file java_clparam_list.h \brief C++ implementation of the command line parser */ /* * Copyright (C) 2006 - 2012 * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef JAVA_CLPARAM_LIST_H #define JAVA_CLPARAM_LIST_H #include #include "clparam_list.h" /** \brief Java implementation of class Clparam_list Generates Java output files for parsing a command line. 3 Files can be generated: - a Java source file with the class definition - a Java source file containing the parser class implementation - a Java source file containing callback functions */ class Java_Clparam_list: public Clparam_list { private: void output_print_command (ofstream& o, const string &text) const; void check_parameters (void) const; void output_comments_object (ofstream& o, string classname, string comment, string objectname) const; const string string_type_str (void) const { return "String"; } const string boolean_type_str (void) const { return "boolean"; } /** get the class name of the interface for the parser class */ const string get_interface_name (void) const { return get_parsefunc () + "Interface"; } /** get the class name of the exception class thrown by the parser class */ const string get_exception_class_name (void) const { return get_parsefunc () + "Ex"; } // output Java code void output_exception_class ( void) const throw (EH); void output_interface ( string filename_without_extension) const throw (EH); void output_implementation (string filename_without_extension) const throw (EH); void output_callbacks ( string filename_without_extension) const throw (EH); public: Java_Clparam_list () { set_exit_value ("-1"); } ~Java_Clparam_list () {} void set_use_gnulib (bool b) throw (EH); }; #endif // JAVA_CLPARAM_LIST_H genparse-0.9.1/src/Makefile.am0000644000076600001440000000125010733746160013100 00000000000000AM_CXXFLAGS = -Wall YACC = bison -y -d bin_PROGRAMS = genparse dist-hook: genparse genparse_SOURCES = getopt.cc getopt.h eh.cc eh.h eh_system.cc eh_system.h systime.cc systime.h \ userinfo.cc userinfo.h sysinfo.cc sysinfo.h logfile.cc logfile.h unique_int.cc unique_int.h \ clparam.cc clparam.h clparam_list.cc clparam_list.h parse_cl.cc parse_cl.h genparse.cc \ genparse.h parser.yy parser.h lexer.ll c_clparam_list.cc c_clparam_list.h cpp_clparam_list.cc \ cpp_clparam_list.h clparam_list_factory.h clparam_list_factory.cc genparse_util.cc \ genparse_util.h java_clparam_list.h java_clparam_list.cc cldesc.cc cldesc.h genparse_LDADD = CLEANFILES = genparse.log *~ genparse-0.9.1/src/clparam_list.h0000644000076600001440000001756511716257231013705 00000000000000/** @file clparam_list.h \brief Definition of the class which generates the command line parser */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CLPARAM_LIST_H #define CLPARAM_LIST_H #include #include #include #include "clparam.h" #include "eh.h" /** \brief Gererates the source files which form the command line parser. */ class Clparam_list { private: list _params; string _global_callback; list _include_list; list _mandatory_list; string _parsefunc; string _directory; string _cppext; string _exit_value; bool _quiet; bool _longmembers; bool _internationalization; bool _static_headers; bool _export_long_options; bool _use_gnulib; bool _many_prints; bool _no_struct; int _break_lines; list _usage_list; bool parameters_have_callbacks (void) const; bool long_only (void) const; string get_options_string (void) const; list get_glossary (void) const; list get_glossary_gnu (unsigned int indentation = 24) const; string get_mandatories_string (void) const; /** Check if the combination of parameters fit together */ virtual void check_parameters (void) const {}; // Language specific methods which must be defined in sub classes in order to let output () work virtual void output_interface ( const string filename_without_extension) const throw (EH) {} virtual void output_implementation (const string filename_without_extension) const throw (EH) {} virtual void output_callbacks ( const string filename_without_extension) const throw (EH) {} protected: bool have_callbacks (void) const; const string type2str (const param_type t) const; bool contains (const Clparam &p) const; const list &get_params (void) const; /** get name of global callback function */ const string &get_global_callback (void) const { return _global_callback; } string const get_parameter_name (const Clparam ¶m) const; virtual const string string_type_str (void) const { return "char *"; } virtual const string boolean_type_str (void) const { return "bool"; } string::size_type parse_macro (string::size_type &arg_start_pos, string::size_type &arg_end_pos, string::size_type &closing_bracket_pos, const string ¯o, const string &line) const; list get_usage (void) const; // These are for any language void output_comments_header (ofstream& o, const string &filename, const string &purpose) const; void output_function_comment (ofstream& o, const string &function_name, const string &comment) const; void output_includes (ofstream& o) const; public: // Constructor, destructor and copy constructor Clparam_list (); virtual ~Clparam_list () {} Clparam_list& operator= (const Clparam_list &); void add (const Clparam &p) throw (EH); /** Add an include file */ void add_include (const string &s) { _include_list.push_back (s); } /** Add a mandatory */ void add_mandatory (const string &s) { _mandatory_list.push_back (s); } /** Set name of global callback function */ void set_global_callback (const string &s) { _global_callback = s; } /** set the parsing function / class name */ void set_parsefunc (const string s) { _parsefunc = s; } /** set the directory for output files */ void set_directory (const string s) { _directory = s; } /** get the parsing function / class name */ const string &get_parsefunc (void) const { return _parsefunc; } /** get the directory for output files */ const string &get_directory (void) const { return _directory; } /** set the c++ extension */ void set_cppext (const string s) { _cppext = s; } /** set the exit value for the case of a failure exit */ void set_exit_value (const string s) { _exit_value = s; } /** get the c++ extension */ const string &get_cppext (void) const { return _cppext; } /** get the exit value for the case of a failure exit */ const string &get_exit_value (void) const { return _exit_value; } /** set longmembers flag (use of long member names in parser class) */ void set_longmembers (bool b) { _longmembers = b; } /** get longmembers flag (use of long member names in parser class) */ bool get_longmembers (void) const { return _longmembers; } /** set internationalization flag (put internationalization macro _() arount help text) */ void set_internationalization (bool b) { _internationalization = b; } /** get internationalization flag (put internationalization macro _() arount help text) */ bool get_internationalization (void) const { return _internationalization; } /** set --static-headers flag (don't add creation date, user name, kernel version etc.) */ void set_static_headers (bool b) { _static_headers = b; } /** get --static-headers flag (don't add creation date, user name, kernel version etc.) */ bool get_static_headers (void) const { return _static_headers; } /** Set width of help scren. Longer lines will be broken. -1 means: don't break lines automatically. */ void set_break_lines (const char *width) { _break_lines = atoi (width); } /** get width of help scren. */ int get_break_lines (void) const { return _break_lines; } /** add a function get_long_options () which exports the long_options array used by getopt_long */ void set_export_long_options (bool b) { _export_long_options = b; } /** get flag for adding a function get_long_options () which exports the long_options array used by getopt_long */ bool get_export_long_options (void) const { return _export_long_options; } /** set flag if Gnu Portability Library (Gnulib) shall be used */ virtual void set_use_gnulib (bool b) { _use_gnulib = b; } /** get flag if Gnu Portability Library (Gnulib) shall be used */ bool get_use_gnulib (void) const { return _use_gnulib; } /** set flag which specifies if every command line parameter shall be output in a separate print command */ virtual void set_many_prints (bool b) { _many_prints = b; } /** get flag which specifies if every command line parameter shall be output in a separate print command */ bool get_many_prints (void) const { return _many_prints; } /** get flag which specifies if no struct / class for parsing results shall be generated */ bool get_no_struct (void) const { return _no_struct; } /** set flag which specifies if no struct / class for parsing results shall be generated */ void set_no_struct (bool b) { _no_struct = b; } /** set quiet mode */ void set_quiet (void) { _quiet = true; } /** get quiet mode */ bool get_quiet (void) const { return _quiet; } /** Appends a line to the explanation of the usage of the generated program */ void append_usage_line (string s) { _usage_list.push_back (s); } /** Return true is a usage text is defined */ bool has_usage (void) const { return !_usage_list.empty (); } bool contains (const char c) const; bool contains (const string s) const; void logdump (Logfile&) const; void post_parser_adjust (void); void output (const string filename_without_extension) const; }; #endif // CLPARAM_LIST_H genparse-0.9.1/src/c_clparam_list.cc0000644000076600001440000010674311716257231014342 00000000000000/** @file c_clparam_list.cc \brief Methods for the C implementation of the command line parser */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "c_clparam_list.h" #include "sysinfo.h" #include "systime.h" #include "userinfo.h" #include "genparse_util.h" using genparse_util::full_path; using genparse_util::str2C; /** Helper function for output_usage (). Output one print command. Uses the "print" command if there are arguments (args not empty), "puts" otherwise. */ void C_Clparam_list::output_print_command ( /** open stream where to print */ ofstream& o, /** body of the message */ const string &text, /** list of arguments with colons between them, e.g. ", x, y" */ const string &args) const { string usage_string; usage_string = "\"\\\n"; o << " "; /* puts () always prints trailing newline "\n", so it can only be used if the string which has to be printed ends with a newline. */ if (args.empty () && (text.length () >= 2) && (text.substr (text.length () - 2, 2) == "\\n")) { o << "puts"; /* Do not print the trailing "\n" if the command is puts. */ usage_string += text.substr (0, text.length () - 2); } else { o << "printf"; usage_string += text; } usage_string += '\"'; o << " ("; if (get_internationalization ()) o << add_i18n_macro (usage_string); else o << usage_string; o << args << ");" << endl; } /** Output the usage function */ void C_Clparam_list::output_usage (ofstream& o) const { list::const_iterator iter; ostringstream usage_stream, arg_stream; // comments output_function_comment (o, "usage", "Print out usage information, then exit"); // declaration o << endl; o << "void usage (int status, char *program_name)" << endl; o << "{" << endl; o << " if (status != EXIT_SUCCESS)" << endl; o << " fprintf (stderr, "; string s ("\"Try `%s --help' for more information.\\n\""); if (get_internationalization ()) o << add_i18n_macro (s); else o << s; o << ',' << endl; o << " program_name);" << endl; o << " else" << endl; o << " {" << endl; list usage_list = get_usage (); for (iter = usage_list.begin (); iter != usage_list.end (); iter++) { string::size_type macro_pos, arg_start_pos, arg_end_pos, closing_bracket_pos; bool line_manipulated; string line = *iter; do { if ((macro_pos = line.find (string ("__PROGRAM_NAME__"))) != string::npos) { line.replace (macro_pos, 16, string ("%s")); arg_stream << ", program_name"; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__STRING__", line)) != string::npos) { arg_stream << ", " << string (line, arg_start_pos, arg_end_pos - arg_start_pos + 1); line.replace (macro_pos, closing_bracket_pos - macro_pos + 1, string ("%s")); } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__INT__", line)) != string::npos) { arg_stream << ", " << string (line, arg_start_pos, arg_end_pos - arg_start_pos + 1); line.replace (macro_pos, closing_bracket_pos - macro_pos + 1, string ("%d")); } } while (macro_pos != string::npos); if (line.find ("__DO_NOT_DOCUMENT__") == string::npos) { line_manipulated = false; do { if ((macro_pos = line.find (string ("__NEW_PRINT__"))) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << string (line, 0, macro_pos); usage_stream << "\\n"; } if (!usage_stream.str ().empty ()) output_print_command (o, usage_stream.str (), arg_stream.str ()); usage_stream.str (""); arg_stream.str (""); /* Remove __NEW_PRINT__ and any characters before */ line.erase (0, macro_pos + 13); line_manipulated = true; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__CODE__", line)) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << string (line, 0, macro_pos); usage_stream << "\\n"; } if (!usage_stream.str ().empty ()) output_print_command (o, usage_stream.str (), arg_stream.str ()); o << " " << line.substr (arg_start_pos, closing_bracket_pos - arg_start_pos) << endl; usage_stream.str (""); arg_stream.str (""); /* Remove __CODE__() and any characters before */ line.erase (0, closing_bracket_pos + 1); line_manipulated = true; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__COMMENT__", line)) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << string (line, 0, macro_pos); usage_stream << "\\n"; } if (!usage_stream.str ().empty ()) output_print_command (o, usage_stream.str (), arg_stream.str ()); usage_stream.str (""); arg_stream.str (""); o << " /* " << line.substr (arg_start_pos, closing_bracket_pos - arg_start_pos) << " */" << endl; /* Remove __COMMENT__() and any characters before */ line.erase (0, closing_bracket_pos + 1); line_manipulated = true; } } while (macro_pos != string::npos); if (!line_manipulated || !line.empty ()) { if (!usage_stream.str ().empty ()) usage_stream << "\\" << endl; usage_stream << line << "\\n"; } } } if (!usage_stream.str ().empty ()) output_print_command (o, usage_stream.str (), arg_stream.str ()); // back matter o << " }" << endl; o << " exit (status);" << endl; o << "}" << endl; } /** Output the get_long_options function */ void C_Clparam_list::output_get_long_options (ofstream& o) const { // comments output_function_comment (o, "get_long_options", "Return long_options struct"); o << endl; o << "struct option const *get_long_options (void)" << endl; o << "{" << endl; o << " return long_options;" << endl; o << "}" << endl; } /** Returns true if the parser interface (include file) requires xstrtol.h */ bool C_Clparam_list::interface_requires_xstrtol_h (void) const { list params = get_params (); list::const_iterator iter; for (iter = params.begin (); iter != params.end (); iter++) { if ((iter->get_type () == intmax_type) || (iter->get_type () == uintmax_type)) return true; } return false; } /** Returns true if the parser implementation (.c file) requires error.h */ bool C_Clparam_list::implementation_requires_error_h (void) const { list params = get_params (); list::const_iterator iter; for (iter = params.begin (); iter != params.end (); iter++) { if ((iter->get_type () == long_type) || (iter->get_type () == ulong_type) || (iter->get_type () == intmax_type) || (iter->get_type () == uintmax_type) || (iter->get_type () == double_type)) return true; } return false; } /** Returns true if the parser implementation (.c file) requires xstrtol.h */ bool C_Clparam_list::implementation_requires_xstrtol_h (void) const { list params = get_params (); list::const_iterator iter; for (iter = params.begin (); iter != params.end (); iter++) { if ((iter->get_type () == long_type) || (iter->get_type () == ulong_type) || (iter->get_type () == intmax_type) || (iter->get_type () == uintmax_type)) return true; } return false; } /** Returns true if the parser implementation (.c file) requires xstrtod.h */ bool C_Clparam_list::implementation_requires_xstrtod_h (void) const { list params = get_params (); list::const_iterator iter; for (iter = params.begin (); iter != params.end (); iter++) { if (iter->get_type () == double_type) return true; } return false; } /** Returns true if the parser implementation (.c file) requires strtod.h */ bool C_Clparam_list::implementation_requires_strtod_h (void) const { return implementation_requires_xstrtod_h (); } /** Output the C header file containing the interface of the parser class */ void C_Clparam_list::output_interface (const string filename_without_extension) const throw (EH) { // make file .h extension const string filename = filename_without_extension + ".h"; const string path = full_path (get_directory (), filename); list params = get_params (); list::const_iterator iter; // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the header file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Header file for command line parser"); // print the includes o << "#include " << endl; if (interface_requires_xstrtol_h()) o << "#include \"xstrtol.h\"" << endl; // add include files specified in the genparse (.gp) file output_includes (o); // add a bool type for C o << "#ifndef bool" << endl; o << "typedef enum bool_t" << endl; o << "{" << endl; o << " false = 0, true" << endl; o << "} bool;" << endl; o << "#endif" << endl << endl; if (!get_no_struct ()) { o << "/* customized structure for command line parameters */" << endl; o << "struct arg_t" << endl; o << "{" << endl; for (iter = params.begin (); iter != params.end (); iter++) { o << " " << type2str (iter->get_type ()) << ' ' << get_parameter_name (*iter) << ';' << endl; if (iter->requires_additional_flag_arg ()) o << " " << type2str (flag_type) << ' ' << get_parameter_name (*iter) << "_flag;" << endl; if (iter->get_store_longindex ()) o << " " << type2str (int_type) << ' ' << get_parameter_name (*iter) << "_li;" << endl; } o << " int optind;" << endl; o << "};" << endl << endl; } // function prototypes o << "/* function prototypes */" << endl; o << "void " << get_parsefunc () << " ("; if (!get_no_struct ()) o << "struct arg_t *my_args, "; o << "int argc, char *argv[]);" << endl; o << "void usage (int status, char *program_name);" << endl; if (get_export_long_options ()) o << "struct option const *get_long_options (void);" << endl; // more prototypes, for the callbacks, global and local if (have_callbacks ()) { list param_callback_list; o << endl; o << "/* callback functions */" << endl; /* global callback function */ if (!get_global_callback ().empty ()) o << "int " << get_global_callback () << " (struct arg_t *);" << endl << endl; /* parameter related callbacks */ for (iter = params.begin (); iter != params.end (); iter++) { if (!iter->get_callback ().empty ()) /* Print every callback function only once, no matter how many parameters use it. */ if (find (param_callback_list.begin (), param_callback_list.end (), iter->get_callback ()) == param_callback_list.end ()) { o << "int " << iter->get_callback () << " (" << type2str (iter->get_type ()) << ");" << endl; param_callback_list.push_back (iter->get_callback ()); } } } if (!o) throw EH ("can't write to file: " + path); // close the header file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } /** Output the C source file containing the implementation of the parser struct */ void C_Clparam_list::output_implementation (const string filename_without_extension) const throw (EH) { list params = get_params (); list::const_iterator iter; // make file .c extension const string filename = filename_without_extension + ".c"; const string path = full_path (get_directory (), filename); // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the c file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "C file for command line parser"); // print the includes o << "#include " << endl; o << "#include " << endl; o << "#include " << endl; if (implementation_requires_error_h ()) o << "#include \"error.h\"" << endl; if (implementation_requires_xstrtol_h ()) o << "#include \"xstrtol.h\"" << endl; if (implementation_requires_xstrtod_h ()) o << "#include \"xstrtod.h\"" << endl; if (implementation_requires_strtod_h ()) { if (get_internationalization ()) o << "#include \"c-strtod.h\"" << endl; else o << "#include \"xstrtod.h\"" << endl; } o << "#include \"" << filename_without_extension + ".h" << "\"" << endl << endl; // write the options structure o << "static struct option const long_options[] =" << endl; o << "{" << endl; for (iter = params.begin (); iter != params.end (); iter++) { if (iter->get_long_rep ().length () > 0) { o << " {\"" << iter->get_long_rep () << "\", "; switch (iter->get_long_has_arg ()) { case no_argument: o << "no_argument"; break; case optional_argument: o << "optional_argument"; break; case required_argument: o << "required_argument"; break; default: break; } o << ", NULL, "; if (iter->get_long_only ()) o << iter->get_longopt_value (); else o << '\'' << iter->get_short_rep (0) << '\''; o << "}," << endl; } } o << " {NULL, 0, NULL, 0}" << endl; o << "};" << endl << endl; // comments output_function_comment (o, get_parsefunc (), "Parse the argv array of command line parameters"); // declaration and local vars o << endl; o << "void " << get_parsefunc () << " ("; if (!get_no_struct ()) o << "struct arg_t *my_args, "; o << "int argc, char *argv[])" << endl; o << "{" << endl; o << " extern char *optarg;" << endl; o << " extern int optind;" << endl; o << " int c;" << endl; o << " int errflg = 0;" << endl << endl; if (!get_no_struct ()) { // write initialisations for (iter = params.begin (); iter != params.end (); iter++) { switch (iter->get_type ()) { case flag_type: // all flags default to off o << " my_args->" << get_parameter_name (*iter) << " = false;" << endl; break; case string_type: // copy default if there, NULL otherwise if (!iter->get_default_value ().empty ()) o << " my_args->" << get_parameter_name (*iter) << " = \"" << iter->get_default_value () << "\";" << endl; else o << " my_args->" << get_parameter_name (*iter) << " = NULL;" << endl; break; default: // all else - copy default if there if (!iter->get_default_value ().empty ()) o << " my_args->" << get_parameter_name (*iter) << " = " << iter->get_default_value () << ";" << endl; } if (iter->requires_additional_flag_arg ()) o << " my_args->" << get_parameter_name (*iter) << "_flag = false;" << endl; if (iter->get_store_longindex ()) o << " my_args->" << get_parameter_name (*iter) << "_li = 0;" << endl; } o << endl; } // reset global optind variable, otherwise it would not be possible to instantiate the parser // class multiple times in the same program o << " optind = 0;" << endl; // Make the getopt_long () call o << " while ((c = getopt_long (argc, argv, \""; for (iter = params.begin (); iter != params.end (); iter++) { if (!iter->get_long_only ()) { o << iter->get_short_reps (); if (iter->get_short_has_arg () == required_argument) o << ':'; else if (iter->get_short_has_arg () == optional_argument) o << "::"; } } o << "\", long_options, &optind)) != - 1)" << endl; // do the switch statement o << " {" << endl; o << " switch (c)" << endl; o << " {" << endl; for (iter = params.begin (); iter != params.end (); iter++) { unsigned int indent_width; #define INDENT string (indent_width, ' ') if (iter->get_long_only ()) o << " case " << iter->get_longopt_value () << ":" << endl; else { for (unsigned int i = 0; i < iter->get_num_short_reps ();i++) o << " case '" << iter->get_short_rep (i) << "':" << endl; } indent_width = 10; if (!get_no_struct ()) { if (iter->requires_additional_flag_arg ()) { o << INDENT << "my_args->" << get_parameter_name (*iter) << "_flag = true;" << endl; o << INDENT << "if (optarg != NULL)" << endl; indent_width += 2; } if (get_use_gnulib () && ((iter->get_type () == long_type) || (iter->get_type () == ulong_type) || (iter->get_type () == intmax_type) || (iter->get_type () == uintmax_type) || (iter->get_type () == double_type))) { string err_msg; o << INDENT << "if ("; switch (iter->get_type ()) { case long_type: o << "xstrtol"; break; case ulong_type: o << "xstrtoul"; break; case intmax_type: o << "xstrtoimax"; break; case uintmax_type: o << "xstrtoumax"; break; case double_type: o << "! xstrtod"; break; default: break; } o << " (optarg, NULL"; if (iter->get_type () != double_type) o << ", 10"; o << ", &my_args->" << get_parameter_name (*iter) << ", "; if (iter->get_type () == double_type) if (get_internationalization ()) o << "c_strtod)"; else o << "strtod)"; else o << "NULL) != LONGINT_OK"; if (!iter->get_err_msg ().empty ()) { if (!iter->get_low_range ().empty ()) { o << endl; o << INDENT << " || my_args->" << get_parameter_name (*iter) << " < " << iter->get_low_range (); } if (!iter->get_high_range ().empty ()) { o << endl; o << INDENT << " || my_args->" << get_parameter_name (*iter) << " > " << iter->get_high_range (); } } o << ')' << endl; indent_width += 2; o << INDENT << "error (" << get_exit_value () << ", 0, "; if (!iter->get_err_msg ().empty ()) err_msg = iter->get_err_msg (); else err_msg = string ("\"could not convert %s to " + type2str (iter->get_type ()) + '\"'); if (get_internationalization ()) o << add_i18n_macro (err_msg); else o << err_msg; o << ", "; if (!iter->get_err_msg_conv ().empty ()) o << iter->get_err_msg_conv () << " ("; o << "optarg"; if (!iter->get_err_msg_conv ().empty ()) o << ')'; o << ");" << endl; indent_width -= 2; } else { o << INDENT << "my_args->" << get_parameter_name (*iter); switch (iter->get_type ()) { case string_type: o << " = optarg;" << endl; break; case int_type: o << " = atoi (optarg);" << endl; break; case float_type: o << " = atof (optarg);" << endl; break; case char_type: o << " = *optarg;" << endl; break; case flag_type: o << " = true;" << endl; if (iter->get_long_rep () == "help") o << INDENT << "usage (EXIT_SUCCESS, argv[0]);" << endl; break; default: break; } } if (iter->requires_additional_flag_arg ()) indent_width -= 2; // store longindex (last argument to getopt_long) if requested if (iter->get_store_longindex ()) { o << INDENT << "my_args->" << get_parameter_name (*iter) << "_li = optind;" << endl; } } // do low range checking if ((iter->get_err_msg ().empty ()) && (!iter->get_low_range ().empty ())) { o << INDENT << "if (my_args->" << get_parameter_name (*iter) << " < " << iter->get_low_range () << ")" << endl; indent_width += 2; o << INDENT << "{" << endl; indent_width += 2; o << INDENT << "fprintf (stderr, "; string s ("\"parameter range error: " + get_parameter_name (*iter) + " must be >= " + iter->get_low_range () + "\\n\""); if (get_internationalization ()) o << add_i18n_macro (s); else o << s; o << ");" << endl; o << INDENT << "errflg++;" << endl; indent_width -= 2; o << INDENT << "}" << endl; indent_width -= 2; } // do high range checking if ((iter->get_err_msg ().empty ()) && (!iter->get_high_range ().empty ())) { o << INDENT << "if (my_args->" << get_parameter_name (*iter) << " > " << iter->get_high_range () << ")" << endl; indent_width += 2; o << INDENT << "{" << endl; indent_width += 2; o << INDENT << "fprintf (stderr, "; string s ("\"parameter range error: " + get_parameter_name (*iter) + " must be <= " + iter->get_high_range () + "\\n\""); if (get_internationalization ()) o << add_i18n_macro (s); else o << s; o << ");" << endl; o << INDENT << "errflg++;" << endl; indent_width -= 2; o << INDENT << "}" << endl; indent_width -= 2; } // write user defined code for this parameter list code_lines = iter->get_code_lines (); list::const_iterator code_iter; for (code_iter = code_lines.begin (); code_iter != code_lines.end (); code_iter++) o << INDENT << *code_iter << endl; // do callbacks if (!iter->get_callback ().empty ()) { o << INDENT << "if (!" << iter->get_callback () << " (my_args->" << str2C (get_parameter_name (*iter)) << "))" << endl; indent_width += 2; o << INDENT << "usage (" << get_exit_value () << ", argv[0]);" << endl; indent_width -= 2; } // do break statement o << INDENT << "break;" << endl << endl; } // print default action for unknown parameters o << " default:" << endl; o << " usage (" << get_exit_value () << ", argv[0]);" << endl << endl; // print the end of the function, with global callback calls o << " }" << endl; o << " } /* while */" << endl << endl; o << " if (errflg)" << endl; o << " usage (" << get_exit_value () << ", argv[0]);" << endl; if (!get_global_callback ().empty ()) { o << endl; o << " if (!" << get_global_callback () << " (my_args))" << endl; o << " usage (" << get_exit_value () << ", argv[0]);" << endl; } if (!get_no_struct ()) { o << endl; o << " if (optind >= argc)" << endl; o << " my_args->optind = 0;" << endl; o << " else" << endl; o << " my_args->optind = optind;" << endl; } o << "}" << endl << endl; // dump the usage () function output_usage (o); // dump the get_long_options () function if (get_export_long_options ()) { o << endl; output_get_long_options (o); } if (!o) throw EH ("can't write to file: " + path); // close the C file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } /** Output the C source file containing the default implementation of the callback functions */ void C_Clparam_list::output_callbacks (const string filename_without_extension) const throw (EH) { list params = get_params (); list::iterator iter; // first figure out if we have to do anything at all - no callbacks = no // callback file if (have_callbacks ()) { // make the callback filename const string filename = filename_without_extension + "_cb.c"; const string path = full_path (get_directory (), filename); list param_callback_list; // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the callback file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // do the main comments output_comments_header (o, filename, "Callback routines for command line parser"); // use the header filename for the includes o << "#include " << endl; o << "#include \"" << filename_without_extension + ".h" << "\"" << endl << endl; // do the global callbacks first if (!get_global_callback ().empty ()) { output_function_comment (o, get_global_callback (), "User defined global callback."); o << endl; o << "int " << get_global_callback () << " (struct arg_t *a)" << endl; o << "{" << endl; o << " return 1;" << endl; o << "}" << endl << endl; } // do the parameter callbacks for (iter = params.begin (); iter != params.end (); iter++) if (!iter->get_callback ().empty ()) if (find (param_callback_list.begin (), param_callback_list.end (), iter->get_callback ()) == param_callback_list.end ()) { output_function_comment (o, iter->get_callback (), "User defined parameter callback."); o << endl; o << "int " << iter->get_callback () << " (" << type2str (iter->get_type ()) << " var)" << endl; o << "{" << endl; o << " return 1;" << endl; o << "}" << endl << endl; param_callback_list.push_back (iter->get_callback ()); } if (!o) throw EH ("can't write to file: " + path); // close the callback file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } } genparse-0.9.1/src/sysinfo.cc0000644000076600001440000000310611716257231013045 00000000000000/** @file sysinfo.cc \brief Methods for the system information class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "sysinfo.h" //--------------------------------------------------------------------------- // // Sysinfo::Sysinfo () // // Constructor method. Does most of the work // //--------------------------------------------------------------------------- Sysinfo::Sysinfo () throw (EH_system) { struct utsname machine; // Get the machine-specific info if (uname (&machine) == -1) { EH_system e ("can't get system info"); throw e; } // store all of the items locally _name = machine.sysname; _release = machine.release; _build = machine.version; _hardware = machine.machine; _domainname = machine.nodename; } genparse-0.9.1/src/java_clparam_list.cc0000644000076600001440000005726511716257231015045 00000000000000/** @file java_clparam_list.cc \brief Methods for the Java implementation of the command line parser */ /* * Copyright (C) 2006 - 2012 * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "java_clparam_list.h" #include "sysinfo.h" #include "systime.h" #include "userinfo.h" #include "genparse_util.h" using genparse_util::C_comment; using genparse_util::full_path; /** Helper function for output_usage (). Output one print command. */ void Java_Clparam_list::output_print_command ( /** open stream where to print */ ofstream& o, /** Text which must be printed. Must contain starting double quotes '"', ending double quotes are appended in this function. */ const string &text) const { o << " System.out.println (" << endl; o << text << "\");" << endl; } /** set flag if Gnu Portability Library (Gnulib) shall be used */ void Java_Clparam_list::set_use_gnulib (bool b) throw (EH) { if (b) throw EH ("Use of GNU Portability library not supported for Java output"); } void Java_Clparam_list::check_parameters (void) const { if (get_internationalization ()) cerr << "Warning: Internationalization not implemented for Java output" << endl; } /** Output a class comment banner */ void Java_Clparam_list::output_comments_object (ofstream& o, string classname, string comment, string objectname) const { o << "/*----------------------------------------------------------------------------" << endl; o << "**" << endl; o << "** " << objectname << ' ' << classname << endl; o << "**" << endl; o << "** " << comment << endl; o << "**" << endl; o << "**--------------------------------------------------------------------------*/" << endl; } /** Output a file containing the java exception class thrown by the parser class. */ void Java_Clparam_list::output_exception_class (void) const throw (EH) { const string filename = get_exception_class_name () + ".java"; const string path = full_path (get_directory (), filename); list params = get_params (); // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Interface of the command line parser class"); // output the definition of the exception class output_comments_object (o, get_exception_class_name (), "Exception class thrown by the command line parser class", "class"); o << endl; o << "public class " << get_parsefunc () << "Ex extends RuntimeException" << endl; o << '{' << endl; o << " public " << get_exception_class_name () << " (String text) { super (text); }" << endl; o << '}' << endl; if (!o) throw EH ("can't write to file: " + path); // close the file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } /** Output a file containing the java interface of the parser class + another file containing the exception class. */ void Java_Clparam_list::output_interface (const string filename_without_extension) const throw (EH) { // make file Interface.java const string filename = filename_without_extension + "Interface.java"; const string path = full_path (get_directory (), filename); list params = get_params (); list::const_iterator str_iter; list::const_iterator iter; if (get_no_struct ()) throw EH ("#no_struct not yet implemented for C++ output."); // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Interface of the command line parser class"); // dump the class output_comments_object (o, get_interface_name (), "Interface of the command line parser class", "interface"); o << endl; o << "public interface " << get_interface_name () << endl; o << "{" << endl; o << " " << C_comment ("usage function") << endl; o << " void usage (int status, String program_name);" << endl; o << endl; o << " " << C_comment ("return next (non-option) parameter") << endl; o << " int next_param ();" << endl; o << endl; if (have_callbacks ()) { list param_callback_list; o << " " << C_comment ("callback functions") << endl; /* global callbacks */ if (!get_global_callback ().empty ()) o << " boolean " << get_global_callback () << " ();" << endl; /* parameter related callbacks */ for (iter = params.begin (); iter != params.end (); iter++) if (!(iter->get_callback ()).empty ()) /* Print every callback function only once, no matter how many parameters use it. */ if (find (param_callback_list.begin (), param_callback_list.end (), iter->get_callback ()) == param_callback_list.end ()) { o << " boolean " << iter->get_callback () << " ();" << endl; param_callback_list.push_back (iter->get_callback ()); } o << endl; } o << " " << C_comment ("getter functions for command line parameters") << endl; for (iter = params.begin (); iter != params.end (); iter++) { o << " " << type2str (iter->get_type ()) << ' ' << get_parameter_name (*iter) << " ();" << endl; if (iter->requires_additional_flag_arg ()) o << " " << type2str (flag_type) << ' ' << get_parameter_name (*iter) << "_flag ();" << endl; if (iter->get_store_longindex ()) o << " " << type2str (int_type) << ' ' << get_parameter_name (*iter) << "_li ();" << endl; } // closing bracket for class definition o << "};" << endl; if (!o) throw EH ("can't write to file: " + path); // close the file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; output_exception_class (); } /** Output a java source file containing the implementation of the parser class */ void Java_Clparam_list::output_implementation (const string filename_without_extension) const throw (EH) { // make file extension const string filename = filename_without_extension + ".java"; const string path = full_path (get_directory (), filename); list params = get_params (); list::const_iterator str_iter; list::const_iterator iter; unsigned int i; ostringstream usage_stream; // tell the user what we're doing if (!get_quiet ()) cout << "creating " << path << "..."; // open the file ofstream o; o.open (path.c_str ()); if (!o) throw EH ("can't open file: " + path); // print a nice friendly comment banner at the beginning of the file output_comments_header (o, filename, "Definition of command line parser class"); // imports o << "import gnu.getopt.LongOpt;" << endl; o << "import gnu.getopt.Getopt;" << endl; o << endl; // comments for parser class output_function_comment (o, "class " + get_parsefunc (), "Command line parser class."); o << endl; // dump the class o << "public class " << get_parsefunc () << " implements " << get_interface_name () << endl; o << "{" << endl; o << " " << C_comment ("parameters") << endl; for (iter = params.begin (); iter != params.end (); iter++) { o << " private " << type2str (iter->get_type ()) << " _" << get_parameter_name (*iter); if (iter->get_type () == string_type) o << " = \"\""; o << ";" << endl; if (iter->requires_additional_flag_arg ()) o << " private " << type2str (flag_type) << " _" << get_parameter_name (*iter) << "_flag;" << endl; if (iter->get_store_longindex ()) o << " private " << type2str (int_type) << " _" << get_parameter_name (*iter) << "_li;" << endl; } o << endl; o << " " << C_comment ("Name of the calling program") << endl; o << " private String _executable;" << endl; o << endl; o << " " << C_comment ("next (non-option) parameter") << endl; o << " private int _optind;" << endl; o << endl; // Constructor o << " " << C_comment ("Must be constructed with parameters.") << endl; o << " public " << get_parsefunc () << " (String[] argv) throws " << get_exception_class_name () << endl; o << " {" << endl; o << " " << C_comment ("character returned by optind ()") << endl; o << " int c;" << endl; o << endl; // options structure o << " LongOpt[] longopts = new LongOpt[" << params.size () << "];" << endl; int param_no = 0; for (iter = params.begin (); iter != params.end (); iter++) { if (iter->get_long_rep ().length () > 0) { o << " longopts[" << param_no << "] = new LongOpt (\"" << iter->get_long_rep () << "\", LongOpt."; switch (iter->get_long_has_arg ()) { case no_argument: o << "NO_ARGUMENT"; break; case optional_argument: o << "OPTIONAL_ARGUMENT"; break; case required_argument: o << "REQUIRED_ARGUMENT"; break; default: break; } o << ", null, "; if (iter->get_long_only ()) o << iter->get_longopt_value (); else o << '\'' << iter->get_short_rep (0) << '\''; o << ");" << endl; param_no++; } } o << endl; o << " _executable = " << get_parsefunc () << ".class.getName ();" << endl; o << endl; // assign default values o << " " << C_comment ("default values") << endl; for (iter = params.begin (); iter != params.end (); iter++) { switch (iter->get_type ()) { case flag_type: // all flags default to off o << " _" << get_parameter_name (*iter) << " = false;" << endl; break; case string_type: // copy default if there, NULL otherwise if (!iter->get_default_value ().empty ()) o << " _" << get_parameter_name (*iter) << " = \"" << iter->get_default_value () << "\";" << endl; break; default: // all else - copy default if there if (!iter->get_default_value ().empty ()) { o << " _" << get_parameter_name (*iter) << " = " << iter->get_default_value (); if (iter->get_type () == float_type) o << "f"; o << ";" << endl; } } if (iter->requires_additional_flag_arg ()) o << " _" << get_parameter_name (*iter) << "_flag = false;" << endl; if (iter->get_store_longindex ()) o << " _" << get_parameter_name (*iter) << "_li = 0;" << endl; } o << endl; // Make the Getopt () call o << " Getopt g = new Getopt (_executable, argv, \""; for (iter = params.begin (); iter != params.end (); iter++) { if (!iter->get_long_only ()) { o << iter->get_short_reps (); if (iter->get_short_has_arg () == required_argument) o << ':'; else if (iter->get_short_has_arg () == optional_argument) o << "::"; } } o << "\", longopts);" << endl; o << " while ((c = g.getopt ()) != -1)" << endl; o << " {" << endl; // do the switch statement o << " switch (c)" << endl; o << " {" << endl; for (iter = params.begin (); iter != params.end (); iter++) { unsigned int indent_width; #define INDENT string (indent_width, ' ') if (iter->get_long_only ()) o << " case " << iter->get_longopt_value () << ": " << endl; else { for (i = 0; i < iter->get_num_short_reps ();i++) o << " case '" << iter->get_short_rep (i) << "': " << endl; } indent_width = 10; if (iter->requires_additional_flag_arg ()) { o << INDENT << '_' << get_parameter_name (*iter) << "_flag = true;" << endl; o << INDENT << "if (g.getOptarg () != null)" << endl; indent_width += 2; } o << INDENT << '_' << get_parameter_name (*iter); switch (iter->get_type ()) { case string_type: o << " = g.getOptarg ();" << endl; break; case int_type: o << " = Integer.parseInt (g.getOptarg ());" << endl; break; case float_type: o << " = Float.parseFloat (g.getOptarg ());" << endl; break; case char_type: o << " = g.getOptarg ().charAt (0);" << endl; break; case flag_type: o << " = true;" << endl; if (iter->get_long_rep () == "help") o << INDENT << "usage (0, _executable);" << endl; break; default: break; } if (iter->get_store_longindex ()) o << INDENT << '_' << get_parameter_name (*iter) << "_li = g.getLongind ();" << endl; // do low range checking if (!iter->get_low_range ().empty ()) { o << INDENT << "if (_" << get_parameter_name (*iter) << " < " << iter->get_low_range (); indent_width += 2; if (iter->get_type () == float_type) o << "f"; o << ")" << endl; o << INDENT << "throw new " << get_exception_class_name () << " (\"parameter range error: " << get_parameter_name (*iter) << " must be >= " << iter->get_low_range (); if (iter->get_type () == float_type) o << "f"; o << "\");" << endl; indent_width -= 2; } // do high range checking if (!iter->get_high_range ().empty ()) { o << INDENT << "if (_" << get_parameter_name (*iter) << " > " << iter->get_high_range (); indent_width += 2; if (iter->get_type () == float_type) o << "f"; o << ")" << endl; o << INDENT << "throw new " << get_exception_class_name () << " (\"parameter range error: " << get_parameter_name (*iter) << " must be <= " << iter->get_high_range (); if (iter->get_type () == float_type) o << "f"; o << "\");" << endl; indent_width -= 2; } // write user defined code for this parameter list code_lines = iter->get_code_lines (); list::const_iterator code_iter; for (code_iter = code_lines.begin (); code_iter != code_lines.end (); code_iter++) o << INDENT << *code_iter << endl; // do callbacks if (!iter->get_callback ().empty ()) { o << INDENT << "if (!" << iter->get_callback () << " ())" << endl; indent_width += 2; o << INDENT << "usage (" << get_exit_value () << ", _executable);" << endl; indent_width -= 2; } // do break statement o << INDENT << "break;" << endl << endl; } // print default action for unknown parameters o << " default:" << endl; o << " usage (" << get_exit_value () << ", _executable);" << endl << endl; o << " }" << endl; o << " } /* while */" << endl << endl; // save a pointer to the next argument o << " _optind = g.getOptind ();" << endl; // do global callbacks if (!get_global_callback ().empty ()) { o << " if (!" << get_global_callback () << " ())" << endl; o << " usage (" << get_exit_value () << ", _executable);" << endl << endl; } o << " }" << endl; o << endl; // usage function o << " public void " << "usage (int status, String program_name)" << endl; o << " {" << endl; o << " if (status != 0)" << endl; o << " {" << endl; o << " System.err.println (\"Try `\" + program_name + \" --help' for more information.\");" << endl; o << " }" << endl; o << " else" << endl; o << " {" << endl; list usage_list = get_usage (); for (str_iter = usage_list.begin (); str_iter != usage_list.end (); str_iter++) { string::size_type macro_pos, arg_start_pos, arg_end_pos, closing_bracket_pos; string macro_argument; bool line_manipulated; string line = *str_iter; do if ((macro_pos = line.find (string ("__PROGRAM_NAME__"))) != string::npos) line.replace (macro_pos, 16, string ("\" + program_name + \"")); while (macro_pos != string::npos); if (line.find ("__DO_NOT_DOCUMENT__") == string::npos) { line_manipulated = false; do { if ((macro_pos = line.find (string ("__NEW_PRINT__"))) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\n\" +" << endl; usage_stream << '\"' << string (line, 0, macro_pos); } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); usage_stream.str (""); /* Remove __NEW_PRINT__ and any characters before */ line.erase (0, macro_pos + 13); line_manipulated = true; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__CODE__", line)) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\n\" +" << endl; usage_stream << '\"' << string (line, 0, macro_pos); } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); o << " " << line.substr (arg_start_pos, closing_bracket_pos - arg_start_pos) << endl; usage_stream.str (""); /* Remove __CODE__() and any characters before */ line.erase (0, closing_bracket_pos + 1); line_manipulated = true; } else if ((macro_pos = parse_macro (arg_start_pos, arg_end_pos, closing_bracket_pos, "__COMMENT__", line)) != string::npos) { if (macro_pos > 0) { if (!usage_stream.str ().empty ()) usage_stream << "\\n\" +" << endl; usage_stream << '\"' << string (line, 0, macro_pos); } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); usage_stream.str (""); o << " /* " << line.substr (arg_start_pos, closing_bracket_pos - arg_start_pos) << " */" << endl; /* Remove __COMMENT__() and any characters before */ line.erase (0, closing_bracket_pos + 1); line_manipulated = true; } } while (macro_pos != string::npos); if (!line_manipulated || !line.empty ()) { if (!usage_stream.str ().empty ()) usage_stream << "\\n\" +" << endl; usage_stream << '\"' << line; } } } if (usage_stream.str ().length () > 0) output_print_command (o, usage_stream.str ()); o << " }" << endl; o << " System.exit (status);" << endl; o << " }" << endl; o << endl; o << " " << C_comment ("return next (non-option) parameter") << endl; o << " public int next_param () { return _optind; }" << endl; o << endl; if (have_callbacks ()) { list param_callback_list; o << " " << C_comment ("Callback functions") << endl; o << " " << C_comment ("Derive your own class and overwrite any of the callback ") << endl; o << " " << C_comment ("functions if you need customized callbacks.") << endl; /* global callbacks */ if (!get_global_callback ().empty ()) o << " public " << boolean_type_str () << ' ' << get_global_callback () << " () { return true; }" << endl; /* parameter related callbacks */ for (iter = params.begin (); iter != params.end (); iter++) if (!(iter->get_callback ()).empty ()) if (find (param_callback_list.begin (), param_callback_list.end (), iter->get_callback ()) == param_callback_list.end ()) { o << " public " << boolean_type_str () << ' ' << iter->get_callback () << " () { return true; }" << endl; param_callback_list.push_back (iter->get_callback ()); } o << endl; } o << " " << C_comment ("getter functions for command line parameters") << endl; for (iter = params.begin (); iter != params.end (); iter++) { o << " public " << type2str (iter->get_type ()) << ' ' << get_parameter_name (*iter) << " () { return _" << get_parameter_name (*iter) << "; }" << endl; if (iter->requires_additional_flag_arg ()) o << " public " << type2str (flag_type) << ' ' << get_parameter_name (*iter) << "_flag () { return _" << get_parameter_name (*iter) << "_flag; }" << endl; if (iter->get_store_longindex ()) o << " public " << type2str (int_type) << ' ' << get_parameter_name (*iter) << "_li () { return _" << get_parameter_name (*iter) << "_li; }" << endl; } // closing bracket for class definition o << "}" << endl; if (!o) throw EH ("can't write to file: " + path); // close the file o.close (); if (!o) throw EH ("can't close file: " + path); // tell the user what we're doing if (!get_quiet ()) cout << "done" << endl; } /** Dummy. In Java no separate file is generated for callbacks. Derive your own class from the command line class instead. */ void Java_Clparam_list::output_callbacks (const string filename_without_extension) const throw (EH) { } genparse-0.9.1/src/clparam_list.cc0000644000076600001440000005723111716257231014035 00000000000000/** @file clparam_list.cc \brief Methods for the command line parameter list class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "clparam_list.h" #include "sysinfo.h" #include "systime.h" #include "userinfo.h" #include "genparse_util.h" /** Constructor */ Clparam_list::Clparam_list () { _cppext = "cc"; _exit_value = "EXIT_FAILURE"; _quiet = false; _longmembers = false; _internationalization = false; _static_headers = false; _export_long_options = false; _use_gnulib = false; _many_prints = false; _no_struct = false; _break_lines = - 1; } /** Copy constructor */ Clparam_list& Clparam_list::operator=(const Clparam_list &rhs) { // guard against self-assignment if (this != &rhs) { _params = rhs._params; _global_callback = rhs._global_callback; _include_list = rhs._include_list; _mandatory_list = rhs._mandatory_list; _parsefunc = rhs._parsefunc; _directory = rhs._directory; _cppext = rhs._cppext; _exit_value = rhs._exit_value; _quiet = rhs._quiet; _longmembers = rhs._longmembers; _internationalization = rhs._internationalization; _static_headers = rhs._static_headers; _break_lines = rhs._break_lines; _export_long_options = rhs._export_long_options; _use_gnulib = rhs._use_gnulib; _many_prints = rhs._many_prints; _usage_list = rhs._usage_list; } return *this; } /** Return true if at least 1 parameter has a callback function. */ bool Clparam_list::parameters_have_callbacks (void) const { return (find_if (_params.begin (), _params.end (), mem_fun_ref (&Clparam::has_callback)) != _params.end ()); } /** Return true if there are any callback functions (global or related to a parameter). */ bool Clparam_list::have_callbacks (void) const { return (parameters_have_callbacks () || !_global_callback.empty ()); } /** Add a parameter to the list, checking for duplicates. */ void Clparam_list::add (const Clparam &p) throw (EH) { if (this->contains (p)) { throw EH ("duplicate parameter"); } _params.push_back (p); } /** Does the list contain this parameter? Yes if either the short or long representation matches. */ bool Clparam_list::contains (const Clparam &p) const { list::const_iterator iter; unsigned int i; for (iter = _params.begin (); iter != _params.end (); iter++) { if (!iter->get_long_only () && (iter->get_short_rep (0) != 0)) for (i = 0; i < p.get_num_short_reps (); i++) if (iter->contains (p.get_short_rep (i))) return true; if ((iter->get_long_rep ().length () > 0) && (iter->get_long_rep () == p.get_long_rep ())) return true; } return false; } /** Does the list contain this parameter? Yes if short representation matches. */ bool Clparam_list::contains (const char c) const { list::const_iterator iter; for (iter = _params.begin (); iter != _params.end (); iter++) if (iter->contains (c)) return true; return false; } /** Does the list contain this parameter? Yes if short representation matches. */ bool Clparam_list::contains (const string s) const { list::const_iterator iter; for (iter = _params.begin (); iter != _params.end (); iter++) if (iter->get_long_rep () == s) return true; return false; } /** Dump contents to a log file */ void Clparam_list::logdump (Logfile& l) const { // preface l.write ("dumping parameter list..."); // do the global stuff here list::const_iterator iter; for (iter = _include_list.begin (); iter != _include_list.end (); iter++) l.write (" include file: " + *iter); for (iter = _mandatory_list.begin (); iter != _mandatory_list.end (); iter++) l.write (" mandatory: " + *iter); if (!get_global_callback ().empty ()); l.write (" global_callback: " + get_global_callback ()); // now do the parameters list::const_iterator iter2; for (iter2 = _params.begin (); iter2 != _params.end (); iter2++) iter2->logdump (l); // afterword l.write ("finished dumping parameter list"); } /** Given a parameter type, return that type in a string */ const string Clparam_list::type2str (param_type t) const { switch (t) { case flag_type: return boolean_type_str (); break; case int_type: return "int"; break; case long_type: return "long int"; break; case ulong_type: return "unsigned long int"; break; case intmax_type: return "intmax_t"; break; case uintmax_type: return "uintmax_t"; break; case float_type: return "float"; break; case double_type: return "double"; break; case char_type: return "char"; break; case string_type: return string_type_str (); default: throw EH ("unknown parameter type"); } } /** Returns true if all parameters have only parameters in the long form. */ bool Clparam_list::long_only (void) const { list::const_iterator iter; for (iter = _params.begin (); iter != _params.end (); iter++) if (!iter->get_long_only ()) return false; return true; } /** Returns a short form of the options in the form [ -abc ] */ string Clparam_list::get_options_string (void) const { string rslt; rslt = "[ -"; for (list::const_iterator iter = _params.begin (); iter != _params.end (); iter++) if ((!iter->get_long_only ()) && (!iter->get_do_not_document ())) rslt += iter->get_short_reps (); rslt += " ]"; return rslt; } /** Returns a command line glossary. Every element in the result array is 1 line. */ list Clparam_list::get_glossary (void) const { list lines; list param_desc; string line; list::const_iterator param_iter; unsigned int i; unsigned int indentation = 10; if (get_many_prints ()) lines.push_back("__NEW_PRINT__"); list::const_iterator iter; for (iter = _params.begin (); iter != _params.end (); iter++) { if (!iter->get_do_not_document ()) { if (!iter->get_comment ().empty ()) lines.push_back("__COMMENT__(" + iter->get_comment () + ')'); line = " "; if (!iter->get_long_only ()) { for (i = 0; i < iter->get_num_short_reps (); i++) line += string (" [ -") + iter->get_short_rep (i) + " ]"; } if (!iter->get_long_rep ().empty ()) { line += " [ --" + iter->get_long_rep (); if (!iter->get_opt_name ().empty ()) { if (iter->get_opt_name_in_square_braces ()) line += '['; line += '=' + iter->get_opt_name (); if (iter->get_opt_name_in_square_braces ()) line += ']'; } line += " ]"; } // Print the type line += " (type="; switch (iter->get_type ()) { case flag_type: line += "FLAG"; break; case int_type: line += "INTEGER"; break; case long_type: line += "LONG"; break; case ulong_type: line += "UNSIGNED LONG"; break; case intmax_type: line += "INTMAX"; break; case uintmax_type: line += "UINTMAX"; break; case float_type: line += "REAL"; break; case double_type: line += "DOUBLE"; break; case char_type: line += "CHARACTER"; break; case string_type: line += "STRING"; break; default: throw EH ("unknown parameter type"); } if (!iter->get_high_range ().empty () || !iter->get_low_range ().empty () || !iter->get_default_value ().empty ()) line += ","; // Print the range if (!iter->get_low_range ().empty ()) { line += " range=" + iter->get_low_range () + "..."; if (!iter->get_high_range ().empty ()) line += iter->get_high_range (); line += ","; } else { if (!iter->get_high_range ().empty ()) line += "range=..." + iter->get_high_range () + ","; } // Print default values, but not for flags if (!iter->get_default_value ().empty () && iter->get_type () != flag_type) line += " default=" + iter->get_default_value (); line += string (")"); lines.push_back (line); param_desc = iter->get_description (indentation, 0, get_break_lines ()); for (param_iter = param_desc.begin (); param_iter != param_desc.end (); param_iter++) if (param_iter->get_start_1st_col () == true) lines.push_back (param_iter->get_description ()); else lines.push_back (string (indentation, ' ') + param_iter->get_description ()); if (get_many_prints ()) lines.back() += "__NEW_PRINT__"; } } return lines; } /** Returns a GNU style command line glossary. Every element in the result array is 1 line. */ list Clparam_list::get_glossary_gnu (unsigned int indentation) const { list lines; list param_desc; string line; unsigned int i; list::const_iterator param_iter; if (get_many_prints ()) lines.push_back("__NEW_PRINT__"); list::const_iterator iter; for (iter = _params.begin (); iter != _params.end (); iter++) { if (!iter->get_do_not_document ()) { if (!iter->get_comment ().empty ()) lines.push_back("__COMMENT__(" + iter->get_comment () + ')'); line = " "; if (!iter->get_long_only ()) /* this parameter only has a long representation */ for (i = 0; i < iter->get_num_short_reps ();i++) line += string (" -") + iter->get_short_rep (i); else if (!long_only ()) /* at least one parameter in the list has a short representation */ line += string (4, ' '); if (!iter->get_long_only () && !iter->get_long_rep ().empty ()) line += ','; if (!iter->get_long_rep ().empty ()) line += " --" + iter->get_long_rep (); if (!iter->get_opt_name ().empty ()) { if (iter->get_opt_name_in_square_braces ()) line += '['; line += '=' + iter->get_opt_name (); if (iter->get_opt_name_in_square_braces ()) line += ']'; } /* Append parameter description */ param_desc = iter->get_description (indentation, 2, get_break_lines ()); param_iter = param_desc.begin (); /* print first description string in same line */ if (param_iter != param_desc.end ()) { string::size_type length = line.length (); if (length < indentation) line += string (indentation - length, ' '); else if (_break_lines >= 0) { lines.push_back (line); line = string (indentation, ' '); } lines.push_back (line + param_iter->get_description ()); param_iter++; } else { lines.push_back (line); } while (param_iter != param_desc.end ()) { if (param_iter->get_start_1st_col () == true) lines.push_back (param_iter->get_description ()); else lines.push_back (string (indentation, ' ') + param_iter->get_description ()); param_iter++; } if (get_many_prints ()) lines.back() += "__NEW_PRINT__"; } } return lines; } /** Returns a string with all mandatory arguments separated by spaces */ string Clparam_list::get_mandatories_string (void) const { string rslt; unsigned int i; list::const_iterator str_iter; str_iter = _mandatory_list.begin (); i = 0; while (i < _mandatory_list.size ()) { rslt += *str_iter; if (i + 1 < _mandatory_list.size ()) rslt += ' '; str_iter++; i++; } return rslt; } /** Helper function for parsing one line in the section for the usage () function of the genparse file for a macro. \return Index of the first occurance of macro with a valid argument or string::npos if none could be found. */ string::size_type Clparam_list::parse_macro ( /** Another return value: Index of the first character of the macro argument. Only valid if the return value of this function is != string::npos. */ string::size_type &arg_start_pos, /** Another return value: Index of the last character of the macro argument. Only valid if the return value of this function is != string::npos. */ string::size_type &arg_end_pos, /** Another return value: Index of the closing bracket of the macro argument. Only valid if the return value of this function is != string::npos. */ string::size_type &closing_bracket_pos, /** the macro to parse for */ const string ¯o, /** The line which must be parsed for macros. */ const string &line) const { string::size_type macro_pos; string::size_type arg_opening_bracket_pos; macro_pos = line.find (macro); if (macro_pos != string::npos) { arg_start_pos = macro_pos + macro.length (); while (isspace (line[arg_start_pos])) arg_start_pos++; if (line[arg_start_pos] != '(') return string::npos; arg_start_pos++; closing_bracket_pos = line.find (')', arg_start_pos); arg_opening_bracket_pos = line.rfind ('(', closing_bracket_pos); while ((arg_opening_bracket_pos != string::npos) && (arg_opening_bracket_pos > arg_start_pos)) { closing_bracket_pos = line.find (')', closing_bracket_pos + 1); arg_opening_bracket_pos = line.rfind ('(', arg_opening_bracket_pos - 1); } if (closing_bracket_pos == string::npos) return string::npos; arg_end_pos = closing_bracket_pos - 1; while (isspace (line[arg_end_pos])) arg_end_pos--; } return macro_pos; } /** return string explaining usage */ list Clparam_list::get_usage (void) const { list rval; list usage_lines; list::const_iterator iter; ostringstream ostr; unsigned int line_length = 0; for (iter = _usage_list.begin (); iter != _usage_list.end (); iter++) { string::size_type pos; string line = *iter; do { pos = line.find (string ("__OPTIONS_SHORT__")); if (pos != string::npos) line = line.replace (pos, 17, get_options_string ()); } while (pos != string::npos); do { pos = line.find (string ("__MANDATORIES__")); if (pos != string::npos) line = line.replace (pos, 15, get_mandatories_string ()); } while (pos != string::npos); pos = line.find (string ("__GLOSSARY__")); if (pos != string::npos) { usage_lines = get_glossary (); } else { pos = line.find (string ("__GLOSSARY_GNU__")); if (pos != string::npos) { line.erase (0, pos + 16); /* Remove __GLOSSARY_GNU__ and any characters before */ istringstream linestr (line); char opening_bracket, closing_bracket; unsigned int indentation; linestr >> opening_bracket >> indentation >> closing_bracket; if ((opening_bracket == '(') && (closing_bracket == ')')) usage_lines = get_glossary_gnu (indentation); else usage_lines = get_glossary_gnu (); } } if (pos != string::npos) { if (line_length > 0) { /* print stream buffer and clear it */ rval.push_back (ostr.str ()); ostr.str (""); line_length = 0; } /* print glossary */ list::const_iterator usage_iter; for (usage_iter = usage_lines.begin (); usage_iter != usage_lines.end (); usage_iter++) rval.push_back (*usage_iter); } else if (get_break_lines () < 0) { rval.push_back (line); } else { do { string extra_line; pos = line.find (string ("__NL__")); if (pos != string::npos) { extra_line = string (line, pos + 6, string::npos); line = string (line, 0, pos); } istringstream istr (line); string word; while (istr >> word) { if (line_length > 0) { if (line_length + word.length () + 1 > (unsigned int)get_break_lines ()) { rval.push_back (ostr.str ()); ostr.str (""); line_length = 0; } else { ostr << ' '; line_length += 1; } } ostr << word; line_length += word.length (); } if (pos != string::npos) { rval.push_back (ostr.str ()); ostr.str (""); line_length = 0; line = extra_line; } } while (pos != string::npos); } } if (!ostr.str () .empty ()) rval.push_back (ostr.str ()); return rval; } /** Output the comments at the beginning of a file. */ void Clparam_list::output_comments_header (ofstream& o, const string &filename, const string &purpose) const { // opening comments with filename o << "/******************************************************************************" << endl; o << "**" << endl; o << "** " << filename << endl; o << "**" << endl; if (get_static_headers () == false) { // timestamp the file Systime t; o << "** " << t.unix_ctime (); // add the system information Sysinfo i; o << "** " << i.format () << endl; // add the user information Userinfo u; o << "** " << u.format () << endl; o << "**" << endl; } // add the purpose - as if there is one :-) o << "** " << purpose << endl; o << "**" << endl; // do a little advertising for the program... o << "** Automatically created by " << PACKAGE << " v" << VERSION << endl; o << "**" << endl; o << "** See http://genparse.sourceforge.net for details and updates" << endl; o << "**" << endl; // that's it - finish up o << "******************************************************************************/" << endl; o << endl; } /** Output a function comment banner. */ void Clparam_list::output_function_comment (ofstream& o, const string &function_name, const string &comment) const { o << "/*----------------------------------------------------------------------------" << endl; o << "**" << endl; o << "** " << function_name << " ()" << endl; o << "**" << endl; o << "** " << comment << endl; o << "**" << endl; o << "**--------------------------------------------------------------------------*/" << endl; } /** Output the general include files that were specified in the .gp file. */ void Clparam_list::output_includes (ofstream& o) const { // loop through the list list::const_iterator iter; for (iter = _include_list.begin (); iter != _include_list.end (); iter++) o << "#include " << *iter << endl; o << endl; } /** Get parameter list */ const list &Clparam_list::get_params (void) const { return (const list &)_params; } string const Clparam_list::get_parameter_name (const Clparam ¶m) const { string rval; if (param.get_long_only () || (get_longmembers () && !param.get_long_rep ().empty ())) rval = param.get_long_rep (); else rval = string (1, param.get_short_rep (0)); return (genparse_util::str2C (rval)); } /** Call this function once after parsing. */ void Clparam_list::post_parser_adjust (void) { list::iterator iter; for (iter = _params.begin (); iter != _params.end (); iter++) { if (iter->get_type () == flag_type) { iter->set_short_has_arg (no_argument); iter->set_long_has_arg ( no_argument); } else { if (iter->get_short_has_arg () == argument_undefined) iter->set_short_has_arg (required_argument); if (iter->get_long_has_arg () == argument_undefined) iter->set_long_has_arg (required_argument); } iter->normalize_code_lines_indentation (); } } /** Template for generating the parsing engine. Language specific subfunctions must be implemented in derived classes. */ void Clparam_list::output (const string filename_without_extension) const { check_parameters (); output_interface ( filename_without_extension); output_implementation (filename_without_extension); output_callbacks ( filename_without_extension); } genparse-0.9.1/src/clparam.cc0000644000076600001440000002013511716257231012773 00000000000000/** @file clparam.cc \brief Methods for the command line parameter class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "clparam.h" /** Constructor method. Initialize some of the variables. Strings should initialize to empty. */ Clparam::Clparam () { _opt_name_in_square_braces = false; _type = null_type; _longopt_value = 0; _long_only = false; _store_longindex = false; _do_not_document = false; _add_flag = false; _short_has_arg = argument_undefined; _long_has_arg = argument_undefined; } /** Copy constructor */ Clparam& Clparam::operator=(const Clparam &rhs) { // guard against self-assignment if (this != &rhs) { _short_reps = rhs._short_reps; _long_rep = rhs._long_rep; _opt_name_in_square_braces = rhs._opt_name_in_square_braces; _type = rhs._type; _default_value = rhs._default_value; _low_range = rhs._low_range; _high_range = rhs._high_range; _callback = rhs._callback; _err_msg = rhs._err_msg; _err_msg_conv = rhs._err_msg_conv; _comment = rhs._comment; _descriptions = rhs._descriptions; _code_lines = rhs._code_lines; _longopt_value = rhs._longopt_value; _long_only = rhs._long_only; _store_longindex = rhs._store_longindex; _do_not_document = rhs._do_not_document; _add_flag = rhs._add_flag; _short_has_arg = rhs._short_has_arg; _long_has_arg = rhs._long_has_arg; } return *this; } void Clparam::add_description (const string &description, bool start_1st_col) { _descriptions.push_back (Cldesc(description, start_1st_col)); } /** Return true if this parameter must be implemented with 2 arguments: one for the type declared another one for the information if it has been specified. This is required mostly for optional arguments. */ bool Clparam::requires_additional_flag_arg (void) const { if (get_add_flag ()) return (true); return ((get_type () != flag_type) && ((get_short_has_arg () == optional_argument) || (get_long_has_arg () == optional_argument) || (get_long_has_arg () != get_short_has_arg ()))); } /** Return short representation number i. */ char Clparam::get_short_rep (unsigned int i) const { if (_short_reps.length () > i) { return (_short_reps.at (i)); } else { return (0); } } /** Return true if parameter contains c as one of the short representations */ bool Clparam::contains (char c) const { unsigned int i; for (i = 0; i < _short_reps.length (); i++) if (_short_reps.at (i) == c) return true; return false; } /** Returns the descriptve text for this command line parameter. Every element in the result array is 1 line. \param indentation Desired indentation width. This value is required only if break_lines is >= 0 for calculating how to break lines. The result will not be indented however. \param additional_indentation_following_lines Additional indentation beginning with the 2nd output line. \param break_lines If < 0 then an unchanged copy of the descriptive text is returned. Otherwise the lines are broken such that the resulting text has a width of break_lines - indentation characters. */ list Clparam::get_description (unsigned int indentation, unsigned int additional_indentation_following_lines, int break_lines) const { list lines; string word; string line; unsigned int length; bool first_word; length = indentation; first_word = true; list::const_iterator iter; if (break_lines < 0) return _descriptions; else { for (iter = _descriptions.begin (); iter != _descriptions.end (); iter++) { /* Read word by word */ istringstream line_stream (iter->get_description ()); while (line_stream >> word) { if (!first_word) { if (length + word.length () + 1 > (unsigned int)break_lines) { lines.push_back (line); length = indentation + additional_indentation_following_lines; first_word = true; line = string (additional_indentation_following_lines, ' '); } else { line += ' '; length += 1; } } line += word; length += word.length (); first_word = false; } } lines.push_back (line); return lines; } } /** Dump contents to a Logfile */ void Clparam::logdump (Logfile& l) const { l.write (" dumping parameter..."); l.write (LOG_OPTION_NO_CR, " short representation: "); l.write (LOG_OPTION_NO_TS, _short_reps); l.write (" long representation: " + _long_rep); l.write (LOG_OPTION_NO_CR, " parameter type: "); switch (_type) { case int_type: l.write (LOG_OPTION_NO_TS, "int"); break; case long_type: l.write (LOG_OPTION_NO_TS, "long int"); break; case ulong_type: l.write (LOG_OPTION_NO_TS, "unsigned long int"); break; case intmax_type: l.write (LOG_OPTION_NO_TS, "intmax_t"); break; case uintmax_type: l.write (LOG_OPTION_NO_TS, "uintmax_t"); break; case float_type: l.write (LOG_OPTION_NO_TS, "float"); break; case double_type: l.write (LOG_OPTION_NO_TS, "double"); break; case string_type: l.write (LOG_OPTION_NO_TS, "string"); break; case char_type: l.write (LOG_OPTION_NO_TS, "char"); break; case flag_type: l.write (LOG_OPTION_NO_TS, "flag"); break; default: break; } l.write (" default_value: " + _default_value); l.write (" low range: " + _low_range); l.write (" high range: " + _high_range); l.write (" callback: " + _callback); l.write (" descriptions:"); list::const_iterator iter; if (!_descriptions.empty ()) for (iter = _descriptions.begin (); iter != _descriptions.end (); iter++) l.write ((string) " " + iter->get_description ()); ostringstream oss; oss << _longopt_value << ends; l.write ((string) " longopt value: " + oss.str ()); l.write (" finished dumping parameter"); } /** Left aligns all code lines. */ void Clparam::normalize_code_lines_indentation (void) { list::iterator iter; bool all_start_with_space, all_start_with_tab; do { all_start_with_space = true; all_start_with_tab = true; for (iter = _code_lines.begin (); iter != _code_lines.end (); iter++) { if ((*iter)[0] != ' ') all_start_with_space = false; if ((*iter)[0] != '\t') all_start_with_tab = false; } if (all_start_with_space || all_start_with_tab) for (iter = _code_lines.begin (); iter != _code_lines.end (); iter++) iter->erase(0, 1); } while ((all_start_with_space || all_start_with_tab) && _code_lines.size () > 0); } genparse-0.9.1/src/cldesc.h0000644000076600001440000000326411716257231012457 00000000000000/** @file cldesc.h \brief Class definition for one line of decriptive text of one command line parameter */ /* * Copyright (C) 2007 - 2012 * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CLDESC_H #define CLDESC_H #include using namespace std; /** \brief Contains descriptive text for one line of text of one command line parameter. */ class Cldesc { private: string _description; // descriptive text bool _start_1st_col; // true if _description shall start in the 1st column public: // Constructor, destructor and copy constructor Cldesc (); Cldesc (const string &description, bool start_1st_col = false); ~Cldesc () {} Cldesc& operator=(const Cldesc &); // functions to set the values void set_description (const string &s) { _description = s; } void set_start_1st_col (bool b) { _start_1st_col = b; } // functions to retrieve the values const string &get_description (void) const { return _description; } bool get_start_1st_col (void) const { return _start_1st_col; } }; #endif // CLDESC_H genparse-0.9.1/src/unique_int.cc0000644000076600001440000000224311716257231013534 00000000000000/** @file unique_int.cc \brief Methods for unique integer generator class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "unique_int.h" //--------------------------------------------------------------------------- // // Unique_Int::get () // // Get the next unique int. // //--------------------------------------------------------------------------- int Unique_Int::get () { int temp; temp = _i; _i++; return temp; } genparse-0.9.1/src/Makefile.in0000644000076600001440000006164711732677152013135 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = genparse$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in lexer.cc \ parser.cc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_genparse_OBJECTS = getopt.$(OBJEXT) eh.$(OBJEXT) \ eh_system.$(OBJEXT) systime.$(OBJEXT) userinfo.$(OBJEXT) \ sysinfo.$(OBJEXT) logfile.$(OBJEXT) unique_int.$(OBJEXT) \ clparam.$(OBJEXT) clparam_list.$(OBJEXT) parse_cl.$(OBJEXT) \ genparse.$(OBJEXT) parser.$(OBJEXT) lexer.$(OBJEXT) \ c_clparam_list.$(OBJEXT) cpp_clparam_list.$(OBJEXT) \ clparam_list_factory.$(OBJEXT) genparse_util.$(OBJEXT) \ java_clparam_list.$(OBJEXT) cldesc.$(OBJEXT) genparse_OBJECTS = $(am_genparse_OBJECTS) genparse_DEPENDENCIES = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) YLWRAP = $(top_srcdir)/ylwrap YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(genparse_SOURCES) DIST_SOURCES = $(genparse_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = bison -y -d YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ AM_CXXFLAGS = -Wall genparse_SOURCES = getopt.cc getopt.h eh.cc eh.h eh_system.cc eh_system.h systime.cc systime.h \ userinfo.cc userinfo.h sysinfo.cc sysinfo.h logfile.cc logfile.h unique_int.cc unique_int.h \ clparam.cc clparam.h clparam_list.cc clparam_list.h parse_cl.cc parse_cl.h genparse.cc \ genparse.h parser.yy parser.h lexer.ll c_clparam_list.cc c_clparam_list.h cpp_clparam_list.cc \ cpp_clparam_list.h clparam_list_factory.h clparam_list_factory.cc genparse_util.cc \ genparse_util.h java_clparam_list.h java_clparam_list.cc cldesc.cc cldesc.h genparse_LDADD = CLEANFILES = genparse.log *~ all: all-am .SUFFIXES: .SUFFIXES: .cc .ll .o .obj .yy $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) genparse$(EXEEXT): $(genparse_OBJECTS) $(genparse_DEPENDENCIES) @rm -f genparse$(EXEEXT) $(CXXLINK) $(genparse_OBJECTS) $(genparse_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_clparam_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cldesc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clparam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clparam_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clparam_list_factory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpp_clparam_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eh_system.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genparse_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_clparam_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_cl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unique_int.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userinfo.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .ll.cc: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .yy.cc: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f lexer.cc -rm -f parser.cc clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags dist-hook distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS dist-hook: genparse # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/src/logfile.cc0000644000076600001440000001250111716257231012773 00000000000000/** @file logfile.cc \brief Methods for the logfile class */ /* * Copyright (C) 2000, 2006 - 2012 * Michael S. Borella and * Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "sysinfo.h" #include "userinfo.h" #include "logfile.h" const string separator ("--------------------------------------------------------------"); //--------------------------------------------------------------------------- // // Logfile::Logfile () // // Constructor method. // //--------------------------------------------------------------------------- Logfile::Logfile () { _is_open = false; _active = false; } //--------------------------------------------------------------------------- // // Logfile::open () // // Open the file and print the begin banner // //--------------------------------------------------------------------------- void Logfile::open (string filename) throw (EH) { // Open the file for writing. Eventually we'll change this to avoid // collisions _log.open (filename.c_str ()); if (!_log) throw EH ("can't open file " + filename); // turn on the logging ability _is_open = true; _active = true; // Assign a local copy of the file name - who knows, we may need it _filename = filename; // dump the introductory banner this->write (separator); this->write ("BEGINNING OF LOG"); // dump the machine info Sysinfo si; string si_str; si_str += "System: " + si.format (); this->write (si_str); // dump the user info Userinfo ui; string ui_str; ui_str += "User: " + ui.format (); this->write (ui_str); // one more line this->write (separator); } //--------------------------------------------------------------------------- // // Logfile::close () // // Close the file and print the end banner // //--------------------------------------------------------------------------- void Logfile::close () { if (_is_open && _active) { this->write (separator); this->write ("END OF LOG"); this->write (separator); if (!_log) throw EH ("can't write to file " + _filename); _log.close (); if (!_log) throw EH ("can't close file " + _filename); _is_open = false; _active = false; } } //--------------------------------------------------------------------------- // // Logfile::write_separator () // // Write a separator // //--------------------------------------------------------------------------- void Logfile::write_separator () { if (_is_open && _active) { write_ts (); _log << separator << endl; if (!_log) throw EH ("can't write to file " + _filename); } } //--------------------------------------------------------------------------- // // Logfile::write (string) // // Writes a string, prefaced by a timestamp. First check if we're active // and open // //--------------------------------------------------------------------------- void Logfile::write (string s) { if (_is_open && _active) { write_ts (); _log << s << endl; if (!_log) throw EH ("can't write to file " + _filename); } } //--------------------------------------------------------------------------- // // Logfile::write (log_option_t, string) // // Writes a string, wrt the option passed // //--------------------------------------------------------------------------- void Logfile::write (log_option_t o, string s) { if (_is_open && _active) { // check for timestamp if (o != LOG_OPTION_NO_TS) write_ts (); // write the string _log << s; if (o != LOG_OPTION_NO_CR) _log << endl; if (!_log) throw EH ("can't write to file " + _filename); } } //--------------------------------------------------------------------------- // // Logfile::write (char) // // Writes a char, prefaced by a timestamp. First check if we're active // and open // //--------------------------------------------------------------------------- void Logfile::write (char c) { if (_is_open && _active) { write_ts (); _log << c << endl; if (!_log) throw EH ("can't write to file " + _filename); } } //--------------------------------------------------------------------------- // // Logfile::write (log_option_t, char) // // Writes a char, wrt the option passed // //--------------------------------------------------------------------------- void Logfile::write (log_option_t o, char c) { if (_is_open && _active) { // check for timestamp if (o != LOG_OPTION_NO_TS) { write_ts (); } // write the string _log << c; if (o != LOG_OPTION_NO_CR) _log << endl; if (!_log) throw EH ("can't write to file " + _filename); } } genparse-0.9.1/tests/0000777000076600001440000000000011732700535011501 500000000000000genparse-0.9.1/tests/javacheck/0000777000076600001440000000000011732700535013420 500000000000000genparse-0.9.1/tests/javacheck/src/0000777000076600001440000000000011732700535014207 500000000000000genparse-0.9.1/tests/javacheck/src/tests.java0000644000076600001440000000176411716257231016142 00000000000000/* * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import junit.framework.*; public class tests extends TestSuite { public static Test suite () { TestSuite suite = new TestSuite (); suite.addTest (new TestSuite (default_test.test.class)); suite.addTest (new TestSuite (longmembers_test.test.class)); return suite; } }; genparse-0.9.1/tests/javacheck/src/longmembers_test/0000777000076600001440000000000011732700535017560 500000000000000genparse-0.9.1/tests/javacheck/src/longmembers_test/CmdlineWithCallbacks.java0000644000076600001440000000273011716257231024352 00000000000000package longmembers_test; /* * Callback function implementation. The parent class Cmdline * was generated automatically by genparse. * * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ class CmdlineWithCallbacks extends Cmdline { int test_g; int test_c; int test_s; int test_c_g; CmdlineWithCallbacks (String[] argv) throws CmdlineEx { super (argv); } public boolean my_callback () { test_g = 1; test_c_g = 1; return true; } public boolean char_cb () { test_c_g = (int)cparam (); test_c = (int)cparam (); return true; } public boolean string_cb () { test_s = 3; return true; } int getTest_g () { return test_g; } int getTest_c () { return test_c; } int getTest_s () { return test_s; } int getTest_c_g () { return test_c_g; } } genparse-0.9.1/tests/javacheck/src/longmembers_test/test.java0000644000076600001440000001754511716257231021334 00000000000000/* * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package longmembers_test; import junit.framework.*; public class test extends TestCase { int argc; String[] args100 = new String[100]; String[] args; public void setUp () { } public void tearDown () { args = null; argc = 0; } /* Allocate an array of size argc and copy 1st argc elements of args100 into it. The returned array contains argc elements. That's the only difference between the result array and the parameter args100. */ String[] genArgs (int argc, String[] args100) { args = new String[argc]; for (int i = 0;i < argc; i++) { args[i] = args100[i]; } return args; } public void testNoArgs () { args = new String[0]; CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 'c', Options.cparam ()); assertEquals ('\013', Options.dparam ()); assertEquals ( '\n', Options.eparam ()); assertEquals ( 1.2f, Options.fparam (), 0); assertEquals ( false, Options.gparam ()); assertEquals ( false, Options.help ()); assertEquals ( 1, Options.iparam ()); assertEquals ( 3, Options.oparam ()); assertEquals ( false, Options.oparam_flag ()); assertEquals ( "", Options.pparam ()); assertEquals ( false, Options.pparam_flag ()); assertEquals ( 4, Options.qparam ()); assertEquals ( false, Options.qparam_flag ()); assertEquals ( 7, Options.Pparam ()); assertEquals ( false, Options.Pparam_flag ()); assertEquals ( "S", Options.Qparam ()); assertEquals ( false, Options.Qparam_flag ()); assertEquals ( "abc", Options.sparam ()); assertEquals ( false, Options.version ()); assertEquals ("haha", Options.a_ha ()); assertEquals ( false, Options._1 ()); assertEquals ( false, Options.wparam_flag ()); assertEquals ( 0, Options.next_param ()); } public void testShortOptions () { args100[argc++] = new String ("-ca"); args100[argc++] = new String ("-f2"); args100[argc++] = new String ("-g"); args100[argc++] = new String ("-i7"); args100[argc++] = new String ("-o11"); args100[argc++] = new String ("-pquak"); args100[argc++] = new String ("-q500"); args100[argc++] = new String ("-P12"); args100[argc++] = new String ("-Q"); args100[argc++] = new String ("-sbla"); args100[argc++] = new String ("-t17"); args100[argc++] = new String ("-1"); args100[argc++] = new String ("-w9"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 'a', Options.cparam ()); assertEquals ( 2f, Options.fparam (), 0); assertEquals ( true, Options.gparam ()); assertEquals ( false, Options.help ()); assertEquals ( 7, Options.iparam ()); assertEquals ( 11, Options.oparam ()); assertEquals ( true, Options.oparam_flag ()); assertEquals ( "quak", Options.pparam ()); assertEquals ( true, Options.pparam_flag ()); assertEquals ( 500, Options.qparam ()); assertEquals ( true, Options.qparam_flag ()); assertEquals ( 12, Options.Pparam ()); assertEquals ( true, Options.Pparam_flag ()); assertEquals ( "S", Options.Qparam ()); assertEquals ( true, Options.Qparam_flag ()); assertEquals ( "bla", Options.sparam ()); assertEquals ( 17, Options.t ()); assertEquals ( true, Options._1 ()); assertEquals ( true, Options.wparam_flag ()); assertEquals ( 9, Options.wparam ()); assertEquals (argc - 1, Options.next_param ()); } public void testLongOptions () { args100[argc++] = new String ("--cparam=b"); args100[argc++] = new String ("--fparam=1.5"); args100[argc++] = new String ("--gparam"); args100[argc++] = new String ("--iparam=8"); args100[argc++] = new String ("--oparam=9"); args100[argc++] = new String ("--pparam=pp"); args100[argc++] = new String ("--qparam=111"); args100[argc++] = new String ("--Pparam"); args100[argc++] = new String ("--Qparam=AAA"); args100[argc++] = new String ("--sparam=aaa"); args100[argc++] = new String ("--uparam=18"); args100[argc++] = new String ("--vparam=19"); args100[argc++] = new String ("--a-ha=hihi"); args100[argc++] = new String ("--wparam=99"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 'b', Options.cparam ()); assertEquals ( 1.5f, Options.fparam (), 0); assertEquals ( true, Options.gparam ()); assertEquals ( false, Options.help ()); assertEquals ( 8, Options.iparam ()); assertEquals ( 9, Options.oparam ()); assertEquals ( true, Options.oparam_flag ()); assertEquals ( "pp", Options.pparam ()); assertEquals ( true, Options.pparam_flag ()); assertEquals ( 111, Options.qparam ()); assertEquals ( true, Options.qparam_flag ()); assertEquals ( 7, Options.Pparam ()); assertEquals ( true, Options.Pparam_flag ()); assertEquals ( "AAA", Options.Qparam ()); assertEquals ( true, Options.Qparam_flag ()); assertEquals ( "aaa", Options.sparam ()); assertEquals ( 18, Options.uparam ()); assertEquals ( 19, Options.vparam ()); assertEquals ( "hihi", Options.a_ha ()); assertEquals ( true, Options.wparam_flag ()); assertEquals ( 99, Options.wparam ()); assertEquals (argc - 1, Options.next_param ()); } public void testOutOfRange1 () { args100[argc++] = new String ("-i0"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testOutOfRange2 () { args100[argc++] = new String ("-i11"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testOutOfRange3 () { args100[argc++] = new String ("-f0"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testOutOfRange4 () { args100[argc++] = new String ("-f3"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testCallbacks () { args100[argc++] = new String ("-c0"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 1, Options.getTest_g ()); assertEquals (48, Options.getTest_c ()); assertEquals ( 0, Options.getTest_s ()); assertEquals ( 1, Options.getTest_c_g ()); } public void testMultipleShortOptions () { args100[argc++] = new String ("-R"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals (true, Options.rparam ()); } }; genparse-0.9.1/tests/javacheck/src/default_test/0000777000076600001440000000000011732700535016672 500000000000000genparse-0.9.1/tests/javacheck/src/default_test/CmdlineWithCallbacks.java0000644000076600001440000000271211716257231023464 00000000000000package default_test; /* * Callback function implementation. The parent class Cmdline * was generated automatically by genparse. * * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ class CmdlineWithCallbacks extends Cmdline { int test_g; int test_c; int test_s; int test_c_g; CmdlineWithCallbacks (String[] argv) throws CmdlineEx { super (argv); } public boolean my_callback () { test_g = 1; test_c_g = 1; return true; } public boolean char_cb () { test_c_g = (int)c (); test_c = (int)c (); return true; } public boolean string_cb () { test_s = 3; return true; } int getTest_g () { return test_g; } int getTest_c () { return test_c; } int getTest_s () { return test_s; } int getTest_c_g () { return test_c_g; } } genparse-0.9.1/tests/javacheck/src/default_test/test.java0000644000076600001440000002061611716257231020437 00000000000000/* * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package default_test; import junit.framework.*; public class test extends TestCase { int argc; String[] args100 = new String[100]; String[] args; public void setUp () { } public void tearDown () { args = null; argc = 0; } /* Allocate an array of size argc and copy 1st argc elements of args100 into it. The returned array contains argc elements. That's the only difference between the result array and the parameter args100. */ String[] genArgs (int argc, String[] args100) { args = new String[argc]; for (int i = 0;i < argc; i++) { args[i] = args100[i]; } return args; } public void testNoArgs () { args = new String[0]; CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 'c', Options.c ()); assertEquals ( 0, Options.c_li ()); assertEquals ('\013', Options.d ()); assertEquals ( '\n', Options.e ()); assertEquals ( 1.2f, Options.f (), 0); assertEquals ( 0, Options.f_li ()); assertEquals ( false, Options.g ()); assertEquals ( false, Options.h ()); assertEquals ( 1, Options.i ()); assertEquals ( 3, Options.o ()); assertEquals ( false, Options.o_flag ()); assertEquals ( "", Options.p ()); assertEquals ( false, Options.p_flag ()); assertEquals ( 4, Options.q ()); assertEquals ( false, Options.q_flag ()); assertEquals ( 7, Options.P ()); assertEquals ( false, Options.P_flag ()); assertEquals ( "S", Options.Q ()); assertEquals ( false, Options.Q_flag ()); assertEquals ( "abc", Options.s ()); assertEquals ( false, Options.v ()); assertEquals ("haha", Options.a_ha ()); assertEquals ( false, Options._1 ()); assertEquals ( false, Options.w_flag ()); assertEquals ( 0, Options.next_param ()); } public void testShortOptions () { args100[argc++] = new String ("-ca"); args100[argc++] = new String ("-f2"); args100[argc++] = new String ("-g"); args100[argc++] = new String ("-i7"); args100[argc++] = new String ("-o11"); args100[argc++] = new String ("-pquak"); args100[argc++] = new String ("-q500"); args100[argc++] = new String ("-P12"); args100[argc++] = new String ("-Q"); args100[argc++] = new String ("-sbla"); args100[argc++] = new String ("-t17"); args100[argc++] = new String ("-1"); args100[argc++] = new String ("-w9"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 'a', Options.c ()); assertEquals ( 2f, Options.f (), 0); assertEquals ( true, Options.g ()); assertEquals ( false, Options.h ()); assertEquals ( 7, Options.i ()); assertEquals ( 11, Options.o ()); assertEquals ( true, Options.o_flag ()); assertEquals ( "quak", Options.p ()); assertEquals ( true, Options.p_flag ()); assertEquals ( 500, Options.q ()); assertEquals ( true, Options.q_flag ()); assertEquals ( 12, Options.P ()); assertEquals ( true, Options.P_flag ()); assertEquals ( "S", Options.Q ()); assertEquals ( true, Options.Q_flag ()); assertEquals ( "bla", Options.s ()); assertEquals ( 17, Options.t ()); assertEquals ( true, Options._1 ()); assertEquals ( true, Options.w_flag ()); assertEquals ( 9, Options.w ()); assertEquals (argc - 1, Options.next_param ()); } public void testLongOptions () { args100[argc++] = new String ("--cparam=b"); args100[argc++] = new String ("--fparam=1.5"); args100[argc++] = new String ("--gparam"); args100[argc++] = new String ("--iparam=8"); args100[argc++] = new String ("--oparam=9"); args100[argc++] = new String ("--pparam=pp"); args100[argc++] = new String ("--qparam=111"); args100[argc++] = new String ("--Pparam"); args100[argc++] = new String ("--Qparam=AAA"); args100[argc++] = new String ("--sparam=aaa"); args100[argc++] = new String ("--uparam=18"); args100[argc++] = new String ("--vparam=19"); args100[argc++] = new String ("--a-ha=hihi"); args100[argc++] = new String ("--wparam=99"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 'b', Options.c ()); assertEquals ( 0, Options.c_li ()); assertEquals ( 1.5f, Options.f (), 0); assertEquals ( 3, Options.f_li ()); assertEquals ( true, Options.g ()); assertEquals ( false, Options.h ()); assertEquals ( 8, Options.i ()); assertEquals ( 9, Options.o ()); assertEquals ( true, Options.o_flag ()); assertEquals ( "pp", Options.p ()); assertEquals ( true, Options.p_flag ()); assertEquals ( 111, Options.q ()); assertEquals ( true, Options.q_flag ()); assertEquals ( 7, Options.P ()); assertEquals ( true, Options.P_flag ()); assertEquals ( "AAA", Options.Q ()); assertEquals ( true, Options.Q_flag ()); assertEquals ( "aaa", Options.s ()); assertEquals ( 18, Options.uparam ()); assertEquals ( 19, Options.vparam ()); assertEquals ( "hihi", Options.a_ha ()); assertEquals ( true, Options.w_flag ()); assertEquals ( 99, Options.w ()); assertEquals (argc - 1, Options.next_param ()); } public void testOutOfRange1 () { args100[argc++] = new String ("-i0"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testOutOfRange2 () { args100[argc++] = new String ("-i11"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testOutOfRange3 () { args100[argc++] = new String ("-f0"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testOutOfRange4 () { args100[argc++] = new String ("-f3"); args = genArgs (argc, args100); try { CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); fail (); } catch (CmdlineEx e) {} } public void testCallbacks () { args100[argc++] = new String ("-c0"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals ( 1, Options.getTest_g ()); assertEquals (48, Options.getTest_c ()); assertEquals ( 0, Options.getTest_s ()); assertEquals ( 1, Options.getTest_c_g ()); } public void testMultipleShortOptions1 () { args100[argc++] = new String ("-R"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals (true, Options.r ()); } public void testMultipleShortOptions2 () { args100[argc++] = new String ("-r"); args100[argc++] = new String ("-R"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals (true, Options.r ()); } public void testMultipleShortOptions3 () { args100[argc++] = new String ("-R"); args100[argc++] = new String ("-r"); args100[argc++] = new String ("myfilename"); args = genArgs (argc, args100); CmdlineWithCallbacks Options = new CmdlineWithCallbacks (args); assertEquals (true, Options.r ()); } }; genparse-0.9.1/tests/javacheck/src/test.gp0000644000076600001440000000270710733740606015443 00000000000000#mandatory file my_callback () #exit_value -1 c / cparam char 'c' char_cb () "This is a char parameter." __STORE_LONGINDEX__ d / dparam char '\013' char_cb () "This is a char parameter initialized with an" "octal value." e / eparam char '\n' "This is a char parameter initialized with newline." f / fparam float 1.2 [1..2.3] "This is a float parameter." __STORE_LONGINDEX__ g / gparam flag "This is a flag parameter." i / iparam int 1 [1..10] "This is an integer parameter." o* / oparam* int 3 "Both short and long option have an optional" "argument" p* / pparam string "Short option has an optional argument," "long option requires an argument." q / qparam* int 4 "Short option reqires an argument," "long option has an optional argument." P* / Pparam! int 7 "Short option has an optional argument," "long option none." Q!/ Qparam* string {"S"} "Short option has no argument, long option has an" "optional argument." rR / rparam flag "This parameter has 2 short representations." s / sparam string {"abc"} string_cb () "This is a string parameter." t int "This parameter only has a short representation" NONE / uparam int "This parameter only has a long representation" NONE / vparam=V int "This parameter has a designation" NONE / a-ha string {"haha"} "This parameter has a dash in its name" 1 flag "This is a single digit parameter" w / wparam int "This parameter also sets a flag" __ADD_FLAG__ genparse-0.9.1/tests/javacheck/Makefile.am0000644000076600001440000000576511673365613015415 00000000000000GENPARSE = ../../src/genparse check: classes/tests.class java -classpath $(CLASSPATH):classes junit.textui.TestRunner tests classes/tests.class: classes/default_test/test.class classes/longmembers_test/test.class javac -d classes -classpath $(CLASSPATH):classes $(srcdir)/src/tests.java classes/default_test/test.class: classes/ \ src/default_test/CmdlineInterface.java \ src/default_test/CmdlineEx.java \ src/default_test/Cmdline.java \ src/default_test/CmdlineWithCallbacks.java \ src/default_test/test.java javac -d classes -classpath $(CLASSPATH) \ src/default_test/CmdlineInterface.java \ src/default_test/CmdlineEx.java \ src/default_test/Cmdline.java \ $(srcdir)/src/default_test/CmdlineWithCallbacks.java \ $(srcdir)/src/default_test/test.java classes/longmembers_test/test.class: classes/ \ src/longmembers_test/CmdlineInterface.java \ src/longmembers_test/CmdlineEx.java \ src/longmembers_test/Cmdline.java \ src/longmembers_test/CmdlineWithCallbacks.java \ src/longmembers_test/test.java javac -d classes -classpath $(CLASSPATH) \ src/longmembers_test/CmdlineInterface.java \ src/longmembers_test/CmdlineEx.java \ src/longmembers_test/Cmdline.java \ $(srcdir)/src/longmembers_test/CmdlineWithCallbacks.java \ $(srcdir)/src/longmembers_test/test.java src/default_test/CmdlineInterface.java: src/test.gp $(GENPARSE) mkdir -p src/default_test/ $(GENPARSE) -l java -D src/default_test -o Cmdline $(srcdir)/src/test.gp echo "package default_test;" > CmdlineInterface.java cat src/default_test/CmdlineInterface.java >> CmdlineInterface.java mv CmdlineInterface.java src/default_test/ echo "package default_test;" > CmdlineEx.java cat src/default_test/CmdlineEx.java >> CmdlineEx.java mv CmdlineEx.java src/default_test/ echo "package default_test;" > Cmdline.java cat src/default_test/Cmdline.java >> Cmdline.java mv Cmdline.java src/default_test/ src/longmembers_test/CmdlineInterface.java: src/test.gp $(GENPARSE) mkdir -p src/longmembers_test/ $(GENPARSE) -m -l java -D src/longmembers_test -o Cmdline $(srcdir)/src/test.gp echo "package longmembers_test;" > CmdlineInterface.java cat src/longmembers_test/CmdlineInterface.java >> CmdlineInterface.java mv CmdlineInterface.java src/longmembers_test/ echo "package longmembers_test;" > CmdlineEx.java cat src/longmembers_test/CmdlineEx.java >> CmdlineEx.java mv CmdlineEx.java src/longmembers_test/ echo "package longmembers_test;" > Cmdline.java cat src/longmembers_test/Cmdline.java >> Cmdline.java mv Cmdline.java src/longmembers_test/ EXTRA_DIST = src/test.gp \ src/tests.java \ src/default_test/CmdlineWithCallbacks.java \ src/longmembers_test/CmdlineWithCallbacks.java \ src/default_test/test.java \ src/longmembers_test/test.java classes/: mkdir -p $@ clean-local: -rm -rf classes \ src/default_test/CmdlineInterface.java \ src/default_test/CmdlineEx.java \ src/default_test/Cmdline.java \ src/longmembers_test/CmdlineInterface.java \ src/longmembers_test/CmdlineEx.java \ src/longmembers_test/Cmdline.java genparse-0.9.1/tests/javacheck/Makefile.in0000644000076600001440000005037511732677153015424 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests/javacheck DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ GENPARSE = ../../src/genparse EXTRA_DIST = src/test.gp \ src/tests.java \ src/default_test/CmdlineWithCallbacks.java \ src/longmembers_test/CmdlineWithCallbacks.java \ src/default_test/test.java \ src/longmembers_test/test.java all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/javacheck/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/javacheck/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-local \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am check: classes/tests.class java -classpath $(CLASSPATH):classes junit.textui.TestRunner tests classes/tests.class: classes/default_test/test.class classes/longmembers_test/test.class javac -d classes -classpath $(CLASSPATH):classes $(srcdir)/src/tests.java classes/default_test/test.class: classes/ \ src/default_test/CmdlineInterface.java \ src/default_test/CmdlineEx.java \ src/default_test/Cmdline.java \ src/default_test/CmdlineWithCallbacks.java \ src/default_test/test.java javac -d classes -classpath $(CLASSPATH) \ src/default_test/CmdlineInterface.java \ src/default_test/CmdlineEx.java \ src/default_test/Cmdline.java \ $(srcdir)/src/default_test/CmdlineWithCallbacks.java \ $(srcdir)/src/default_test/test.java classes/longmembers_test/test.class: classes/ \ src/longmembers_test/CmdlineInterface.java \ src/longmembers_test/CmdlineEx.java \ src/longmembers_test/Cmdline.java \ src/longmembers_test/CmdlineWithCallbacks.java \ src/longmembers_test/test.java javac -d classes -classpath $(CLASSPATH) \ src/longmembers_test/CmdlineInterface.java \ src/longmembers_test/CmdlineEx.java \ src/longmembers_test/Cmdline.java \ $(srcdir)/src/longmembers_test/CmdlineWithCallbacks.java \ $(srcdir)/src/longmembers_test/test.java src/default_test/CmdlineInterface.java: src/test.gp $(GENPARSE) mkdir -p src/default_test/ $(GENPARSE) -l java -D src/default_test -o Cmdline $(srcdir)/src/test.gp echo "package default_test;" > CmdlineInterface.java cat src/default_test/CmdlineInterface.java >> CmdlineInterface.java mv CmdlineInterface.java src/default_test/ echo "package default_test;" > CmdlineEx.java cat src/default_test/CmdlineEx.java >> CmdlineEx.java mv CmdlineEx.java src/default_test/ echo "package default_test;" > Cmdline.java cat src/default_test/Cmdline.java >> Cmdline.java mv Cmdline.java src/default_test/ src/longmembers_test/CmdlineInterface.java: src/test.gp $(GENPARSE) mkdir -p src/longmembers_test/ $(GENPARSE) -m -l java -D src/longmembers_test -o Cmdline $(srcdir)/src/test.gp echo "package longmembers_test;" > CmdlineInterface.java cat src/longmembers_test/CmdlineInterface.java >> CmdlineInterface.java mv CmdlineInterface.java src/longmembers_test/ echo "package longmembers_test;" > CmdlineEx.java cat src/longmembers_test/CmdlineEx.java >> CmdlineEx.java mv CmdlineEx.java src/longmembers_test/ echo "package longmembers_test;" > Cmdline.java cat src/longmembers_test/Cmdline.java >> Cmdline.java mv Cmdline.java src/longmembers_test/ classes/: mkdir -p $@ clean-local: -rm -rf classes \ src/default_test/CmdlineInterface.java \ src/default_test/CmdlineEx.java \ src/default_test/Cmdline.java \ src/longmembers_test/CmdlineInterface.java \ src/longmembers_test/CmdlineEx.java \ src/longmembers_test/Cmdline.java # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/tests/misc/0000777000076600001440000000000011732700535012434 500000000000000genparse-0.9.1/tests/misc/help0000755000076600001440000000760311716257231013236 00000000000000#!/bin/bash # Test if -h / --help is generated automatically, even if not # specified in the genparse file. # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "" > empty.gp echo "usage: parse_cl [ -hv ] [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code empty.gp $language for option in -h --help do if test $language = java; then java -classpath $CLASSPATH:classes simple $option > out || fail=1 else parse_cl $option > out || fail=1 fi cmp out exp || fail=1 done done # ------------------------------------------------------- echo "h flag \"Something else than help\"" > h.gp echo "usage: parse_cl [ -hv ] [ -h ] (type=FLAG) Something else than help [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp touch empty for language in $all_languages do gen_code h.gp $language # --help must print a help screen if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 # -h is a user defined function which does nothing in this simple test program if test $language = java; then java -classpath $CLASSPATH:classes simple -h > out || fail=1 else parse_cl -h > out || fail=1 fi cmp out empty || fail=1 done # ------------------------------------------------------- echo "NONE / help flag \"Only --help is defined, not -h\"" > help.gp echo "usage: parse_cl [ -v ] [ --help ] (type=FLAG) Only --help is defined, not -h [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp echo "parse_cl: invalid option -- 'h' Try \`parse_cl --help' for more information." > exp2 echo "parse_cl: invalid option -- h Try \`parse_cl --help' for more information." > java_exp2 for language in $all_languages do gen_code help.gp $language if test $language = java; then # --help must print a help screen java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 if test $language = java; then # -h is not defined java -classpath $CLASSPATH:classes simple -h 2> out && fail=1 cmp out java_exp2 || fail=1 else parse_cl -h 2>out && fail=1 cmp out exp2 || fail=1 fi done # ------------------------------------------------------- echo "h / help flag \"Both --help and -h redefined\"" > help.gp echo "usage: parse_cl [ -hv ] [ -h ] [ --help ] (type=FLAG) Both --help and -h redefined [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code help.gp $language for option in -h --help do if test $language = java; then java -classpath $CLASSPATH:classes simple $option > out || fail=1 else parse_cl $option > out || fail=1 fi cmp out exp || fail=1 done done rm -f h.gp help.gp exit $fail genparse-0.9.1/tests/misc/err_msg0000755000076600001440000000652211717271150013740 00000000000000#!/bin/bash # Test default error messages and __ERR_MSG__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "char *quotearg (char *s);" > quotearg.h echo "#include char *quotearg (char *s) { static char rval[10]; sprintf (rval, "\"\\\"%s\\\"\"", s); return (rval); }" > quotearg.c types=("long" "ulong" "intmax" "uintmax" "double") type_names=("long int" "unsigned long int" "intmax_t" "uintmax_t" "double") for ((i = 0; i < ${#types[*]}; i = i + 1)) do # test default error messages echo "a" ${types[$i]} "[1..5] \"Parameter a\"" > x.gp $GENPARSE --language c --gnulib --outfile parse_cl x.gp >/dev/null || fail=1 gcc $CFLAGS $GNULIB_CPPFLAGS -o parse_cl parse_cl.c $GNULIB_LDFLAGS $srcdir/simple.c || fail=1 # 6 is above upper bound of 5 echo "parameter range error: a must be <= 5 Try \`parse_cl --help' for more information." > exp parse_cl -a 6 2> out && fail=1 cmp out exp || fail=1 # 0 is below lower bound of 1 echo "parameter range error: a must be >= 1 Try \`parse_cl --help' for more information." > exp parse_cl -a 0 2> out && fail=1 cmp out exp || fail=1 # "one" is a string, not an integer echo "parse_cl: could not convert one to" ${type_names[$i]} > exp parse_cl -a one 2> out && fail=1 cmp out exp || fail=1 # test error message for a range error echo "a" ${types[$i]} "[1..5] \"Parameter a\" __ERR_MSG__(\"%s: my error message for parameter a\")" > x.gp $GENPARSE --language c --gnulib --outfile parse_cl x.gp >/dev/null || fail=1 gcc $CFLAGS $GNULIB_CPPFLAGS -o parse_cl parse_cl.c $GNULIB_LDFLAGS $srcdir/simple.c || fail=1 # 6 is above upper bound of 5 echo "parse_cl: 6: my error message for parameter a" > exp parse_cl -a 6 2> out && fail=1 cmp out exp || fail=1 # 0 is below lower bound of 1 echo "parse_cl: 0: my error message for parameter a" > exp parse_cl -a 0 2> out && fail=1 cmp out exp || fail=1 # "one" is a string, not an integer echo "parse_cl: one: my error message for parameter a" > exp parse_cl -a one 2> out && fail=1 cmp out exp || fail=1 # test error message with arg passed to a user defined function (quotearg) echo "#include \"quotearg.h\" a" ${types[$i]} "[1..5] \"Parameter a\" __ERR_MSG__(\"%s: my error message for parameter a\", quotearg)" > x.gp $GENPARSE --language c --gnulib --outfile parse_cl x.gp >/dev/null || fail=1 gcc $CFLAGS $GNULIB_CPPFLAGS -o parse_cl quotearg.c parse_cl.c \ $GNULIB_LDFLAGS $srcdir/simple.c || fail=1 echo "parse_cl: \"one\": my error message for parameter a" > exp parse_cl -a one 2> out && fail=1 cmp out exp || fail=1 done rm -f quotearg.h quotearg.c exit $fail genparse-0.9.1/tests/misc/quiet0000755000076600001440000000361411716257231013433 00000000000000#!/bin/bash # Test the -q / --quiet options # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "x flag x_callback()" > x.gp echo "creating parse_cl.h...done creating parse_cl.c...done creating parse_cl_cb.c...done" > c_exp echo "creating parse_cl.h...done creating parse_cl.cc...done creating parse_cl_cb.cc...done" > cc_exp echo "creating parse_clInterface.java...done creating CmdlineEx.java...done creating parse_cl.java...done" > java_exp touch empty for option in -q --quiet do $GENPARSE --language c x.gp >out || fail=1 cmp out c_exp || fail=1 $GENPARSE --language cc x.gp >out || fail=1 cmp out cc_exp || fail=1 $GENPARSE --language java x.gp >out || fail=1 cmp out java_exp || fail=1 $GENPARSE $option --language c x.gp >out || fail=1 cmp out empty || fail=1 $GENPARSE $option --language cc x.gp >out || fail=1 cmp out empty || fail=1 $GENPARSE $option --language java x.gp >out || fail=1 cmp out empty || fail=1 done rm -f parse_cl* c_exp cc_exp java_exp exit $fail genparse-0.9.1/tests/misc/int0000755000076600001440000000315711716257231013100 00000000000000#!/bin/bash # Test __INT__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "#define INT_MACRO 42" > x.h echo "#include \"x.h\" a flag \"__INT__(INT_MACRO)\" #usage_begin __GLOSSARY__ __GLOSSARY_GNU__ __INT__(17) __INT__(INT_MACRO) __INT__ ( 17 ) __INT__ ( INT_MACRO ) __INT__(17) __INT__(INT_MACRO) #usage_end" > x.gp echo " [ -a ] (type=FLAG) 42 [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. -a 42 -h, --help Display this help and exit. -v, --version Output version information and exit. 17 42 17 42 17 42" > exp for language in c cc do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done rm -f x.h exit $fail genparse-0.9.1/tests/misc/no_struct0000755000076600001440000000277711717271150014332 00000000000000#!/bin/bash # Test #no_struct # Copyright (C) 2008 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh # ------------------------------------------------------- # C language # ------------------------------------------------------- echo "extern int x;" > x.h echo "int x;" > x.c echo "#include \"x.h\" #no_struct a flag \"-a sets x to 7\" __CODE__(x = 7;) b flag \"-b prints value of x\" __CODE__(printf (\"x = %d\n\", x);)" > x.gp echo "#include #include \"parse_cl.h\" int main (int argc, char *argv[]) { Cmdline (argc, argv); return 0; }" > main.c echo "x = 7" > exp $GENPARSE --language c x.gp >/dev/null || fail=1 gcc $CFLAGS -o parse_cl parse_cl.c main.c x.c || fail=1 parse_cl -a -b > out || fail=1 cmp out exp || fail=1 rm -f x.c x.h main.c exit $fail genparse-0.9.1/tests/misc/new_print.java0000644000076600001440000000570211732677061015233 00000000000000/****************************************************************************** ** ** parse_cl.java ** ** Definition of command line parser class ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ import gnu.getopt.LongOpt; import gnu.getopt.Getopt; /*---------------------------------------------------------------------------- ** ** class Cmdline () ** ** Command line parser class. ** **--------------------------------------------------------------------------*/ public class Cmdline implements CmdlineInterface { /* parameters */ private boolean _a; private boolean _h; private boolean _v; /* Name of the calling program */ private String _executable; /* next (non-option) parameter */ private int _optind; /* Must be constructed with parameters. */ public Cmdline (String[] argv) throws CmdlineEx { /* character returned by optind () */ int c; LongOpt[] longopts = new LongOpt[3]; longopts[0] = new LongOpt ("help", LongOpt.NO_ARGUMENT, null, 'h'); longopts[1] = new LongOpt ("version", LongOpt.NO_ARGUMENT, null, 'v'); _executable = Cmdline.class.getName (); /* default values */ _a = false; _h = false; _v = false; Getopt g = new Getopt (_executable, argv, "ahv", longopts); while ((c = g.getopt ()) != -1) { switch (c) { case 'a': _a = true; break; case 'h': _h = true; usage (0, _executable); break; case 'v': _v = true; break; default: usage (-1, _executable); } } /* while */ _optind = g.getOptind (); } public void usage (int status, String program_name) { if (status != 0) { System.err.println ("Try `" + program_name + " --help' for more information."); } else { /* "comment for parameter a" */ System.out.println ( " [ -a ] (type=FLAG)\n" + " param a line 1"); System.out.println ( " param a line 2\n" + " [ -h ] [ --help ] (type=FLAG)\n" + " Display this help and exit.\n" + " [ -v ] [ --version ] (type=FLAG)\n" + " Output version information and exit."); /* "comment for parameter a" */ System.out.println ( " -a param a line 1"); System.out.println ( " param a line 2\n" + " -h, --help Display this help and exit.\n" + " -v, --version Output version information and exit.\n" + "abc"); System.out.println ( "def"); } System.exit (status); } /* return next (non-option) parameter */ public int next_param () { return _optind; } /* getter functions for command line parameters */ public boolean a () { return _a; } public boolean h () { return _h; } public boolean v () { return _v; } } genparse-0.9.1/tests/misc/program_name0000755000076600001440000000222711716257231014752 00000000000000#!/bin/bash # Test __PROGRAM_NAME__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "#usage_begin __PROGRAM_NAME__ __PROGRAM_NAME__ __PROGRAM_NAME__ #usage_end" > x.gp echo "parse_cl parse_cl parse_cl" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done exit $fail genparse-0.9.1/tests/misc/break_lines0000755000076600001440000000762111716257231014564 00000000000000#!/bin/bash # Test #break_lines and __NL__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "#break_lines 2 #usage_begin 1 2 3 #usage_end" > x.gp echo "1 2 3" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#break_lines 3 #usage_begin 1 2 3 #usage_end" > x.gp echo "1 2 3" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#break_lines 4 #usage_begin 1 2 3 #usage_end" > x.gp echo "1 2 3" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#break_lines 5 #usage_begin 1 2 3 #usage_end" > x.gp echo "1 2 3" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#break_lines 3 #usage_begin 1 2 3__NL__ 4 5 6 #usage_end" > x.gp echo "1 2 3 4 5 6" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#break_lines 40 #usage_begin __GLOSSARY__ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #usage_end" > x.gp echo " [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#break_lines 40 #usage_begin __GLOSSARY_GNU__ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #usage_end" > x.gp echo " -h, --help Display this help and exit. -v, --version Output version information and exit. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done exit $fail genparse-0.9.1/tests/misc/version0000755000076600001440000000577411716257231014002 00000000000000#!/bin/bash # Test if -v / --version is generated automatically, even if not # specified in the genparse file. # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "" > empty.gp touch empty for language in $all_languages do gen_code empty.gp $language for option in -v --version do # this simple test program doesn't do anything if -v / --version is set # but we can check its exit value if test $language = java; then java -classpath $CLASSPATH:classes simple $option > out || fail=1 else parse_cl $option > out || fail=1 fi cmp out empty || fail=1 done done # ------------------------------------------------------- echo "v flag \"Something else than version\"" > v.gp for language in $all_languages do gen_code v.gp $language for option in -v --version do if test $language = java; then java -classpath $CLASSPATH:classes simple $option > out || fail=1 else parse_cl $option > out || fail=1 fi cmp out empty || fail=1 done done # ------------------------------------------------------- echo "NONE / version flag \"Only --version is defined, not -v\"" > version.gp echo "parse_cl: invalid option -- 'v' Try \`parse_cl --help' for more information." > exp2 echo "parse_cl: invalid option -- v Try \`parse_cl --help' for more information." > java_exp2 for language in $all_languages do gen_code version.gp $language # --version is defined if test $language = java; then java -classpath $CLASSPATH:classes simple --version > out || fail=1 else parse_cl --version > out || fail=1 fi cmp out empty || fail=1 # -v is undefined if test $language = java; then java -classpath $CLASSPATH:classes simple -v 2> out && fail=1 cmp out java_exp2 || fail=1 else parse_cl -v 2>out && fail=1 cmp out exp2 || fail=1 fi done # ------------------------------------------------------- echo "v / version flag \"Both --version and -v redefined\"" > version.gp for language in $all_languages do gen_code version.gp $language for option in -v --version do if test $language = java; then java -classpath $CLASSPATH:classes simple $option > out || fail=1 else parse_cl $option > out || fail=1 fi cmp out empty || fail=1 done done rm -f v.gp version.gp exit $fail genparse-0.9.1/tests/misc/outfile0000755000076600001440000000313211716257231013746 00000000000000#!/bin/bash # Test the -o / --outfile options # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "" > empty.gp for option in -o --outfile do rm -f x.c x.h $GENPARSE --language c $option x empty.gp >/dev/null || fail=1 test -s x.c || fail=1 test -s x.h || fail=1 rm -f x.cc x.h $GENPARSE --language cpp $option x empty.gp >/dev/null || fail=1 test -s x.cc || fail=1 test -s x.h || fail=1 rm -f x.java xInterface.java CmdlineEx.java $GENPARSE --language java $option x empty.gp >/dev/null || fail=1 test -s x.java || fail=1 test -s xInterface.java || fail=1 test -s CmdlineEx.java || fail=1 done rm -f x.* xInterface.java exit $fail genparse-0.9.1/tests/misc/new_print.c0000644000076600001440000000507711732677041014537 00000000000000/****************************************************************************** ** ** parse_cl.c ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "parse_cl.h" static struct option const long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->a = false; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "ahv", long_options, &optind)) != - 1) { switch (c) { case 'a': my_args->a = true; break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { /* "comment for parameter a" */ puts ("\ [ -a ] (type=FLAG)\n\ param a line 1"); puts ("\ param a line 2\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit."); /* "comment for parameter a" */ puts ("\ -a param a line 1"); puts ("\ param a line 2\n\ -h, --help Display this help and exit.\n\ -v, --version Output version information and exit.\n\ abc"); puts ("\ def"); } exit (status); } genparse-0.9.1/tests/misc/gp_include0000755000076600001440000000550211716257231014413 00000000000000#!/bin/bash # Test #gp_include # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "a flag \"parameter a\"" > a.gp echo "c flag \"parameter c\"" > c.gp echo "e flag \"parameter e\"" > e.gp echo "w flag \"parameter w\"" > with-dash.gp echo "#gp_include a.gp b flag \"parameter b\" #gp_include c.gp d flag \"parameter d\" #gp_include e.gp #gp_include with-dash.gp" > main.gp echo "usage: parse_cl [ -abcdewhv ] [ -a ] (type=FLAG) parameter a [ -b ] (type=FLAG) parameter b [ -c ] (type=FLAG) parameter c [ -d ] (type=FLAG) parameter d [ -e ] (type=FLAG) parameter e [ -w ] (type=FLAG) parameter w [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code main.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "#mandatory x #gp_include a.gp b flag \"parameter b\" #gp_include c.gp d flag \"parameter d\" #gp_include e.gp #gp_include with-dash.gp #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ __MANDATORIES__ __GLOSSARY__ extra text #usage_end" > main.gp echo "usage: parse_cl [ -abcdewhv ] x [ -a ] (type=FLAG) parameter a [ -b ] (type=FLAG) parameter b [ -c ] (type=FLAG) parameter c [ -d ] (type=FLAG) parameter d [ -e ] (type=FLAG) parameter e [ -w ] (type=FLAG) parameter w [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. extra text" > exp for language in $all_languages do gen_code main.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done rm -f a.gp c.gp e.gp with-dash.gp main.gp exit $fail genparse-0.9.1/tests/misc/exit_value0000755000076600001440000000271511716257231014452 00000000000000#!/bin/bash # Test #exit_value # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "#exit_value 42" > x.gp echo "parse_cl: invalid option -- 'x' Try \`parse_cl --help' for more information." > exp echo "parse_cl: invalid option -- x Try \`parse_cl --help' for more information." > java_exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple -x >/dev/null 2>out && fail=1 test $? = 42 || fail=1 cmp out java_exp || fail=1 else parse_cl -x >/dev/null 2>out && fail=1 test $? = 42 || fail=1 cmp out exp || fail=1 fi done exit $fail genparse-0.9.1/tests/misc/parsefunc0000755000076600001440000000534711717271150014274 00000000000000#!/bin/bash # Test the -p / --parsefunc options # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "x flag callback_x()" > x.gp echo "usage: my_parsefunc [ -xhv ] [ -x ] (type=FLAG) [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp sed s/Cmdline/my_parsefunc/g $srcdir/simple.c > my_test.c sed s/Cmdline/my_parsefunc/g $srcdir/simple.cc > my_test.cc sed -e s/parse_cl/my_parsefunc/g -e s/simple/my_test/g $srcdir/simple.java > my_test.java for option in -p --parsefunc do $GENPARSE $option my_parsefunc --language c x.gp >/dev/null || fail=1 gcc $CFLAGS -o my_parsefunc parse_cl.c parse_cl_cb.c my_test.c || fail=1 my_parsefunc --help > out || fail=1 cmp out exp || fail=1 $GENPARSE $option my_parsefunc --language cc x.gp >/dev/null || fail=1 g++ $CXXFLAGS -o my_parsefunc parse_cl.cc parse_cl_cb.cc my_test.cc || fail=1 my_parsefunc --help > out || fail=1 cmp out exp || fail=1 $GENPARSE $option my_parsefunc --language java -o my_parsefunc x.gp >/dev/null || fail=1 rm -f classes/* || fail=1 mkdir -p classes/ || fail=1 javac -classpath $CLASSPATH:classes -d classes my_parsefuncInterface.java || fail=1 javac -classpath $CLASSPATH:classes -d classes my_parsefuncEx.java || fail=1 javac -classpath $CLASSPATH:classes -d classes my_parsefunc.java || fail=1 javac -classpath $CLASSPATH:classes -d classes my_test.java || fail=1 java -classpath $CLASSPATH:classes my_test --help > out || fail=1 cmp out exp || fail=1 done rm -f my_parsefunc* my_test.* exit $fail genparse-0.9.1/tests/misc/simple.cc0000644000076600001440000000162611716257231014157 00000000000000/* * Very simple main program. Does nothing else than command line parsing. * * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "parse_cl.h" int main (int argc, char *argv[]) { Cmdline cl (argc, argv); return 0; } genparse-0.9.1/tests/misc/debug0000755000076600001440000000302111716257231013362 00000000000000#!/bin/bash # Test the -d (debug) and -f / --logfile options # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "" > empty.gp # test if -d works rm -f log genparse.log $GENPARSE -d empty.gp >/dev/null 2>log || fail=1 test -s log || fail=1 test -s genparse.log || fail=1 # test if -f works rm -f log mylog.log $GENPARSE -d -f mylog.log empty.gp >/dev/null 2>log || fail=1 test -s log || fail=1 test -s mylog.log || fail=1 # test if --logfile works rm -f log mylog.log $GENPARSE -d --logfile mylog.log empty.gp >/dev/null 2>log || fail=1 test -s log || fail=1 test -s mylog.log || fail=1 rm -f genparse.log mylog.log log exit $fail genparse-0.9.1/tests/misc/code0000755000076600001440000000746711717271150013225 00000000000000#!/bin/bash # Test __CODE__ # Copyright (C) 2008 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh # ------------------------------------------------------- # C language # ------------------------------------------------------- echo "void print_text (void);" > x.h echo "void print_text (void) { puts (\"my text\"); }" > x.c echo "#include \"stdio.h\" #include \"x.h\" a flag \"Print command in one line\" __CODE__(printf (\"Flag a was set.\n\");) b flag \"Print command distributed among many lines\" __CODE__( printf ( \"Flag b was set.\n\" ) ; ) #usage_begin __CODE__(print_text ();) #usage_end" > x.gp echo "Flag a was set. Flag b was set." > exp echo "my text" > exp_help $GENPARSE --language c x.gp >/dev/null || fail=1 gcc $CFLAGS -o parse_cl parse_cl.c $srcdir/simple.c x.c || fail=1 parse_cl -a -b > out || fail=1 cmp out exp || fail=1 parse_cl --help > out || fail=1 cmp out exp_help || fail=1 # ------------------------------------------------------- # C++ language # ------------------------------------------------------- echo "#include void print_text (void) { std::cout << \"my text\" << std::endl; }" > x.cc $GENPARSE --language cc x.gp >/dev/null || fail=1 g++ $CXXFLAGS -o parse_cl parse_cl.cc $srcdir/simple.cc x.cc || fail=1 parse_cl -a -b > out || fail=1 cmp out exp || fail=1 parse_cl --help > out || fail=1 cmp out exp_help || fail=1 # ------------------------------------------------------- # Java language # ------------------------------------------------------- echo "#include \"x.h\" a flag \"Print command in one line\" __CODE__(System.out.println (\"Flag a was set.\");) b flag \"Print command distributed among many lines\" __CODE__( System.out.println ( \"Flag b was set.\" ) ; ) #usage_begin __CODE__(System.out.println (\"my text\");) #usage_end" > x.gp echo "class my_class { public void print_text () { System.out.println (\"my text\"); } }" > x.h $GENPARSE --language java --parsefunc parse_cl x.gp >/dev/null || fail=1 rm -f classes/* || fail=1 mkdir -p classes/ || fail=1 javac -classpath $CLASSPATH:classes -d classes parse_clInterface.java || fail=1 javac -classpath $CLASSPATH:classes -d classes parse_clEx.java || fail=1 javac -classpath $CLASSPATH:classes -d classes parse_cl.java || fail=1 javac -classpath $CLASSPATH:classes -d classes $srcdir/simple.java || fail=1 java -classpath $CLASSPATH:classes simple -a -b > out || fail=1 cmp out exp || fail=1 java -classpath $CLASSPATH:classes simple --help > out || fail=1 cmp out exp_help || fail=1 rm -f x.c x.cc x.h exp_help exit $fail genparse-0.9.1/tests/misc/simple.java0000644000076600001440000000174611716257231014516 00000000000000/* * Very simple main program. Does nothing else than command line parsing. * * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import gnu.getopt.LongOpt; import gnu.getopt.Getopt; import java.io.*; class simple { public static void main (String args[]) { parse_cl cl = new parse_cl (args); System.exit (0); } } genparse-0.9.1/tests/misc/internationalize0000755000076600001440000000411411717271150015654 00000000000000#!/bin/bash # Test the -i / --internationalize and -P / --manyprints options # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "#define _(x) x \" y\"" > i.h echo "#include \"i.h\" x flag \"Description for x\" #usage_begin Introduction__NEW_PRINT__ __GLOSSARY____NEW_PRINT__ extra text #usage_end" > i.gp echo "Introduction y [ -x ] (type=FLAG) Description for x y [ -h ] [ --help ] (type=FLAG) Display this help and exit. y [ -v ] [ --version ] (type=FLAG) Output version information and exit. y extra text y" > exp for p_option in -P --manyprints do for i_option in -i --internationalize do $GENPARSE $i_option $p_option --outfile parse_cl i.gp >/dev/null || fail=1 gcc $CFLAGS -o parse_cl parse_cl.c $srcdir/simple.c || fail=1 parse_cl --help > out || fail=1 cmp out exp || fail=1 done done echo "Warning: Internationalization not implemented for C++ output" > exp $GENPARSE --language cpp --internationalize --manyprints --outfile parse_cl i.gp\ >/dev/null 2>out || fail=1 cmp out exp || fail=1 echo "Warning: Internationalization not implemented for Java output" > exp $GENPARSE --language java --internationalize --manyprints --outfile parse_cl i.gp\ >/dev/null 2>out || fail=1 cmp out exp || fail=1 rm -f i.gp i.h exit $fail genparse-0.9.1/tests/misc/glossary0000755000076600001440000001647311717271150014153 00000000000000#!/bin/bash # Test __GLOSSARY__ and __GLOSSARY_GNU__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "a / aparam string b string NONE / cparam string #usage_begin __GLOSSARY__ #usage_end" > x.gp echo " [ -a ] [ --aparam ] (type=STRING) [ -b ] (type=STRING) [ --cparam ] (type=STRING) [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a / aparam string b string NONE / cparam string #usage_begin __GLOSSARY_GNU__ #usage_end" > x.gp echo " -a, --aparam -b --cparam -h, --help Display this help and exit. -v, --version Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a / aparam string b string NONE / cparam string #usage_begin __GLOSSARY_GNU__(16) #usage_end" > x.gp echo " -a, --aparam -b --cparam -h, --help Display this help and exit. -v, --version Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a / aparam*[=ax] string NONE / bparam=bx string \"bx is the default for bparam\" NONE / cparam=cxxxxxxxxxxxxxxxxxxxxx string \"cxxxxxxxxxxxxxxxxxxxxx is the default for cparam\" #usage_begin __GLOSSARY__ #usage_end" > x.gp echo " [ -a ] [ --aparam[=ax] ] (type=STRING) [ --bparam=bx ] (type=STRING) bx is the default for bparam [ --cparam=cxxxxxxxxxxxxxxxxxxxxx ] (type=STRING) cxxxxxxxxxxxxxxxxxxxxx is the default for cparam [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a / aparam*[=ax] string NONE / bparam=bx string \"bx is the default for bparam\" NONE / cparam=cxxxxxxxxxxxxxxxxxxxxx string \"cxxxxxxxxxxxxxxxxxxxxx is the default for cparam\" #usage_begin __GLOSSARY_GNU__ #usage_end" > x.gp echo " -a, --aparam[=ax] --bparam=bx bx is the default for bparam --cparam=cxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxxx is the default for cparam -h, --help Display this help and exit. -v, --version Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a int 12 [2..20] b float 1.2 [1.0..2] c char 'b' d string {\"abc\"} e flag #usage_begin __GLOSSARY__ #usage_end" > x.gp echo " [ -a ] (type=INTEGER, range=2...20, default=12) [ -b ] (type=REAL, range=1.0...2, default=1.2) [ -c ] (type=CHARACTER, default='b') [ -d ] (type=STRING, default=abc) [ -e ] (type=FLAG) [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a long 12 [2..20] b ulong 34 [20..50] c intmax 56 [50..60] d uintmax 78 [70..80] e double 1.2 [1..2.0] #usage_begin __GLOSSARY__ #usage_end" > x.gp echo " [ -a ] (type=LONG, range=2...20, default=12) [ -b ] (type=UNSIGNED LONG, range=20...50, default=34) [ -c ] (type=INTMAX, range=50...60, default=56) [ -d ] (type=UINTMAX, range=70...80, default=78) [ -e ] (type=DOUBLE, range=1...2.0, default=1.2) [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp $GENPARSE --gnulib x.gp >/dev/null || fail=1 gcc $CFLAGS -o parse_cl $GNULIB_CPPFLAGS parse_cl.c $GNULIB_LDFLAGS $srcdir/simple.c || fail=1 parse_cl --help > out || fail=1 cmp out exp || fail=1 # ------------------------------------------------------- echo "a int \"comment for a\" \"left aligned comment for a\" \"not left aligned comment for a\" \"another left aligned comment for a\" b string \"left aligned comment for b\" \"not left aligned comment for b\" #usage_begin __GLOSSARY__ __GLOSSARY_GNU__ #usage_end" > x.gp echo " [ -a ] (type=INTEGER) comment for a left aligned comment for a not left aligned comment for a another left aligned comment for a [ -b ] (type=STRING) left aligned comment for b not left aligned comment for b [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. -a comment for a left aligned comment for a not left aligned comment for a another left aligned comment for a -b left aligned comment for b not left aligned comment for b -h, --help Display this help and exit. -v, --version Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done exit $fail genparse-0.9.1/tests/misc/string_macro0000755000076600001440000000315411716257231014772 00000000000000#!/bin/bash # Test __STRING__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "#define STRING_MACRO \"text B\"" > x.h echo "#include \"x.h\" a flag \"__STRING__(STRING_MACRO)\" #usage_begin __GLOSSARY__ __GLOSSARY_GNU__ __STRING__(\"text A\") __STRING__(STRING_MACRO) __STRING__ ( \"text A\" ) __STRING__ ( STRING_MACRO ) __STRING__(\"text A\") __STRING__(STRING_MACRO) #usage_end" > x.gp echo " [ -a ] (type=FLAG) text B [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. -a text B -h, --help Display this help and exit. -v, --version Output version information and exit. text A text B text A text B text A text B" > exp for language in c cc do gen_code x.gp $language parse_cl --help > out || fail=1 cmp out exp || fail=1 done rm -f x.h exit $fail genparse-0.9.1/tests/misc/simple.c0000644000076600001440000000165211716257231014013 00000000000000/* * Very simple main program. Does nothing else than command line parsing. * * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "parse_cl.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); return 0; } genparse-0.9.1/tests/misc/new_print.cc0000644000076600001440000000467611732677051014707 00000000000000/****************************************************************************** ** ** parse_cl.cc ** ** Definition of command line parser class ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include "parse_cl.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) { extern char *optarg; extern int optind; int c; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; _program_name += argv[0]; /* default values */ _a = false; _h = false; _v = false; optind = 0; while ((c = getopt_long (argc, argv, "ahv", long_options, &optind)) != - 1) { switch (c) { case 'a': _a = true; break; case 'h': _h = true; this->usage (EXIT_SUCCESS); break; case 'v': _v = true; break; default: this->usage (EXIT_FAILURE); } } /* while */ _optind = optind; } /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) { if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else { // "comment for parameter a" std::cout << "\ [ -a ] (type=FLAG)\n\ param a line 1\n"; std::cout << "\ param a line 2\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n"; // "comment for parameter a" std::cout << "\ -a param a line 1\n"; std::cout << "\ param a line 2\n\ -h, --help Display this help and exit.\n\ -v, --version Output version information and exit.\n\ abc\n"; std::cout << "\ def\n"; } exit (status); } genparse-0.9.1/tests/misc/short_options0000755000076600001440000000231011716257231015206 00000000000000#!/bin/bash # Test __SHORT_OPTIONS__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "x flag y / yparam flag NONE / zparam flag #usage_begin __OPTIONS_SHORT__ __OPTIONS_SHORT__ __OPTIONS_SHORT__ #usage_end" > x.gp echo "[ -xyhv ] [ -xyhv ] [ -xyhv ]" > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done exit $fail genparse-0.9.1/tests/misc/Makefile.am0000644000076600001440000000123511673365613014415 00000000000000TESTS_ENVIRONMENT = \ PATH="$(srcdir):$(srcdir)/../../src/:$$PATH" TESTS =\ cppext\ debug\ directory\ err_msg\ int\ internationalize\ new_print\ no_struct\ outfile\ quiet\ string_macro if HAVE_JAVAC if HAVE_JAVA if HAVE_GETOPT_JAVA TESTS +=\ break_lines\ code\ do_not_document\ exit_value\ glossary\ gp_include\ help\ parsefunc\ program_name\ short_options\ version endif endif endif EXTRA_DIST = $(TESTS) test-lib.sh \ simple.c simple.cc simple.java \ new_print.c new_print.cc new_print.java clean-local: rm -f out exp exp2 java_exp java_exp2 empty empty.gp parse_cl* x.gp CmdlineEx.java *.o rm -rf classes/ genparse-0.9.1/tests/misc/directory0000755000076600001440000000330411716257231014304 00000000000000#!/bin/bash # Test the -D / --directory options # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "x flag x_callback()" > x.gp for option in -D --directory do rm -rf d mkdir d $GENPARSE --language c $option d x.gp >/dev/null || fail=1 test -s d/parse_cl.h || fail=1 test -s d/parse_cl.c || fail=1 test -s d/parse_cl_cb.c || fail=1 rm -rf d mkdir d $GENPARSE --language cc $option d x.gp >/dev/null || fail=1 test -s d/parse_cl.h || fail=1 test -s d/parse_cl.cc || fail=1 test -s d/parse_cl_cb.cc || fail=1 rm -rf d mkdir d $GENPARSE --language java $option d x.gp >/dev/null || fail=1 test -s d/parse_clInterface.java || fail=1 test -s d/parse_cl.java || fail=1 test -s d/CmdlineEx.java || fail=1 done rm -rf d exit $fail genparse-0.9.1/tests/misc/cppext0000755000076600001440000000241511716257231013605 00000000000000#!/bin/bash # Test the -c / --cppext option # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "" > empty.gp # test if -c and --cppext work for option in -c --cppext do rm -f parse_cl.* $GENPARSE -lcpp $option testext empty.gp > /dev/null || fail=1 test -f parse_cl.testext || fail=1 done # test if -c is really ignored when generating code for languages other than C++ for language in c java do rm -f parse_cl.* $GENPARSE -l$language -c testext empty.gp > /dev/null || fail=1 test -f parse_cl.testext && fail=1 test -f parse_cl.$language || fail=1 done exit $fail genparse-0.9.1/tests/misc/test-lib.sh0000644000076600001440000000523311717271150014431 00000000000000#!/bin/bash # Common functions or definitions used by all test scripts # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . LC_ALL=C export LC_ALL all_languages="c cc java" GENPARSE=../../src/genparse error_() { echo "$0: $@" 1>&2; exit 1; } framework_failure() { error_ 'failure in testing framework'; } CFLAGS=-I. CXXFLAGS=-I. GNULIB_CPPFLAGS=-I$srcdir/../../gnulib/lib GNULIB_LDFLAGS="-L../../gnulib/lib -lgnu" # Generate a simple commad line parsing program. # Parameters: # $1: genparse file # $2: programming language gen_code() { genparse_file=$1 language=$2 if test $language = java; then GENPARSE_EXTRA_OPTS="--parsefunc parse_cl" else GENPARSE_EXTRA_OPTS="" fi $GENPARSE --language $language --outfile parse_cl \ $GENPARSE_EXTRA_OPTS $genparse_file >/dev/null || fail=1 case $language in c) gcc $CFLAGS -o parse_cl parse_cl.c $srcdir/simple.c || fail=1 test -f parse_cl.c || fail=1 test -x parse_cl || fail=1 ;; cc) g++ $CXXFLAGS -o parse_cl parse_cl.cc $srcdir/simple.cc || fail=1 test -f parse_cl.cc || fail=1 test -x parse_cl || fail=1 ;; java) rm -f classes/* || fail=1 mkdir -p classes/ || fail=1 javac -classpath $CLASSPATH:classes -d classes parse_clInterface.java || fail=1 javac -classpath $CLASSPATH:classes -d classes parse_clEx.java || fail=1 javac -classpath $CLASSPATH:classes -d classes parse_cl.java || fail=1 javac -classpath $CLASSPATH:classes -d classes $srcdir/simple.java || fail=1 java -classpath $CLASSPATH:classes simple || fail=1 ;; *) fail=1 ;; esac } genparse-0.9.1/tests/misc/new_print0000755000076600001440000000261611716257231014312 00000000000000#!/bin/bash # Test __NEW_PRINT__ and __COMMENT__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "a flag __COMMENT__(\"comment for parameter a\") \"param a line 1__NEW_PRINT__\" \"param a line 2\" #usage_begin __GLOSSARY__ __GLOSSARY_GNU__ abc__NEW_PRINT__ def #usage_end" > x.gp # __NEW_PRINT__ and __COMMENT__ can hardly be checked other than by # comparing to a reference output file $GENPARSE --language c --static x.gp >/dev/null cmp parse_cl.c $srcdir/new_print.c || fail=1 $GENPARSE --language cc --static x.gp >/dev/null cmp parse_cl.cc $srcdir/new_print.cc || fail=1 $GENPARSE --language java --static x.gp >/dev/null cmp parse_cl.java $srcdir/new_print.java || fail=1 exit $fail genparse-0.9.1/tests/misc/do_not_document0000755000076600001440000000344011716257231015461 00000000000000#!/bin/bash # Test __DO_NOT_DOCUMENT__ # Copyright (C) 2007 - 2012 Michael Geng # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . if test "$VERBOSE" = yes; then set -x fi . test-lib.sh echo "a flag __DO_NOT_DOCUMENT__" > x.gp echo "usage: parse_cl [ -hv ] [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done # ------------------------------------------------------- echo "a flag __DO_NOT_DOCUMENT__ b flag \"__DO_NOT_DOCUMENT__\" #usage_begin __GLOSSARY_GNU__ #usage_end" > x.gp echo " -h, --help Display this help and exit. -v, --version Output version information and exit." > exp for language in $all_languages do gen_code x.gp $language if test $language = java; then java -classpath $CLASSPATH:classes simple --help > out || fail=1 else parse_cl --help > out || fail=1 fi cmp out exp || fail=1 done exit $fail genparse-0.9.1/tests/misc/Makefile.in0000644000076600001440000005155211732677153014436 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@am__append_1 = \ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ break_lines\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ code\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ do_not_document\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ exit_value\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ glossary\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ gp_include\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ help\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ parsefunc\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ program_name\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ short_options\ @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@ version subdir = tests/misc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ TESTS_ENVIRONMENT = \ PATH="$(srcdir):$(srcdir)/../../src/:$$PATH" TESTS = cppext debug directory err_msg int internationalize new_print \ no_struct outfile quiet string_macro $(am__append_1) EXTRA_DIST = $(TESTS) test-lib.sh \ simple.c simple.cc simple.java \ new_print.c new_print.cc new_print.java all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/misc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/misc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-local distclean distclean-generic distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am clean-local: rm -f out exp exp2 java_exp java_exp2 empty empty.gp parse_cl* x.gp CmdlineEx.java *.o rm -rf classes/ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/tests/cppcheck/0000777000076600001440000000000011732700535013261 500000000000000genparse-0.9.1/tests/cppcheck/genparse_test.h0000644000076600001440000000361011716257231016213 00000000000000/* * Test program for testing the C++ output of genparse using a CppUnit * (http://sourceforge.net/projects/cppunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef DEFAULT_TEST_H #define DEFAULT_TEST_H #include #include using namespace std; class genparse_test : public CPPUNIT_NS :: TestFixture { CPPUNIT_TEST_SUITE (genparse_test); CPPUNIT_TEST (testNoArgs); CPPUNIT_TEST (testShortOptions); CPPUNIT_TEST (testLongOptions); CPPUNIT_TEST (testOutOfRange1); CPPUNIT_TEST (testOutOfRange2); CPPUNIT_TEST (testOutOfRange3); CPPUNIT_TEST (testOutOfRange4); CPPUNIT_TEST (testCallbacks); CPPUNIT_TEST (testMultipleShortOptions); CPPUNIT_TEST_SUITE_END (); public: void setUp (void); protected: void testNoArgs (void); void testShortOptions (void); void testLongOptions (void); void testOutOfRange1 (void); void testOutOfRange2 (void); void testOutOfRange3 (void); void testOutOfRange4 (void); void testCallbacks (void); void testMultipleShortOptions (void); private: int argc; const char *argv[100]; }; extern int test_g; extern int test_c; extern int test_s; extern int test_c_g; #endif // DEFAULT_TEST_H genparse-0.9.1/tests/cppcheck/longmembers_callback.cc0000644000076600001440000000341611716257231017640 00000000000000/* * Hand edited version of longmembers_clp_cb.cc which is generated * automatically by genparse from test.gp. * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "longmembers_clp.h" int test_g; int test_c; int test_s; int test_c_g; /*---------------------------------------------------------------------------- ** ** Cmdline::my_callback () ** ** Global callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::my_callback () { test_g = 1; test_c_g = 1; return true; } /*---------------------------------------------------------------------------- ** ** Cmdline::char_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::char_cb () { test_c_g = (int)cparam (); test_c = (int)cparam (); return true; } /*---------------------------------------------------------------------------- ** ** Cmdline::string_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::string_cb () { test_s = 3; return true; } genparse-0.9.1/tests/cppcheck/default_test.cc0000644000076600001440000001675111716257231016203 00000000000000/* * Test program for testing the C++ output of genparse using a CppUnit * (http://sourceforge.net/projects/cppunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "default_clp.h" #include "genparse_test.h" CPPUNIT_TEST_SUITE_REGISTRATION (genparse_test); void genparse_test::setUp (void) { argc = 0; } void genparse_test::testNoArgs (void) { argv[argc++] = "default_test"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 'c', Options.c ()); CPPUNIT_ASSERT_EQUAL ( 0, Options.c_li ()); CPPUNIT_ASSERT_EQUAL ( '\013', Options.d ()); CPPUNIT_ASSERT_EQUAL ( '\n', Options.e ()); CPPUNIT_ASSERT_EQUAL ( (float)1.2, Options.f ()); CPPUNIT_ASSERT_EQUAL ( 0, Options.f_li ()); CPPUNIT_ASSERT_EQUAL ( false, Options.g ()); CPPUNIT_ASSERT_EQUAL ( false, Options.h ()); CPPUNIT_ASSERT_EQUAL ( 1, Options.i ()); CPPUNIT_ASSERT_EQUAL ( 3, Options.o ()); CPPUNIT_ASSERT_EQUAL ( false, Options.o_flag ()); CPPUNIT_ASSERT_EQUAL ( string (""), Options.p ()); CPPUNIT_ASSERT_EQUAL ( false, Options.p_flag ()); CPPUNIT_ASSERT_EQUAL ( 4, Options.q ()); CPPUNIT_ASSERT_EQUAL ( false, Options.q_flag ()); CPPUNIT_ASSERT_EQUAL ( 7, Options.P ()); CPPUNIT_ASSERT_EQUAL ( false, Options.P_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("S"), Options.Q ()); CPPUNIT_ASSERT_EQUAL ( false, Options.Q_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("abc"), Options.s ()); CPPUNIT_ASSERT_EQUAL ( false, Options.v ()); CPPUNIT_ASSERT_EQUAL (string ("haha"), Options.a_ha ()); CPPUNIT_ASSERT_EQUAL ( false, Options._1 ()); CPPUNIT_ASSERT_EQUAL ( false, Options.w_flag ()); CPPUNIT_ASSERT_EQUAL ( 1, Options.next_param ()); } void genparse_test::testShortOptions (void) { argv[argc++] = "default_test"; argv[argc++] = "-ca"; argv[argc++] = "-f2"; argv[argc++] = "-g"; argv[argc++] = "-i7"; argv[argc++] = "-o11"; argv[argc++] = "-pquak"; argv[argc++] = "-q500"; argv[argc++] = "-P12"; argv[argc++] = "-Q"; argv[argc++] = "-sbla"; argv[argc++] = "-t17"; argv[argc++] = "-1"; argv[argc++] = "-w9"; argv[argc++] = "myfilename"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 'a', Options.c ()); CPPUNIT_ASSERT_EQUAL ( 2, Options.c_li ()); CPPUNIT_ASSERT_EQUAL ( (float)2, Options.f ()); CPPUNIT_ASSERT_EQUAL ( 3, Options.f_li ()); CPPUNIT_ASSERT_EQUAL ( true, Options.g ()); CPPUNIT_ASSERT_EQUAL ( false, Options.h ()); CPPUNIT_ASSERT_EQUAL ( 7, Options.i ()); CPPUNIT_ASSERT_EQUAL ( 11, Options.o ()); CPPUNIT_ASSERT_EQUAL ( true, Options.o_flag ()); CPPUNIT_ASSERT_EQUAL (string ("quak"), Options.p ()); CPPUNIT_ASSERT_EQUAL ( true, Options.p_flag ()); CPPUNIT_ASSERT_EQUAL ( 500, Options.q ()); CPPUNIT_ASSERT_EQUAL ( true, Options.q_flag ()); CPPUNIT_ASSERT_EQUAL ( 12, Options.P ()); CPPUNIT_ASSERT_EQUAL ( true, Options.P_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("S"), Options.Q ()); CPPUNIT_ASSERT_EQUAL ( true, Options.Q_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("bla"), Options.s ()); CPPUNIT_ASSERT_EQUAL ( 17, Options.t ()); CPPUNIT_ASSERT_EQUAL ( true, Options._1 ()); CPPUNIT_ASSERT_EQUAL ( true, Options.w_flag ()); CPPUNIT_ASSERT_EQUAL ( 9, Options.w ()); CPPUNIT_ASSERT_EQUAL ( argc - 1, Options.next_param ()); } void genparse_test::testLongOptions (void) { argv[argc++] = "default_test"; argv[argc++] = "--cparam=b"; argv[argc++] = "--fparam=1.5"; argv[argc++] = "--gparam"; argv[argc++] = "--iparam=8"; argv[argc++] = "--oparam=9"; argv[argc++] = "--pparam=pp"; argv[argc++] = "--qparam=111"; argv[argc++] = "--Pparam"; argv[argc++] = "--Qparam=AAA"; argv[argc++] = "--sparam=aaa"; argv[argc++] = "--uparam=18"; argv[argc++] = "--vparam=19"; argv[argc++] = "--a-ha=hihi"; argv[argc++] = "--wparam=99"; argv[argc++] = "myfilename"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 'b', Options.c ()); CPPUNIT_ASSERT_EQUAL ( 2, Options.c_li ()); CPPUNIT_ASSERT_EQUAL ( (float)1.5, Options.f ()); CPPUNIT_ASSERT_EQUAL ( 3, Options.f_li ()); CPPUNIT_ASSERT_EQUAL ( true, Options.g ()); CPPUNIT_ASSERT_EQUAL ( false, Options.h ()); CPPUNIT_ASSERT_EQUAL ( 8, Options.i ()); CPPUNIT_ASSERT_EQUAL ( 9, Options.o ()); CPPUNIT_ASSERT_EQUAL ( true, Options.o_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("pp"), Options.p ()); CPPUNIT_ASSERT_EQUAL ( true, Options.p_flag ()); CPPUNIT_ASSERT_EQUAL ( 111, Options.q ()); CPPUNIT_ASSERT_EQUAL ( true, Options.q_flag ()); CPPUNIT_ASSERT_EQUAL ( 7, Options.P ()); CPPUNIT_ASSERT_EQUAL ( true, Options.P_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("AAA"), Options.Q ()); CPPUNIT_ASSERT_EQUAL ( true, Options.Q_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("aaa"), Options.s ()); CPPUNIT_ASSERT_EQUAL ( 18, Options.uparam ()); CPPUNIT_ASSERT_EQUAL ( 19, Options.vparam ()); CPPUNIT_ASSERT_EQUAL (string ("hihi"), Options.a_ha ()); CPPUNIT_ASSERT_EQUAL ( true, Options.w_flag ()); CPPUNIT_ASSERT_EQUAL ( 99, Options.w ()); CPPUNIT_ASSERT_EQUAL ( argc - 1, Options.next_param ()); } void genparse_test::testOutOfRange1 (void) { argv[argc++] = "default_test"; argv[argc++] = "-i0"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testOutOfRange2 (void) { argv[argc++] = "default_test"; argv[argc++] = "-i11"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testOutOfRange3 (void) { argv[argc++] = "default_test"; argv[argc++] = "-f0"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testOutOfRange4 (void) { argv[argc++] = "default_test"; argv[argc++] = "-f3"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testCallbacks (void) { argv[argc++] = "default_test"; argv[argc++] = "-c2"; test_g = 0; test_c = 0; test_s = 0; test_c_g = 0; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 1, test_g); CPPUNIT_ASSERT_EQUAL (50, test_c); CPPUNIT_ASSERT_EQUAL ( 0, test_s); CPPUNIT_ASSERT_EQUAL ( 1, test_c_g); } void genparse_test::testMultipleShortOptions (void) { argv[argc++] = "default_test"; argv[argc++] = "-R"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL (true, Options.r ()); } int my_function (void) { } genparse-0.9.1/tests/cppcheck/default_callback.cc0000644000076600001440000000337411716257231016755 00000000000000/* * Hand edited version of default_clp_cb.cc which is generated * automatically by genparse from test.gp. * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "default_clp.h" int test_g; int test_c; int test_s; int test_c_g; /*---------------------------------------------------------------------------- ** ** Cmdline::my_callback () ** ** Global callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::my_callback () { test_g = 1; test_c_g = 1; return true; } /*---------------------------------------------------------------------------- ** ** Cmdline::char_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::char_cb () { test_c_g = (int)c (); test_c = (int)c (); return true; } /*---------------------------------------------------------------------------- ** ** Cmdline::string_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::string_cb () { test_s = 3; return true; } genparse-0.9.1/tests/cppcheck/longmembers_test.cc0000644000076600001440000001750311716257231017065 00000000000000/* * Test program for testing the C++ output of genparse using a CppUnit * (http://sourceforge.net/projects/cppunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "longmembers_clp.h" #include "genparse_test.h" CPPUNIT_TEST_SUITE_REGISTRATION (genparse_test); void genparse_test::setUp (void) { argc = 0; } void genparse_test::testNoArgs (void) { argv[argc++] = "longmembers_test"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 'c', Options.cparam ()); CPPUNIT_ASSERT_EQUAL ( 0, Options.cparam_li ()); CPPUNIT_ASSERT_EQUAL ( '\013', Options.dparam ()); CPPUNIT_ASSERT_EQUAL ( '\n', Options.eparam ()); CPPUNIT_ASSERT_EQUAL ( (float)1.2, Options.fparam ()); CPPUNIT_ASSERT_EQUAL ( 0, Options.fparam_li ()); CPPUNIT_ASSERT_EQUAL ( false, Options.gparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.help ()); CPPUNIT_ASSERT_EQUAL ( 1, Options.iparam ()); CPPUNIT_ASSERT_EQUAL ( 3, Options.oparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.oparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string (""), Options.pparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.pparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 4, Options.qparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.qparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 7, Options.Pparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.Pparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("S"), Options.Qparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.Qparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("abc"), Options.sparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.version ()); CPPUNIT_ASSERT_EQUAL (string ("haha"), Options.a_ha ()); CPPUNIT_ASSERT_EQUAL ( false, Options._1 ()); CPPUNIT_ASSERT_EQUAL ( false, Options.wparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 1, Options.next_param ()); } void genparse_test::testShortOptions (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "-ca"; argv[argc++] = "-f2"; argv[argc++] = "-g"; argv[argc++] = "-i7"; argv[argc++] = "-o11"; argv[argc++] = "-pquak"; argv[argc++] = "-q500"; argv[argc++] = "-P12"; argv[argc++] = "-Q"; argv[argc++] = "-sbla"; argv[argc++] = "-t17"; argv[argc++] = "-1"; argv[argc++] = "-w9"; argv[argc++] = "myfilename"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 'a', Options.cparam ()); CPPUNIT_ASSERT_EQUAL ( 2, Options.cparam_li ()); CPPUNIT_ASSERT_EQUAL ( (float)2, Options.fparam ()); CPPUNIT_ASSERT_EQUAL ( 3, Options.fparam_li ()); CPPUNIT_ASSERT_EQUAL ( true, Options.gparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.help ()); CPPUNIT_ASSERT_EQUAL ( 7, Options.iparam ()); CPPUNIT_ASSERT_EQUAL ( 11, Options.oparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.oparam_flag ()); CPPUNIT_ASSERT_EQUAL (string ("quak"), Options.pparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.pparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 500, Options.qparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.qparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 12, Options.Pparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.Pparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("S"), Options.Qparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.Qparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("bla"), Options.sparam ()); CPPUNIT_ASSERT_EQUAL ( 17, Options.t ()); CPPUNIT_ASSERT_EQUAL ( true, Options._1 ()); CPPUNIT_ASSERT_EQUAL ( true, Options.wparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 9, Options.wparam ()); CPPUNIT_ASSERT_EQUAL ( argc - 1, Options.next_param ()); } void genparse_test::testLongOptions (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "--cparam=b"; argv[argc++] = "--fparam=1.5"; argv[argc++] = "--gparam"; argv[argc++] = "--iparam=8"; argv[argc++] = "--oparam=9"; argv[argc++] = "--pparam=pp"; argv[argc++] = "--qparam=111"; argv[argc++] = "--Pparam"; argv[argc++] = "--Qparam=AAA"; argv[argc++] = "--sparam=aaa"; argv[argc++] = "--uparam=18"; argv[argc++] = "--vparam=19"; argv[argc++] = "--a-ha=hihi"; argv[argc++] = "--wparam=99"; argv[argc++] = "myfilename"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 'b', Options.cparam ()); CPPUNIT_ASSERT_EQUAL ( 2, Options.cparam_li ()); CPPUNIT_ASSERT_EQUAL ( (float)1.5, Options.fparam ()); CPPUNIT_ASSERT_EQUAL ( 3, Options.fparam_li ()); CPPUNIT_ASSERT_EQUAL ( true, Options.gparam ()); CPPUNIT_ASSERT_EQUAL ( false, Options.help ()); CPPUNIT_ASSERT_EQUAL ( 8, Options.iparam ()); CPPUNIT_ASSERT_EQUAL ( 9, Options.oparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.oparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("pp"), Options.pparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.pparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 111, Options.qparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.qparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 7, Options.Pparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.Pparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("AAA"), Options.Qparam ()); CPPUNIT_ASSERT_EQUAL ( true, Options.Qparam_flag ()); CPPUNIT_ASSERT_EQUAL ( string ("aaa"), Options.sparam ()); CPPUNIT_ASSERT_EQUAL ( 18, Options.uparam ()); CPPUNIT_ASSERT_EQUAL ( 19, Options.vparam ()); CPPUNIT_ASSERT_EQUAL (string ("hihi"), Options.a_ha ()); CPPUNIT_ASSERT_EQUAL ( true, Options.wparam_flag ()); CPPUNIT_ASSERT_EQUAL ( 99, Options.wparam ()); CPPUNIT_ASSERT_EQUAL ( argc - 1, Options.next_param ()); } void genparse_test::testOutOfRange1 (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "-i0"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testOutOfRange2 (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "-i11"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testOutOfRange3 (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "-f0"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testOutOfRange4 (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "-f3"; CPPUNIT_ASSERT_THROW (Cmdline Options (argc, (char **)argv), string); } void genparse_test::testCallbacks (void) { argv[argc++] = "longmembers_test"; argv[argc++] = "-c2"; test_g = 0; test_c = 0; test_s = 0; test_c_g = 0; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL ( 1, test_g); CPPUNIT_ASSERT_EQUAL (50, test_c); CPPUNIT_ASSERT_EQUAL ( 0, test_s); CPPUNIT_ASSERT_EQUAL ( 1, test_c_g); } void genparse_test::testMultipleShortOptions (void) { argv[argc++] = "default_test"; argv[argc++] = "-R"; Cmdline Options (argc, (char **)argv); CPPUNIT_ASSERT_EQUAL (true, Options.rparam ()); } int my_function (void) { } genparse-0.9.1/tests/cppcheck/longmembers_clp.cc0000644000076600001440000001672211732677234016675 00000000000000/****************************************************************************** ** ** longmembers_clp.cc ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** Definition of command line parser class ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include "longmembers_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) { extern char *optarg; extern int optind; int c; static struct option long_options[] = { {"cparam", required_argument, NULL, 'c'}, {"dparam", required_argument, NULL, 'd'}, {"eparam", required_argument, NULL, 'e'}, {"fparam", required_argument, NULL, 'f'}, {"gparam", no_argument, NULL, 'g'}, {"iparam", required_argument, NULL, 'i'}, {"oparam", optional_argument, NULL, 'o'}, {"pparam", required_argument, NULL, 'p'}, {"qparam", optional_argument, NULL, 'q'}, {"Pparam", no_argument, NULL, 'P'}, {"Qparam", optional_argument, NULL, 'Q'}, {"rparam", no_argument, NULL, 'r'}, {"sparam", required_argument, NULL, 's'}, {"uparam", required_argument, NULL, 256}, {"vparam", required_argument, NULL, 257}, {"a-ha", required_argument, NULL, 258}, {"wparam", required_argument, NULL, 'w'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; _program_name += argv[0]; /* default values */ _cparam = 'c'; _cparam_li = 0; _dparam = '\013'; _eparam = '\n'; _fparam = 1.2; _fparam_li = 0; _gparam = false; _iparam = 1; _oparam = 3; _oparam_flag = false; _pparam_flag = false; _qparam = 4; _qparam_flag = false; _Pparam = 7; _Pparam_flag = false; _Qparam = "S"; _Qparam_flag = false; _rparam = false; _sparam = "abc"; _a_ha = "haha"; __1 = false; _wparam_flag = false; _help = false; _version = false; optind = 0; while ((c = getopt_long (argc, argv, "c:d:e:f:gi:o::p::q:P::QrRs:t:1w:hv", long_options, &optind)) != - 1) { switch (c) { case 'c': _cparam = *optarg; _cparam_li = optind; if (!char_cb ()) this->usage (EXIT_FAILURE); break; case 'd': _dparam = *optarg; if (!char_cb ()) this->usage (EXIT_FAILURE); break; case 'e': _eparam = *optarg; break; case 'f': _fparam = atof (optarg); _fparam_li = optind; if (_fparam < 1) { std::string s; s += "parameter range error: fparam must be >= 1"; throw (s); } if (_fparam > 2.3) { std::string s; s += "parameter range error: fparam must be <= 2.3"; throw (s); } break; case 'g': _gparam = true; break; case 'i': _iparam = atoi (optarg); if (_iparam < 1) { std::string s; s += "parameter range error: iparam must be >= 1"; throw (s); } if (_iparam > MAX) { std::string s; s += "parameter range error: iparam must be <= MAX"; throw (s); } break; case 'o': _oparam_flag = true; if (optarg != NULL) _oparam = atoi (optarg); break; case 'p': _pparam_flag = true; if (optarg != NULL) _pparam = optarg; break; case 'q': _qparam_flag = true; if (optarg != NULL) _qparam = atoi (optarg); break; case 'P': _Pparam_flag = true; if (optarg != NULL) _Pparam = atoi (optarg); break; case 'Q': _Qparam_flag = true; if (optarg != NULL) _Qparam = optarg; break; case 'r': case 'R': _rparam = true; break; case 's': _sparam = optarg; if (!string_cb ()) this->usage (EXIT_FAILURE); break; case 't': _t = atoi (optarg); break; case 256: _uparam = atoi (optarg); break; case 257: _vparam = atoi (optarg); break; case 258: _a_ha = optarg; break; case '1': __1 = true; break; case 'w': _wparam_flag = true; if (optarg != NULL) _wparam = atoi (optarg); break; case 'h': _help = true; this->usage (EXIT_SUCCESS); break; case 'v': _version = true; break; default: this->usage (EXIT_FAILURE); } } /* while */ _optind = optind; if (!my_callback ()) usage (EXIT_FAILURE); } /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) { if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else { std::cout << "\ " << _program_name << "\n\ \n\ -c, --cparam This is a char parameter.\n\ -d, --dparam This is a char parameter initialized with an\n\ octal value.\n\ -e, --eparam This is a char parameter initialized with newline.\n\ -f, --fparam This is a float parameter.\n\ -g, --gparam This is a flag parameter.\n\ -i, --iparam This is an integer parameter.\n\ -o, --oparam Both short and long option have an optional\n\ argument\n\ -p, --pparam Short option has an optional argument,\n\ long option requires an argument.\n\ -q, --qparam Short option reqires an argument,\n\ long option has an optional argument.\n\ -P, --Pparam Short option has an optional argument,\n\ long option none.\n\ -Q, --Qparam Short option has no argument, long option has an\n\ optional argument.\n\ -r -R, --rparam This parameter has 2 short representations.\n\ -s, --sparam This is a string parameter.\n\ -t This parameter only has a short representation\n\ --uparam This parameter only has a long representation\n\ --vparam=V This parameter has a designation\n\ --a-ha This parameter has a dash in its name\n\ -1 This is a single digit parameter\n\ -w, --wparam This parameter also sets a flag\n\ -h, --help Display this help and exit.\n\ -v, --version Output version information and exit.\n\ \n\ " << TEST_TEXT_MACRO << "\n\ \n\ " << TEST_INT_MACRO << "\n\ \n\ __COMMAND__(my_function ())\n"; } exit (status); } genparse-0.9.1/tests/cppcheck/test.gp0000644000076600001440000000316210733740606014511 00000000000000#include "test.h" #mandatory file #exit_value EXIT_FAILURE my_callback () c / cparam char 'c' char_cb () "This is a char parameter." __STORE_LONGINDEX__ d / dparam char '\013' char_cb () "This is a char parameter initialized with an" "octal value." e / eparam char '\n' "This is a char parameter initialized with newline." f / fparam float 1.2 [1..2.3] "This is a float parameter." __STORE_LONGINDEX__ g / gparam flag "This is a flag parameter." i / iparam int 1 [1..MAX] "This is an integer parameter." o* / oparam* int 3 "Both short and long option have an optional" "argument" p* / pparam string "Short option has an optional argument," "long option requires an argument." q / qparam* int 4 "Short option reqires an argument," "long option has an optional argument." P* / Pparam! int 7 "Short option has an optional argument," "long option none." Q!/ Qparam* string {"S"} "Short option has no argument, long option has an" "optional argument." rR / rparam flag "This parameter has 2 short representations." s / sparam string {"abc"} string_cb () "This is a string parameter." t int "This parameter only has a short representation" NONE / uparam int "This parameter only has a long representation" NONE / vparam=V int "This parameter has a designation" NONE / a-ha string {"haha"} "This parameter has a dash in its name" 1 flag "This is a single digit parameter" w / wparam int "This parameter also sets a flag" __ADD_FLAG__ #usage_begin __PROGRAM_NAME__ __GLOSSARY_GNU__ __STRING__(TEST_TEXT_MACRO) __INT__(TEST_INT_MACRO) __COMMAND__(my_function ()) #usage_end genparse-0.9.1/tests/cppcheck/test.h0000644000076600001440000000015710716362245014333 00000000000000#define MAX 10 #define TEST_TEXT_MACRO "test text" #define TEST_INT_MACRO 17 extern int my_function (void); genparse-0.9.1/tests/cppcheck/default_clp.cc0000644000076600001440000001627611732677234016013 00000000000000/****************************************************************************** ** ** default_clp.cc ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** Definition of command line parser class ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include "default_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) { extern char *optarg; extern int optind; int c; static struct option long_options[] = { {"cparam", required_argument, NULL, 'c'}, {"dparam", required_argument, NULL, 'd'}, {"eparam", required_argument, NULL, 'e'}, {"fparam", required_argument, NULL, 'f'}, {"gparam", no_argument, NULL, 'g'}, {"iparam", required_argument, NULL, 'i'}, {"oparam", optional_argument, NULL, 'o'}, {"pparam", required_argument, NULL, 'p'}, {"qparam", optional_argument, NULL, 'q'}, {"Pparam", no_argument, NULL, 'P'}, {"Qparam", optional_argument, NULL, 'Q'}, {"rparam", no_argument, NULL, 'r'}, {"sparam", required_argument, NULL, 's'}, {"uparam", required_argument, NULL, 256}, {"vparam", required_argument, NULL, 257}, {"a-ha", required_argument, NULL, 258}, {"wparam", required_argument, NULL, 'w'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; _program_name += argv[0]; /* default values */ _c = 'c'; _c_li = 0; _d = '\013'; _e = '\n'; _f = 1.2; _f_li = 0; _g = false; _i = 1; _o = 3; _o_flag = false; _p_flag = false; _q = 4; _q_flag = false; _P = 7; _P_flag = false; _Q = "S"; _Q_flag = false; _r = false; _s = "abc"; _a_ha = "haha"; __1 = false; _w_flag = false; _h = false; _v = false; optind = 0; while ((c = getopt_long (argc, argv, "c:d:e:f:gi:o::p::q:P::QrRs:t:1w:hv", long_options, &optind)) != - 1) { switch (c) { case 'c': _c = *optarg; _c_li = optind; if (!char_cb ()) this->usage (EXIT_FAILURE); break; case 'd': _d = *optarg; if (!char_cb ()) this->usage (EXIT_FAILURE); break; case 'e': _e = *optarg; break; case 'f': _f = atof (optarg); _f_li = optind; if (_f < 1) { std::string s; s += "parameter range error: f must be >= 1"; throw (s); } if (_f > 2.3) { std::string s; s += "parameter range error: f must be <= 2.3"; throw (s); } break; case 'g': _g = true; break; case 'i': _i = atoi (optarg); if (_i < 1) { std::string s; s += "parameter range error: i must be >= 1"; throw (s); } if (_i > MAX) { std::string s; s += "parameter range error: i must be <= MAX"; throw (s); } break; case 'o': _o_flag = true; if (optarg != NULL) _o = atoi (optarg); break; case 'p': _p_flag = true; if (optarg != NULL) _p = optarg; break; case 'q': _q_flag = true; if (optarg != NULL) _q = atoi (optarg); break; case 'P': _P_flag = true; if (optarg != NULL) _P = atoi (optarg); break; case 'Q': _Q_flag = true; if (optarg != NULL) _Q = optarg; break; case 'r': case 'R': _r = true; break; case 's': _s = optarg; if (!string_cb ()) this->usage (EXIT_FAILURE); break; case 't': _t = atoi (optarg); break; case 256: _uparam = atoi (optarg); break; case 257: _vparam = atoi (optarg); break; case 258: _a_ha = optarg; break; case '1': __1 = true; break; case 'w': _w_flag = true; if (optarg != NULL) _w = atoi (optarg); break; case 'h': _h = true; this->usage (EXIT_SUCCESS); break; case 'v': _v = true; break; default: this->usage (EXIT_FAILURE); } } /* while */ _optind = optind; if (!my_callback ()) usage (EXIT_FAILURE); } /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) { if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else { std::cout << "\ " << _program_name << "\n\ \n\ -c, --cparam This is a char parameter.\n\ -d, --dparam This is a char parameter initialized with an\n\ octal value.\n\ -e, --eparam This is a char parameter initialized with newline.\n\ -f, --fparam This is a float parameter.\n\ -g, --gparam This is a flag parameter.\n\ -i, --iparam This is an integer parameter.\n\ -o, --oparam Both short and long option have an optional\n\ argument\n\ -p, --pparam Short option has an optional argument,\n\ long option requires an argument.\n\ -q, --qparam Short option reqires an argument,\n\ long option has an optional argument.\n\ -P, --Pparam Short option has an optional argument,\n\ long option none.\n\ -Q, --Qparam Short option has no argument, long option has an\n\ optional argument.\n\ -r -R, --rparam This parameter has 2 short representations.\n\ -s, --sparam This is a string parameter.\n\ -t This parameter only has a short representation\n\ --uparam This parameter only has a long representation\n\ --vparam=V This parameter has a designation\n\ --a-ha This parameter has a dash in its name\n\ -1 This is a single digit parameter\n\ -w, --wparam This parameter also sets a flag\n\ -h, --help Display this help and exit.\n\ -v, --version Output version information and exit.\n\ \n\ " << TEST_TEXT_MACRO << "\n\ \n\ " << TEST_INT_MACRO << "\n\ \n\ __COMMAND__(my_function ())\n"; } exit (status); } genparse-0.9.1/tests/cppcheck/Makefile.am0000644000076600001440000000126110721067670015234 00000000000000GENPARSE = ../../src/genparse INCLUDES = $(CPPUNIT_CFLAGS) LDADD = $(CPPUNIT_LIBS) if HAVE_CPPUNIT TESTS = default_test longmembers_test check_PROGRAMS = $(TESTS) endif default_test_SOURCES = default_clp.cc default_callback.cc default_test.cc ftest.cc longmembers_test_SOURCES = longmembers_clp.cc longmembers_callback.cc longmembers_test.cc ftest.cc EXTRA_DIST = test.gp genparse_test.h test.h default_clp.cc: test.gp test.h $(GENPARSE) $(GENPARSE) -l cpp -D. -o default_clp $(srcdir)/test.gp longmembers_clp.cc: test.gp test.h $(GENPARSE) $(GENPARSE) -m -l cpp -D. -o longmembers_clp $(srcdir)/test.gp clean-local: -rm -f default_clp* longmembers_clp* $(TESTS) genparse-0.9.1/tests/cppcheck/ftest.cc0000644000076600001440000000333511716257231014637 00000000000000/* * Main program for testing the C++ output of genparse using a CppUnit * (http://sourceforge.net/projects/cppunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include int main (int argc, char* argv[]) { // informs test-listener about testresults CPPUNIT_NS :: TestResult testresult; // register listener for collecting the test-results CPPUNIT_NS :: TestResultCollector collectedresults; testresult.addListener (&collectedresults); // insert test-suite at test-runner by registry CPPUNIT_NS :: TestRunner testrunner; testrunner.addTest (CPPUNIT_NS :: TestFactoryRegistry :: getRegistry ().makeTest ()); testrunner.run (testresult); // output results in compiler-format CPPUNIT_NS :: CompilerOutputter compileroutputter (&collectedresults, std::cerr); compileroutputter.write (); // return 0 if tests were successful return collectedresults.wasSuccessful () ? 0 : 1; } genparse-0.9.1/tests/cppcheck/Makefile.in0000644000076600001440000006233011732677152015256 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_CPPUNIT_TRUE@TESTS = default_test$(EXEEXT) \ @HAVE_CPPUNIT_TRUE@ longmembers_test$(EXEEXT) @HAVE_CPPUNIT_TRUE@check_PROGRAMS = $(am__EXEEXT_1) subdir = tests/cppcheck DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @HAVE_CPPUNIT_TRUE@am__EXEEXT_1 = default_test$(EXEEXT) \ @HAVE_CPPUNIT_TRUE@ longmembers_test$(EXEEXT) am_default_test_OBJECTS = default_clp.$(OBJEXT) \ default_callback.$(OBJEXT) default_test.$(OBJEXT) \ ftest.$(OBJEXT) default_test_OBJECTS = $(am_default_test_OBJECTS) default_test_LDADD = $(LDADD) am__DEPENDENCIES_1 = default_test_DEPENDENCIES = $(am__DEPENDENCIES_1) am_longmembers_test_OBJECTS = longmembers_clp.$(OBJEXT) \ longmembers_callback.$(OBJEXT) longmembers_test.$(OBJEXT) \ ftest.$(OBJEXT) longmembers_test_OBJECTS = $(am_longmembers_test_OBJECTS) longmembers_test_LDADD = $(LDADD) longmembers_test_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(default_test_SOURCES) $(longmembers_test_SOURCES) DIST_SOURCES = $(default_test_SOURCES) $(longmembers_test_SOURCES) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ GENPARSE = ../../src/genparse INCLUDES = $(CPPUNIT_CFLAGS) LDADD = $(CPPUNIT_LIBS) default_test_SOURCES = default_clp.cc default_callback.cc default_test.cc ftest.cc longmembers_test_SOURCES = longmembers_clp.cc longmembers_callback.cc longmembers_test.cc ftest.cc EXTRA_DIST = test.gp genparse_test.h test.h all: all-am .SUFFIXES: .SUFFIXES: .cc .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/cppcheck/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/cppcheck/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) default_test$(EXEEXT): $(default_test_OBJECTS) $(default_test_DEPENDENCIES) @rm -f default_test$(EXEEXT) $(CXXLINK) $(default_test_OBJECTS) $(default_test_LDADD) $(LIBS) longmembers_test$(EXEEXT): $(longmembers_test_OBJECTS) $(longmembers_test_DEPENDENCIES) @rm -f longmembers_test$(EXEEXT) $(CXXLINK) $(longmembers_test_OBJECTS) $(longmembers_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default_callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longmembers_callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longmembers_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longmembers_test.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-local ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am default_clp.cc: test.gp test.h $(GENPARSE) $(GENPARSE) -l cpp -D. -o default_clp $(srcdir)/test.gp longmembers_clp.cc: test.gp test.h $(GENPARSE) $(GENPARSE) -m -l cpp -D. -o longmembers_clp $(srcdir)/test.gp clean-local: -rm -f default_clp* longmembers_clp* $(TESTS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/tests/Makefile.am0000644000076600001440000000033011673365613013455 00000000000000SUBDIRS = if HAVE_CUNIT SUBDIRS += ccheck endif if HAVE_CPPUNIT SUBDIRS += cppcheck endif if HAVE_JUNIT if HAVE_JAVAC if HAVE_JAVA if HAVE_GETOPT_JAVA SUBDIRS += javacheck endif endif endif endif SUBDIRS += misc genparse-0.9.1/tests/ccheck/0000777000076600001440000000000011732700535012721 500000000000000genparse-0.9.1/tests/ccheck/gnulib_test.h0000644000076600001440000000237211716257231015333 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2007 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef GENPARSE_TEST_H #define GENPARSE_TEST_H #include void AddTests (void); void testNoArgs (void); void testShortOptions (void); static CU_TestInfo test_genparse[] = { { "testNoArgs", testNoArgs }, { "testShortOptions", testShortOptions }, CU_TEST_INFO_NULL, }; static CU_SuiteInfo suites[] = { { "TestGenparse", NULL, NULL, test_genparse }, CU_SUITE_INFO_NULL, }; #endif // GENPARSE_TEST_H genparse-0.9.1/tests/ccheck/genparse_test.h0000644000076600001440000000307011716257231015653 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef GENPARSE_TEST_H #define GENPARSE_TEST_H #include void AddTests (void); void testNoArgs (void); void testShortOptions (void); void testLongOptions (void); void testCallbacks (void); void testMultipleShortOptions (void); static CU_TestInfo test_genparse[] = { { "testNoArgs", testNoArgs }, { "testShortOptions", testShortOptions }, { "testLongOptions", testLongOptions }, { "testCallbacks", testCallbacks }, { "testMultipleOptions", testMultipleShortOptions }, CU_TEST_INFO_NULL, }; static CU_SuiteInfo suites[] = { { "TestGenparse", NULL, NULL, test_genparse }, CU_SUITE_INFO_NULL, }; extern int test_g; extern int test_c; extern int test_s; extern int test_c_g; #endif // GENPARSE_TEST_H genparse-0.9.1/tests/ccheck/uintmax_test.c0000644000076600001440000000315111716257231015527 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "uintmax_clp.h" #include "gnulib_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (0, Options.a); CU_ASSERT_EQUAL (2, Options.b); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-a 1"; argv[argc++] = "-b 2"; argv[argc++] = "-c 5"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (1, Options.a); CU_ASSERT_EQUAL (2, Options.b); CU_ASSERT_EQUAL (5, Options.c); } genparse-0.9.1/tests/ccheck/uintmax_clp.c0000644000076600001440000000765611732677234015353 00000000000000/****************************************************************************** ** ** uintmax_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "uintmax_clp.h" static struct option const long_options[] = { {"aparam", required_argument, NULL, 'a'}, {"bparam", required_argument, NULL, 'b'}, {"cparam", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->a = 0; my_args->b = 2; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "a:b:c:hv", long_options, &optind)) != - 1) { switch (c) { case 'a': if (xstrtoumax (optarg, NULL, 10, &my_args->a, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to uintmax_t", optarg); break; case 'b': if (xstrtoumax (optarg, NULL, 10, &my_args->b, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to uintmax_t", optarg); if (my_args->b < 2) { fprintf (stderr, "parameter range error: b must be >= 2\n"); errflg++; } if (my_args->b > 5) { fprintf (stderr, "parameter range error: b must be <= 5\n"); errflg++; } break; case 'c': if (xstrtoumax (optarg, NULL, 10, &my_args->c, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to uintmax_t", optarg); if (my_args->c < 2) { fprintf (stderr, "parameter range error: c must be >= 2\n"); errflg++; } if (my_args->c > 5) { fprintf (stderr, "parameter range error: c must be <= 5\n"); errflg++; } break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -abchv ] \n\ [ -a ] [ --aparam ] (type=UINTMAX, default=0)\n\ This is a uintmax_t parameter\n\ [ -b ] [ --bparam ] (type=UINTMAX, range=2...5, default=2)\n\ This parameter must be in the range 2...5\n\ [ -c ] [ --cparam ] (type=UINTMAX, range=2...5,)\n\ This parameter has no default value\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } genparse-0.9.1/tests/ccheck/default_callback.c0000644000076600001440000000342711716257231016251 00000000000000/* * Hand edited version of default_clp_cb.c which is generated * automatically by genparse from test.gp. * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "default_clp.h" int test_g; int test_c; int test_s; int test_c_g; /*---------------------------------------------------------------------------- ** ** my_callback () ** ** User defined global callback. ** **--------------------------------------------------------------------------*/ int my_callback (struct arg_t *a) { test_g = 1; test_c_g = 1; return true; } /*---------------------------------------------------------------------------- ** ** char_cb () ** ** User defined parameter callback. ** **--------------------------------------------------------------------------*/ int char_cb (char var) { test_c_g = (int)var; test_c = (int)var; return true; } /*---------------------------------------------------------------------------- ** ** string_cb () ** ** User defined parameter callback. ** **--------------------------------------------------------------------------*/ int string_cb (char * var) { test_s = 3; return true; } genparse-0.9.1/tests/ccheck/uintmax.gp0000644000076600001440000000030110716361124014642 00000000000000a / aparam uintmax 0 "This is a uintmax_t parameter" b / bparam uintmax [2...5] 2 "This parameter must be in the range 2...5" c / cparam uintmax [2...5] "This parameter has no default value" genparse-0.9.1/tests/ccheck/ftest.c0000644000076600001440000000226411716257231014134 00000000000000/* * Main program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include int main (int argc, char* argv[]) { if (CU_initialize_registry ()) { printf ("\nInitialization of Test Registry failed."); } else { AddTests (); CU_set_error_action (CUEA_FAIL); printf ("\nTests completed with return value %d.\n", CU_basic_run_tests ()); CU_cleanup_registry (); } return 0; } genparse-0.9.1/tests/ccheck/long_clp.c0000644000076600001440000000761611732677234014621 00000000000000/****************************************************************************** ** ** long_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "long_clp.h" static struct option const long_options[] = { {"aparam", required_argument, NULL, 'a'}, {"bparam", required_argument, NULL, 'b'}, {"cparam", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->a = 0; my_args->b = 2; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "a:b:c:hv", long_options, &optind)) != - 1) { switch (c) { case 'a': if (xstrtol (optarg, NULL, 10, &my_args->a, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to long int", optarg); break; case 'b': if (xstrtol (optarg, NULL, 10, &my_args->b, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to long int", optarg); if (my_args->b < 2) { fprintf (stderr, "parameter range error: b must be >= 2\n"); errflg++; } if (my_args->b > 5) { fprintf (stderr, "parameter range error: b must be <= 5\n"); errflg++; } break; case 'c': if (xstrtol (optarg, NULL, 10, &my_args->c, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to long int", optarg); if (my_args->c < 2) { fprintf (stderr, "parameter range error: c must be >= 2\n"); errflg++; } if (my_args->c > 5) { fprintf (stderr, "parameter range error: c must be <= 5\n"); errflg++; } break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -abchv ] \n\ [ -a ] [ --aparam ] (type=LONG, default=0)\n\ This is a long parameter\n\ [ -b ] [ --bparam ] (type=LONG, range=2...5, default=2)\n\ This parameter must be in the range 2...5\n\ [ -c ] [ --cparam ] (type=LONG, range=2...5,)\n\ This parameter has no default value\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } genparse-0.9.1/tests/ccheck/longmembers_clp.c0000644000076600001440000001775311732677234016177 00000000000000/****************************************************************************** ** ** longmembers_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "longmembers_clp.h" static struct option const long_options[] = { {"cparam", required_argument, NULL, 'c'}, {"dparam", required_argument, NULL, 'd'}, {"eparam", required_argument, NULL, 'e'}, {"fparam", required_argument, NULL, 'f'}, {"gparam", no_argument, NULL, 'g'}, {"iparam", required_argument, NULL, 'i'}, {"oparam", optional_argument, NULL, 'o'}, {"pparam", required_argument, NULL, 'p'}, {"qparam", optional_argument, NULL, 'q'}, {"Pparam", no_argument, NULL, 'P'}, {"Qparam", optional_argument, NULL, 'Q'}, {"rparam", no_argument, NULL, 'r'}, {"sparam", required_argument, NULL, 's'}, {"uparam", required_argument, NULL, 256}, {"vparam", required_argument, NULL, 257}, {"a-ha", required_argument, NULL, 258}, {"wparam", required_argument, NULL, 'w'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->cparam = 'c'; my_args->cparam_li = 0; my_args->dparam = '\013'; my_args->eparam = '\n'; my_args->fparam = 1.2; my_args->fparam_li = 0; my_args->gparam = false; my_args->iparam = 1; my_args->oparam = 3; my_args->oparam_flag = false; my_args->pparam = NULL; my_args->pparam_flag = false; my_args->qparam = 4; my_args->qparam_flag = false; my_args->Pparam = 7; my_args->Pparam_flag = false; my_args->Qparam = "S"; my_args->Qparam_flag = false; my_args->rparam = false; my_args->sparam = "abc"; my_args->a_ha = "haha"; my_args->_1 = false; my_args->wparam_flag = false; my_args->help = false; my_args->version = false; optind = 0; while ((c = getopt_long (argc, argv, "c:d:e:f:gi:o::p::q:P::QrRs:t:1w:hv", long_options, &optind)) != - 1) { switch (c) { case 'c': my_args->cparam = *optarg; my_args->cparam_li = optind; if (!char_cb (my_args->cparam)) usage (EXIT_FAILURE, argv[0]); break; case 'd': my_args->dparam = *optarg; if (!char_cb (my_args->dparam)) usage (EXIT_FAILURE, argv[0]); break; case 'e': my_args->eparam = *optarg; break; case 'f': my_args->fparam = atof (optarg); my_args->fparam_li = optind; if (my_args->fparam < 1) { fprintf (stderr, _("parameter range error: fparam must be >= 1\n")); errflg++; } if (my_args->fparam > 2.3) { fprintf (stderr, _("parameter range error: fparam must be <= 2.3\n")); errflg++; } break; case 'g': my_args->gparam = true; break; case 'i': my_args->iparam = atoi (optarg); if (my_args->iparam < 1) { fprintf (stderr, _("parameter range error: iparam must be >= 1\n")); errflg++; } if (my_args->iparam > MAX) { fprintf (stderr, _("parameter range error: iparam must be <= MAX\n")); errflg++; } break; case 'o': my_args->oparam_flag = true; if (optarg != NULL) my_args->oparam = atoi (optarg); break; case 'p': my_args->pparam_flag = true; if (optarg != NULL) my_args->pparam = optarg; break; case 'q': my_args->qparam_flag = true; if (optarg != NULL) my_args->qparam = atoi (optarg); break; case 'P': my_args->Pparam_flag = true; if (optarg != NULL) my_args->Pparam = atoi (optarg); break; case 'Q': my_args->Qparam_flag = true; if (optarg != NULL) my_args->Qparam = optarg; break; case 'r': case 'R': my_args->rparam = true; break; case 's': my_args->sparam = optarg; if (!string_cb (my_args->sparam)) usage (EXIT_FAILURE, argv[0]); break; case 't': my_args->t = atoi (optarg); break; case 256: my_args->uparam = atoi (optarg); break; case 257: my_args->vparam = atoi (optarg); break; case 258: my_args->a_ha = optarg; break; case '1': my_args->_1 = true; break; case 'w': my_args->wparam_flag = true; if (optarg != NULL) my_args->wparam = atoi (optarg); break; case 'h': my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->version = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (!my_callback (my_args)) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ %s\n\ \n\ -c, --cparam This is a char parameter.\n\ -d, --dparam This is a char parameter initialized with an\n\ octal value.\n\ -e, --eparam This is a char parameter initialized with newline.\n\ -f, --fparam This is a float parameter.\n\ -g, --gparam This is a flag parameter.\n\ -i, --iparam This is an integer parameter.\n\ -o, --oparam Both short and long option have an optional\n\ argument\n\ -p, --pparam Short option has an optional argument,\n\ long option requires an argument.\n\ -q, --qparam Short option reqires an argument,\n\ long option has an optional argument.\n\ -P, --Pparam Short option has an optional argument,\n\ long option none.\n\ -Q, --Qparam Short option has no argument, long option has an\n\ optional argument.\n\ -r -R, --rparam This parameter has 2 short representations.\n\ -s, --sparam This is a string parameter.\n\ -t This parameter only has a short representation\n\ --uparam This parameter only has a long representation\n\ --vparam=V This parameter has a designation\n\ --a-ha This parameter has a dash in its name\n\ -1 This is a single digit parameter\n\ -w, --wparam This parameter also sets a flag\n\ -h, --help Display this help and exit.\n\ -v, --version Output version information and exit.\n\ \n\ %s\n\ \n\ %d\n\ \n\ __COMMAND__(my_function ())\n"), program_name, TEST_TEXT_MACRO, TEST_INT_MACRO); } exit (status); } genparse-0.9.1/tests/ccheck/ulong.gp0000644000076600001440000000030010716361124014300 00000000000000a / aparam ulong 0 "This is an unsigned long parameter" b / bparam ulong [2...5] 2 "This parameter must be in the range 2...5" c / cparam ulong [2...5] "This parameter has no default value" genparse-0.9.1/tests/ccheck/long.gp0000644000076600001440000000026310716361122014121 00000000000000a / aparam long 0 "This is a long parameter" b / bparam long [2...5] 2 "This parameter must be in the range 2...5" c / cparam long [2...5] "This parameter has no default value" genparse-0.9.1/tests/ccheck/intmax.gp0000644000076600001440000000027610716361122014466 00000000000000a / aparam intmax 0 "This is an intmax_t parameter" b / bparam intmax [2...5] 2 "This parameter must be in the range 2...5" c / cparam intmax [2...5] "This parameter has no default value" genparse-0.9.1/tests/ccheck/default_test.c0000644000076600001440000001437411716257231015477 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "default_clp.h" #include "genparse_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 'c', Options.c); CU_ASSERT_EQUAL ( 0, Options.c_li); CU_ASSERT_EQUAL ( '\013', Options.d); CU_ASSERT_EQUAL ( '\n', Options.e); CU_ASSERT_EQUAL ( (float)1.2, Options.f); CU_ASSERT_EQUAL ( 0, Options.f_li); CU_ASSERT_EQUAL ( false, Options.g); CU_ASSERT_EQUAL ( false, Options.h); CU_ASSERT_EQUAL ( 1, Options.i); CU_ASSERT_EQUAL ( 3, Options.o); CU_ASSERT_EQUAL ( false, Options.o_flag); CU_ASSERT_EQUAL ( NULL, Options.p); CU_ASSERT_EQUAL ( false, Options.p_flag); CU_ASSERT_EQUAL ( 4, Options.q); CU_ASSERT_EQUAL ( false, Options.q_flag); CU_ASSERT_EQUAL ( 7, Options.P); CU_ASSERT_EQUAL ( false, Options.P_flag); CU_ASSERT_STRING_EQUAL ( "S", Options.Q); CU_ASSERT_EQUAL ( false, Options.Q_flag); CU_ASSERT_STRING_EQUAL ( "abc", Options.s); CU_ASSERT_EQUAL ( false, Options.v); CU_ASSERT_STRING_EQUAL ("haha", Options.a_ha); CU_ASSERT_EQUAL ( false, Options._1); CU_ASSERT_EQUAL ( false, Options.w_flag); CU_ASSERT_EQUAL ( 0, Options.optind); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-ca"; argv[argc++] = "-f2"; argv[argc++] = "-g"; argv[argc++] = "-i7"; argv[argc++] = "-o11"; argv[argc++] = "-pquak"; argv[argc++] = "-q500"; argv[argc++] = "-P12"; argv[argc++] = "-Q"; argv[argc++] = "-sbla"; argv[argc++] = "-t17"; argv[argc++] = "-1"; argv[argc++] = "-w9"; argv[argc++] = "myfilename"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 'a', Options.c); CU_ASSERT_EQUAL ( 2, Options.c_li); CU_ASSERT_EQUAL ( (float)2, Options.f); CU_ASSERT_EQUAL ( 3, Options.f_li); CU_ASSERT_EQUAL ( true, Options.g); CU_ASSERT_EQUAL ( false, Options.h); CU_ASSERT_EQUAL ( 7, Options.i); CU_ASSERT_EQUAL ( 11, Options.o); CU_ASSERT_EQUAL ( true, Options.o_flag); CU_ASSERT_STRING_EQUAL ("quak", Options.p); CU_ASSERT_EQUAL ( true, Options.p_flag); CU_ASSERT_EQUAL ( 500, Options.q); CU_ASSERT_EQUAL ( true, Options.q_flag); CU_ASSERT_EQUAL ( 12, Options.P); CU_ASSERT_EQUAL ( true, Options.P_flag); CU_ASSERT_STRING_EQUAL ( "S", Options.Q); CU_ASSERT_EQUAL ( true, Options.Q_flag); CU_ASSERT_STRING_EQUAL ( "bla", Options.s); CU_ASSERT_EQUAL ( 17, Options.t); CU_ASSERT_EQUAL ( true, Options._1); CU_ASSERT_EQUAL ( 9, Options.w); CU_ASSERT_EQUAL ( true, Options.w_flag); CU_ASSERT_EQUAL ( argc - 1, Options.optind); } void testLongOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "--cparam=b"; argv[argc++] = "--fparam=1.5"; argv[argc++] = "--gparam"; argv[argc++] = "--iparam=8"; argv[argc++] = "--oparam=9"; argv[argc++] = "--pparam=pp"; argv[argc++] = "--qparam=111"; argv[argc++] = "--Pparam"; argv[argc++] = "--Qparam=AAA"; argv[argc++] = "--sparam=aaa"; argv[argc++] = "--uparam=18"; argv[argc++] = "--vparam=19"; argv[argc++] = "--a-ha=hihi"; argv[argc++] = "--wparam=99"; argv[argc++] = "myfilename"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 'b', Options.c); CU_ASSERT_EQUAL ( 2, Options.c_li); CU_ASSERT_EQUAL ( (float)1.5, Options.f); CU_ASSERT_EQUAL ( 3, Options.f_li); CU_ASSERT_EQUAL ( true, Options.g); CU_ASSERT_EQUAL ( false, Options.h); CU_ASSERT_EQUAL ( 8, Options.i); CU_ASSERT_EQUAL ( 9, Options.o); CU_ASSERT_EQUAL ( true, Options.o_flag); CU_ASSERT_STRING_EQUAL ( "pp", Options.p); CU_ASSERT_EQUAL ( true, Options.p_flag); CU_ASSERT_EQUAL ( 111, Options.q); CU_ASSERT_EQUAL ( true, Options.q_flag); CU_ASSERT_EQUAL ( 7, Options.P); CU_ASSERT_EQUAL ( true, Options.P_flag); CU_ASSERT_STRING_EQUAL ( "AAA", Options.Q); CU_ASSERT_EQUAL ( true, Options.Q_flag); CU_ASSERT_STRING_EQUAL ( "aaa", Options.s); CU_ASSERT_EQUAL ( 18, Options.uparam); CU_ASSERT_EQUAL ( 19, Options.vparam); CU_ASSERT_STRING_EQUAL ("hihi", Options.a_ha); CU_ASSERT_EQUAL ( 99, Options.w); CU_ASSERT_EQUAL ( true, Options.w_flag); CU_ASSERT_EQUAL ( argc - 1, Options.optind); } void testCallbacks (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-c0"; test_g = 0; test_c = 0; test_s = 0; test_c_g = 0; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 1, test_g); CU_ASSERT_EQUAL (48, test_c); CU_ASSERT_EQUAL ( 0, test_s); CU_ASSERT_EQUAL ( 1, test_c_g); } void testMultipleShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-R"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (true, Options.r); } int my_function (void) { } genparse-0.9.1/tests/ccheck/ulong_clp.c0000644000076600001440000000772311732677234015005 00000000000000/****************************************************************************** ** ** ulong_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "ulong_clp.h" static struct option const long_options[] = { {"aparam", required_argument, NULL, 'a'}, {"bparam", required_argument, NULL, 'b'}, {"cparam", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->a = 0; my_args->b = 2; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "a:b:c:hv", long_options, &optind)) != - 1) { switch (c) { case 'a': if (xstrtoul (optarg, NULL, 10, &my_args->a, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to unsigned long int", optarg); break; case 'b': if (xstrtoul (optarg, NULL, 10, &my_args->b, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to unsigned long int", optarg); if (my_args->b < 2) { fprintf (stderr, "parameter range error: b must be >= 2\n"); errflg++; } if (my_args->b > 5) { fprintf (stderr, "parameter range error: b must be <= 5\n"); errflg++; } break; case 'c': if (xstrtoul (optarg, NULL, 10, &my_args->c, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to unsigned long int", optarg); if (my_args->c < 2) { fprintf (stderr, "parameter range error: c must be >= 2\n"); errflg++; } if (my_args->c > 5) { fprintf (stderr, "parameter range error: c must be <= 5\n"); errflg++; } break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -abchv ] \n\ [ -a ] [ --aparam ] (type=UNSIGNED LONG, default=0)\n\ This is an unsigned long parameter\n\ [ -b ] [ --bparam ] (type=UNSIGNED LONG, range=2...5, default=2)\n\ This parameter must be in the range 2...5\n\ [ -c ] [ --cparam ] (type=UNSIGNED LONG, range=2...5,)\n\ This parameter has no default value\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } genparse-0.9.1/tests/ccheck/double.gp0000644000076600001440000000027310716361122014435 00000000000000a / aparam double 0 "This is a double parameter" b / bparam double [2...5] 2 "This parameter must be in the range 2...5" c / cparam double [2...5] "This parameter has no default value" genparse-0.9.1/tests/ccheck/longmembers_test.c0000644000076600001440000001506611716257231016364 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "longmembers_clp.h" #include "genparse_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 'c', Options.cparam); CU_ASSERT_EQUAL ( 0, Options.cparam_li); CU_ASSERT_EQUAL ( '\013', Options.dparam); CU_ASSERT_EQUAL ( '\n', Options.eparam); CU_ASSERT_EQUAL ( (float)1.2, Options.fparam); CU_ASSERT_EQUAL ( 0, Options.fparam_li); CU_ASSERT_EQUAL ( false, Options.gparam); CU_ASSERT_EQUAL ( false, Options.help); CU_ASSERT_EQUAL ( 1, Options.iparam); CU_ASSERT_EQUAL ( 3, Options.oparam); CU_ASSERT_EQUAL ( false, Options.oparam_flag); CU_ASSERT_EQUAL ( NULL, Options.pparam); CU_ASSERT_EQUAL ( false, Options.pparam_flag); CU_ASSERT_EQUAL ( 4, Options.qparam); CU_ASSERT_EQUAL ( false, Options.qparam_flag); CU_ASSERT_EQUAL ( 7, Options.Pparam); CU_ASSERT_EQUAL ( false, Options.Pparam_flag); CU_ASSERT_STRING_EQUAL ( "S", Options.Qparam); CU_ASSERT_EQUAL ( false, Options.Qparam_flag); CU_ASSERT_STRING_EQUAL ( "abc", Options.sparam); CU_ASSERT_EQUAL ( false, Options.version); CU_ASSERT_STRING_EQUAL ("haha", Options.a_ha); CU_ASSERT_EQUAL ( false, Options._1); CU_ASSERT_EQUAL ( false, Options.wparam_flag); CU_ASSERT_EQUAL ( 0, Options.optind); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-ca"; argv[argc++] = "-f2"; argv[argc++] = "-g"; argv[argc++] = "-i7"; argv[argc++] = "-o11"; argv[argc++] = "-pquak"; argv[argc++] = "-q500"; argv[argc++] = "-P12"; argv[argc++] = "-Q"; argv[argc++] = "-sbla"; argv[argc++] = "-t17"; argv[argc++] = "-1"; argv[argc++] = "-w9"; argv[argc++] = "myfilename"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 'a', Options.cparam); CU_ASSERT_EQUAL ( 2, Options.cparam_li); CU_ASSERT_EQUAL ( (float)2, Options.fparam); CU_ASSERT_EQUAL ( 3, Options.fparam_li); CU_ASSERT_EQUAL ( true, Options.gparam); CU_ASSERT_EQUAL ( false, Options.help); CU_ASSERT_EQUAL ( 7, Options.iparam); CU_ASSERT_EQUAL ( 11, Options.oparam); CU_ASSERT_EQUAL ( true, Options.oparam_flag); CU_ASSERT_STRING_EQUAL ("quak", Options.pparam); CU_ASSERT_EQUAL ( true, Options.pparam_flag); CU_ASSERT_EQUAL ( 500, Options.qparam); CU_ASSERT_EQUAL ( true, Options.qparam_flag); CU_ASSERT_EQUAL ( 12, Options.Pparam); CU_ASSERT_EQUAL ( true, Options.Pparam_flag); CU_ASSERT_STRING_EQUAL ( "S", Options.Qparam); CU_ASSERT_EQUAL ( true, Options.Qparam_flag); CU_ASSERT_STRING_EQUAL ( "bla", Options.sparam); CU_ASSERT_EQUAL ( 17, Options.t); CU_ASSERT_EQUAL ( true, Options._1); CU_ASSERT_EQUAL ( 9, Options.wparam); CU_ASSERT_EQUAL ( true, Options.wparam_flag); CU_ASSERT_EQUAL ( argc - 1, Options.optind); } void testLongOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "--cparam=b"; argv[argc++] = "--fparam=1.5"; argv[argc++] = "--gparam"; argv[argc++] = "--iparam=8"; argv[argc++] = "--oparam=9"; argv[argc++] = "--pparam=pp"; argv[argc++] = "--qparam=111"; argv[argc++] = "--Pparam"; argv[argc++] = "--Qparam=AAA"; argv[argc++] = "--sparam=aaa"; argv[argc++] = "--uparam=18"; argv[argc++] = "--vparam=19"; argv[argc++] = "--a-ha=hihi"; argv[argc++] = "--wparam=99"; argv[argc++] = "myfilename"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 'b', Options.cparam); CU_ASSERT_EQUAL ( 2, Options.cparam_li); CU_ASSERT_EQUAL ( (float)1.5, Options.fparam); CU_ASSERT_EQUAL ( 3, Options.fparam_li); CU_ASSERT_EQUAL ( true, Options.gparam); CU_ASSERT_EQUAL ( false, Options.help); CU_ASSERT_EQUAL ( 8, Options.iparam); CU_ASSERT_EQUAL ( 9, Options.oparam); CU_ASSERT_EQUAL ( true, Options.oparam_flag); CU_ASSERT_STRING_EQUAL ( "pp", Options.pparam); CU_ASSERT_EQUAL ( true, Options.pparam_flag); CU_ASSERT_EQUAL ( 111, Options.qparam); CU_ASSERT_EQUAL ( true, Options.qparam_flag); CU_ASSERT_EQUAL ( 7, Options.Pparam); CU_ASSERT_EQUAL ( true, Options.Pparam_flag); CU_ASSERT_STRING_EQUAL ( "AAA", Options.Qparam); CU_ASSERT_EQUAL ( true, Options.Qparam_flag); CU_ASSERT_STRING_EQUAL ( "aaa", Options.sparam); CU_ASSERT_EQUAL ( 18, Options.uparam); CU_ASSERT_EQUAL ( 19, Options.vparam); CU_ASSERT_STRING_EQUAL ("hihi", Options.a_ha); CU_ASSERT_EQUAL ( 99, Options.wparam); CU_ASSERT_EQUAL ( true, Options.wparam_flag); CU_ASSERT_EQUAL ( argc - 1, Options.optind); } void testCallbacks (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-c0"; test_g = 0; test_c = 0; test_s = 0; test_c_g = 0; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL ( 1, test_g); CU_ASSERT_EQUAL (48, test_c); CU_ASSERT_EQUAL ( 0, test_s); CU_ASSERT_EQUAL ( 1, test_c_g); } void testMultipleShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-R"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (true, Options.rparam); } int my_function (void) { } genparse-0.9.1/tests/ccheck/intmax_test.c0000644000076600001440000000315011716257231015341 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "intmax_clp.h" #include "gnulib_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (0, Options.a); CU_ASSERT_EQUAL (2, Options.b); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-a 1"; argv[argc++] = "-b 2"; argv[argc++] = "-c 5"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (1, Options.a); CU_ASSERT_EQUAL (2, Options.b); CU_ASSERT_EQUAL (5, Options.c); } genparse-0.9.1/tests/ccheck/intmax_clp.c0000644000076600001440000000764611732677234015165 00000000000000/****************************************************************************** ** ** intmax_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "intmax_clp.h" static struct option const long_options[] = { {"aparam", required_argument, NULL, 'a'}, {"bparam", required_argument, NULL, 'b'}, {"cparam", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->a = 0; my_args->b = 2; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "a:b:c:hv", long_options, &optind)) != - 1) { switch (c) { case 'a': if (xstrtoimax (optarg, NULL, 10, &my_args->a, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to intmax_t", optarg); break; case 'b': if (xstrtoimax (optarg, NULL, 10, &my_args->b, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to intmax_t", optarg); if (my_args->b < 2) { fprintf (stderr, "parameter range error: b must be >= 2\n"); errflg++; } if (my_args->b > 5) { fprintf (stderr, "parameter range error: b must be <= 5\n"); errflg++; } break; case 'c': if (xstrtoimax (optarg, NULL, 10, &my_args->c, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, "could not convert %s to intmax_t", optarg); if (my_args->c < 2) { fprintf (stderr, "parameter range error: c must be >= 2\n"); errflg++; } if (my_args->c > 5) { fprintf (stderr, "parameter range error: c must be <= 5\n"); errflg++; } break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -abchv ] \n\ [ -a ] [ --aparam ] (type=INTMAX, default=0)\n\ This is an intmax_t parameter\n\ [ -b ] [ --bparam ] (type=INTMAX, range=2...5, default=2)\n\ This parameter must be in the range 2...5\n\ [ -c ] [ --cparam ] (type=INTMAX, range=2...5,)\n\ This parameter has no default value\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } genparse-0.9.1/tests/ccheck/default_clp.c0000644000076600001440000001726111732677234015303 00000000000000/****************************************************************************** ** ** default_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "default_clp.h" static struct option const long_options[] = { {"cparam", required_argument, NULL, 'c'}, {"dparam", required_argument, NULL, 'd'}, {"eparam", required_argument, NULL, 'e'}, {"fparam", required_argument, NULL, 'f'}, {"gparam", no_argument, NULL, 'g'}, {"iparam", required_argument, NULL, 'i'}, {"oparam", optional_argument, NULL, 'o'}, {"pparam", required_argument, NULL, 'p'}, {"qparam", optional_argument, NULL, 'q'}, {"Pparam", no_argument, NULL, 'P'}, {"Qparam", optional_argument, NULL, 'Q'}, {"rparam", no_argument, NULL, 'r'}, {"sparam", required_argument, NULL, 's'}, {"uparam", required_argument, NULL, 256}, {"vparam", required_argument, NULL, 257}, {"a-ha", required_argument, NULL, 258}, {"wparam", required_argument, NULL, 'w'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->c = 'c'; my_args->c_li = 0; my_args->d = '\013'; my_args->e = '\n'; my_args->f = 1.2; my_args->f_li = 0; my_args->g = false; my_args->i = 1; my_args->o = 3; my_args->o_flag = false; my_args->p = NULL; my_args->p_flag = false; my_args->q = 4; my_args->q_flag = false; my_args->P = 7; my_args->P_flag = false; my_args->Q = "S"; my_args->Q_flag = false; my_args->r = false; my_args->s = "abc"; my_args->a_ha = "haha"; my_args->_1 = false; my_args->w_flag = false; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "c:d:e:f:gi:o::p::q:P::QrRs:t:1w:hv", long_options, &optind)) != - 1) { switch (c) { case 'c': my_args->c = *optarg; my_args->c_li = optind; if (!char_cb (my_args->c)) usage (EXIT_FAILURE, argv[0]); break; case 'd': my_args->d = *optarg; if (!char_cb (my_args->d)) usage (EXIT_FAILURE, argv[0]); break; case 'e': my_args->e = *optarg; break; case 'f': my_args->f = atof (optarg); my_args->f_li = optind; if (my_args->f < 1) { fprintf (stderr, "parameter range error: f must be >= 1\n"); errflg++; } if (my_args->f > 2.3) { fprintf (stderr, "parameter range error: f must be <= 2.3\n"); errflg++; } break; case 'g': my_args->g = true; break; case 'i': my_args->i = atoi (optarg); if (my_args->i < 1) { fprintf (stderr, "parameter range error: i must be >= 1\n"); errflg++; } if (my_args->i > MAX) { fprintf (stderr, "parameter range error: i must be <= MAX\n"); errflg++; } break; case 'o': my_args->o_flag = true; if (optarg != NULL) my_args->o = atoi (optarg); break; case 'p': my_args->p_flag = true; if (optarg != NULL) my_args->p = optarg; break; case 'q': my_args->q_flag = true; if (optarg != NULL) my_args->q = atoi (optarg); break; case 'P': my_args->P_flag = true; if (optarg != NULL) my_args->P = atoi (optarg); break; case 'Q': my_args->Q_flag = true; if (optarg != NULL) my_args->Q = optarg; break; case 'r': case 'R': my_args->r = true; break; case 's': my_args->s = optarg; if (!string_cb (my_args->s)) usage (EXIT_FAILURE, argv[0]); break; case 't': my_args->t = atoi (optarg); break; case 256: my_args->uparam = atoi (optarg); break; case 257: my_args->vparam = atoi (optarg); break; case 258: my_args->a_ha = optarg; break; case '1': my_args->_1 = true; break; case 'w': my_args->w_flag = true; if (optarg != NULL) my_args->w = atoi (optarg); break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (!my_callback (my_args)) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ %s\n\ \n\ -c, --cparam This is a char parameter.\n\ -d, --dparam This is a char parameter initialized with an\n\ octal value.\n\ -e, --eparam This is a char parameter initialized with newline.\n\ -f, --fparam This is a float parameter.\n\ -g, --gparam This is a flag parameter.\n\ -i, --iparam This is an integer parameter.\n\ -o, --oparam Both short and long option have an optional\n\ argument\n\ -p, --pparam Short option has an optional argument,\n\ long option requires an argument.\n\ -q, --qparam Short option reqires an argument,\n\ long option has an optional argument.\n\ -P, --Pparam Short option has an optional argument,\n\ long option none.\n\ -Q, --Qparam Short option has no argument, long option has an\n\ optional argument.\n\ -r -R, --rparam This parameter has 2 short representations.\n\ -s, --sparam This is a string parameter.\n\ -t This parameter only has a short representation\n\ --uparam This parameter only has a long representation\n\ --vparam=V This parameter has a designation\n\ --a-ha This parameter has a dash in its name\n\ -1 This is a single digit parameter\n\ -w, --wparam This parameter also sets a flag\n\ -h, --help Display this help and exit.\n\ -v, --version Output version information and exit.\n\ \n\ %s\n\ \n\ %d\n\ \n\ __COMMAND__(my_function ())\n", program_name, TEST_TEXT_MACRO, TEST_INT_MACRO); } exit (status); } genparse-0.9.1/tests/ccheck/double_clp.c0000644000076600001440000000757711732677234015142 00000000000000/****************************************************************************** ** ** double_clp.c ** ** Thu Mar 22 20:33:48 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtod.h" #include "xstrtod.h" #include "double_clp.h" static struct option const long_options[] = { {"aparam", required_argument, NULL, 'a'}, {"bparam", required_argument, NULL, 'b'}, {"cparam", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->a = 0; my_args->b = 2; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "a:b:c:hv", long_options, &optind)) != - 1) { switch (c) { case 'a': if (! xstrtod (optarg, NULL, &my_args->a, strtod)) error (EXIT_FAILURE, 0, "could not convert %s to double", optarg); break; case 'b': if (! xstrtod (optarg, NULL, &my_args->b, strtod)) error (EXIT_FAILURE, 0, "could not convert %s to double", optarg); if (my_args->b < 2) { fprintf (stderr, "parameter range error: b must be >= 2\n"); errflg++; } if (my_args->b > 5) { fprintf (stderr, "parameter range error: b must be <= 5\n"); errflg++; } break; case 'c': if (! xstrtod (optarg, NULL, &my_args->c, strtod)) error (EXIT_FAILURE, 0, "could not convert %s to double", optarg); if (my_args->c < 2) { fprintf (stderr, "parameter range error: c must be >= 2\n"); errflg++; } if (my_args->c > 5) { fprintf (stderr, "parameter range error: c must be <= 5\n"); errflg++; } break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -abchv ] \n\ [ -a ] [ --aparam ] (type=DOUBLE, default=0)\n\ This is a double parameter\n\ [ -b ] [ --bparam ] (type=DOUBLE, range=2...5, default=2)\n\ This parameter must be in the range 2...5\n\ [ -c ] [ --cparam ] (type=DOUBLE, range=2...5,)\n\ This parameter has no default value\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } genparse-0.9.1/tests/ccheck/test.gp0000644000076600001440000000316210733740605014150 00000000000000#include "test.h" #mandatory file #exit_value EXIT_FAILURE my_callback () c / cparam char 'c' char_cb () "This is a char parameter." __STORE_LONGINDEX__ d / dparam char '\013' char_cb () "This is a char parameter initialized with an" "octal value." e / eparam char '\n' "This is a char parameter initialized with newline." f / fparam float 1.2 [1..2.3] "This is a float parameter." __STORE_LONGINDEX__ g / gparam flag "This is a flag parameter." i / iparam int 1 [1..MAX] "This is an integer parameter." o* / oparam* int 3 "Both short and long option have an optional" "argument" p* / pparam string "Short option has an optional argument," "long option requires an argument." q / qparam* int 4 "Short option reqires an argument," "long option has an optional argument." P* / Pparam! int 7 "Short option has an optional argument," "long option none." Q!/ Qparam* string {"S"} "Short option has no argument, long option has an" "optional argument." rR / rparam flag "This parameter has 2 short representations." s / sparam string {"abc"} string_cb () "This is a string parameter." t int "This parameter only has a short representation" NONE / uparam int "This parameter only has a long representation" NONE / vparam=V int "This parameter has a designation" NONE / a-ha string {"haha"} "This parameter has a dash in its name" 1 flag "This is a single digit parameter" w / wparam int "This parameter also sets a flag" __ADD_FLAG__ #usage_begin __PROGRAM_NAME__ __GLOSSARY_GNU__ __STRING__(TEST_TEXT_MACRO) __INT__(TEST_INT_MACRO) __COMMAND__(my_function ()) #usage_end genparse-0.9.1/tests/ccheck/test.h0000644000076600001440000000025210716361124013762 00000000000000#define MAX 10 #define TEST_TEXT_MACRO "test text" #define TEST_INT_MACRO 17 /* Undo the internationalization macro */ #define _(x) (x) extern int my_function(void); genparse-0.9.1/tests/ccheck/longmembers_callback.c0000644000076600001440000000343711716257231017140 00000000000000/* * Hand edited version of longmembers_clp_cb.c which is generated * automatically by genparse from test.gp. * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "longmembers_clp.h" int test_g; int test_c; int test_s; int test_c_g; /*---------------------------------------------------------------------------- ** ** my_callback () ** ** User defined global callback. ** **--------------------------------------------------------------------------*/ int my_callback (struct arg_t *a) { test_g = 1; test_c_g = 1; return true; } /*---------------------------------------------------------------------------- ** ** char_cb () ** ** User defined parameter callback. ** **--------------------------------------------------------------------------*/ int char_cb (char var) { test_c_g = (int)var; test_c = (int)var; return true; } /*---------------------------------------------------------------------------- ** ** string_cb () ** ** User defined parameter callback. ** **--------------------------------------------------------------------------*/ int string_cb (char * var) { test_s = 3; return true; } genparse-0.9.1/tests/ccheck/ulong_test.c0000644000076600001440000000314711716257231015173 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "ulong_clp.h" #include "gnulib_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (0, Options.a); CU_ASSERT_EQUAL (2, Options.b); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-a 1"; argv[argc++] = "-b 2"; argv[argc++] = "-c 5"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (1, Options.a); CU_ASSERT_EQUAL (2, Options.b); CU_ASSERT_EQUAL (5, Options.c); } genparse-0.9.1/tests/ccheck/Makefile.am0000644000076600001440000000400310721067670014671 00000000000000GENPARSE = ../../src/genparse AM_CPPFLAGS = -I$(srcdir)/../../gnulib/lib AM_LDFLAGS = -L../../gnulib/lib LDADD = -lcunit TESTS = default_test longmembers_test long_test ulong_test intmax_test uintmax_test double_test check_PROGRAMS = $(TESTS) default_test_SOURCES = ftest.c default_clp.c default_callback.c default_test.c longmembers_test_SOURCES = ftest.c longmembers_clp.c longmembers_callback.c longmembers_test.c long_test_SOURCES = ftest.c long_clp.c long_test.c long_test_LDADD = $(LDADD) -lgnu ulong_test_SOURCES = ftest.c ulong_clp.c ulong_test.c ulong_test_LDADD = $(LDADD) -lgnu intmax_test_SOURCES = ftest.c intmax_clp.c intmax_test.c intmax_test_LDADD = $(LDADD) -lgnu uintmax_test_SOURCES = ftest.c uintmax_clp.c uintmax_test.c uintmax_test_LDADD = $(LDADD) -lgnu double_test_SOURCES = ftest.c double_clp.c double_test.c double_test_LDADD = $(LDADD) -lgnu EXTRA_DIST = test.gp genparse_test.h test.h long.gp ulong.gp intmax.gp uintmax.gp double.gp \ gnulib_test.h default_clp.c: test.gp genparse_test.h test.h $(GENPARSE) $(GENPARSE) -l C -o default_clp $(srcdir)/test.gp longmembers_clp.c: test.gp genparse_test.h test.h $(GENPARSE) $(GENPARSE) -m -l C -i -o longmembers_clp $(srcdir)/test.gp long_clp.c: long.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o long_clp $(srcdir)/long.gp ulong_clp.c: ulong.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o ulong_clp $(srcdir)/ulong.gp intmax_clp.c: intmax.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o intmax_clp $(srcdir)/intmax.gp uintmax_clp.c: uintmax.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o uintmax_clp $(srcdir)/uintmax.gp double_clp.c: double.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o double_clp $(srcdir)/double.gp clean-local: -rm -f default_clp* longmembers_clp* long_clp* ulong_clp* intmax_clp* uintmax_clp* \ double_clp* $(TESTS) genparse-0.9.1/tests/ccheck/long_test.c0000644000076600001440000000314611716257231015005 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "long_clp.h" #include "gnulib_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (0, Options.a); CU_ASSERT_EQUAL (2, Options.b); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-a 1"; argv[argc++] = "-b 2"; argv[argc++] = "-c 5"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (1, Options.a); CU_ASSERT_EQUAL (2, Options.b); CU_ASSERT_EQUAL (5, Options.c); } genparse-0.9.1/tests/ccheck/double_test.c0000644000076600001440000000315011716257231015313 00000000000000/* * Test program for testing the C output of genparse using a CUnit * (http://sourceforge.net/projects/cunit). * * Copyright (C) 2006 - 2012 Michael Geng * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "double_clp.h" #include "gnulib_test.h" static int argc; static char *argv[100]; void AddTests (void) { if (CU_register_suites (suites) != CUE_SUCCESS) { fprintf (stderr, "suite registration failed - %s\n", CU_get_error_msg ()); exit (- 1); } } void testNoArgs (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (0, Options.a); CU_ASSERT_EQUAL (2, Options.b); } void testShortOptions (void) { struct arg_t Options; argc = 0; argv[argc++] = "genparse_test"; argv[argc++] = "-a 1"; argv[argc++] = "-b 2"; argv[argc++] = "-c 5"; Cmdline (&Options, argc, argv); CU_ASSERT_EQUAL (1, Options.a); CU_ASSERT_EQUAL (2, Options.b); CU_ASSERT_EQUAL (5, Options.c); } genparse-0.9.1/tests/ccheck/Makefile.in0000644000076600001440000007216611732677152014726 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = default_test$(EXEEXT) longmembers_test$(EXEEXT) \ long_test$(EXEEXT) ulong_test$(EXEEXT) intmax_test$(EXEEXT) \ uintmax_test$(EXEEXT) double_test$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) subdir = tests/ccheck DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__EXEEXT_1 = default_test$(EXEEXT) longmembers_test$(EXEEXT) \ long_test$(EXEEXT) ulong_test$(EXEEXT) intmax_test$(EXEEXT) \ uintmax_test$(EXEEXT) double_test$(EXEEXT) am_default_test_OBJECTS = ftest.$(OBJEXT) default_clp.$(OBJEXT) \ default_callback.$(OBJEXT) default_test.$(OBJEXT) default_test_OBJECTS = $(am_default_test_OBJECTS) default_test_LDADD = $(LDADD) default_test_DEPENDENCIES = am_double_test_OBJECTS = ftest.$(OBJEXT) double_clp.$(OBJEXT) \ double_test.$(OBJEXT) double_test_OBJECTS = $(am_double_test_OBJECTS) am__DEPENDENCIES_1 = double_test_DEPENDENCIES = $(am__DEPENDENCIES_1) am_intmax_test_OBJECTS = ftest.$(OBJEXT) intmax_clp.$(OBJEXT) \ intmax_test.$(OBJEXT) intmax_test_OBJECTS = $(am_intmax_test_OBJECTS) intmax_test_DEPENDENCIES = $(am__DEPENDENCIES_1) am_long_test_OBJECTS = ftest.$(OBJEXT) long_clp.$(OBJEXT) \ long_test.$(OBJEXT) long_test_OBJECTS = $(am_long_test_OBJECTS) long_test_DEPENDENCIES = $(am__DEPENDENCIES_1) am_longmembers_test_OBJECTS = ftest.$(OBJEXT) \ longmembers_clp.$(OBJEXT) longmembers_callback.$(OBJEXT) \ longmembers_test.$(OBJEXT) longmembers_test_OBJECTS = $(am_longmembers_test_OBJECTS) longmembers_test_LDADD = $(LDADD) longmembers_test_DEPENDENCIES = am_uintmax_test_OBJECTS = ftest.$(OBJEXT) uintmax_clp.$(OBJEXT) \ uintmax_test.$(OBJEXT) uintmax_test_OBJECTS = $(am_uintmax_test_OBJECTS) uintmax_test_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ulong_test_OBJECTS = ftest.$(OBJEXT) ulong_clp.$(OBJEXT) \ ulong_test.$(OBJEXT) ulong_test_OBJECTS = $(am_ulong_test_OBJECTS) ulong_test_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(default_test_SOURCES) $(double_test_SOURCES) \ $(intmax_test_SOURCES) $(long_test_SOURCES) \ $(longmembers_test_SOURCES) $(uintmax_test_SOURCES) \ $(ulong_test_SOURCES) DIST_SOURCES = $(default_test_SOURCES) $(double_test_SOURCES) \ $(intmax_test_SOURCES) $(long_test_SOURCES) \ $(longmembers_test_SOURCES) $(uintmax_test_SOURCES) \ $(ulong_test_SOURCES) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ GENPARSE = ../../src/genparse AM_CPPFLAGS = -I$(srcdir)/../../gnulib/lib AM_LDFLAGS = -L../../gnulib/lib LDADD = -lcunit default_test_SOURCES = ftest.c default_clp.c default_callback.c default_test.c longmembers_test_SOURCES = ftest.c longmembers_clp.c longmembers_callback.c longmembers_test.c long_test_SOURCES = ftest.c long_clp.c long_test.c long_test_LDADD = $(LDADD) -lgnu ulong_test_SOURCES = ftest.c ulong_clp.c ulong_test.c ulong_test_LDADD = $(LDADD) -lgnu intmax_test_SOURCES = ftest.c intmax_clp.c intmax_test.c intmax_test_LDADD = $(LDADD) -lgnu uintmax_test_SOURCES = ftest.c uintmax_clp.c uintmax_test.c uintmax_test_LDADD = $(LDADD) -lgnu double_test_SOURCES = ftest.c double_clp.c double_test.c double_test_LDADD = $(LDADD) -lgnu EXTRA_DIST = test.gp genparse_test.h test.h long.gp ulong.gp intmax.gp uintmax.gp double.gp \ gnulib_test.h all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/ccheck/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/ccheck/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) default_test$(EXEEXT): $(default_test_OBJECTS) $(default_test_DEPENDENCIES) @rm -f default_test$(EXEEXT) $(LINK) $(default_test_OBJECTS) $(default_test_LDADD) $(LIBS) double_test$(EXEEXT): $(double_test_OBJECTS) $(double_test_DEPENDENCIES) @rm -f double_test$(EXEEXT) $(LINK) $(double_test_OBJECTS) $(double_test_LDADD) $(LIBS) intmax_test$(EXEEXT): $(intmax_test_OBJECTS) $(intmax_test_DEPENDENCIES) @rm -f intmax_test$(EXEEXT) $(LINK) $(intmax_test_OBJECTS) $(intmax_test_LDADD) $(LIBS) long_test$(EXEEXT): $(long_test_OBJECTS) $(long_test_DEPENDENCIES) @rm -f long_test$(EXEEXT) $(LINK) $(long_test_OBJECTS) $(long_test_LDADD) $(LIBS) longmembers_test$(EXEEXT): $(longmembers_test_OBJECTS) $(longmembers_test_DEPENDENCIES) @rm -f longmembers_test$(EXEEXT) $(LINK) $(longmembers_test_OBJECTS) $(longmembers_test_LDADD) $(LIBS) uintmax_test$(EXEEXT): $(uintmax_test_OBJECTS) $(uintmax_test_DEPENDENCIES) @rm -f uintmax_test$(EXEEXT) $(LINK) $(uintmax_test_OBJECTS) $(uintmax_test_LDADD) $(LIBS) ulong_test$(EXEEXT): $(ulong_test_OBJECTS) $(ulong_test_DEPENDENCIES) @rm -f ulong_test$(EXEEXT) $(LINK) $(ulong_test_OBJECTS) $(ulong_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default_callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/double_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/double_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intmax_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intmax_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longmembers_callback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longmembers_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longmembers_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uintmax_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uintmax_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulong_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulong_test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-local ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am default_clp.c: test.gp genparse_test.h test.h $(GENPARSE) $(GENPARSE) -l C -o default_clp $(srcdir)/test.gp longmembers_clp.c: test.gp genparse_test.h test.h $(GENPARSE) $(GENPARSE) -m -l C -i -o longmembers_clp $(srcdir)/test.gp long_clp.c: long.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o long_clp $(srcdir)/long.gp ulong_clp.c: ulong.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o ulong_clp $(srcdir)/ulong.gp intmax_clp.c: intmax.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o intmax_clp $(srcdir)/intmax.gp uintmax_clp.c: uintmax.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o uintmax_clp $(srcdir)/uintmax.gp double_clp.c: double.gp gnulib_test.h $(GENPARSE) $(GENPARSE) -l C -g -o double_clp $(srcdir)/double.gp clean-local: -rm -f default_clp* longmembers_clp* long_clp* ulong_clp* intmax_clp* uintmax_clp* \ double_clp* $(TESTS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/tests/Makefile.in0000644000076600001440000005776411732677152013515 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_CUNIT_TRUE@am__append_1 = ccheck @HAVE_CPPUNIT_TRUE@am__append_2 = cppcheck @HAVE_GETOPT_JAVA_TRUE@@HAVE_JAVAC_TRUE@@HAVE_JAVA_TRUE@@HAVE_JUNIT_TRUE@am__append_3 = javacheck subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = ccheck cppcheck javacheck misc DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ SUBDIRS = $(am__append_1) $(am__append_2) $(am__append_3) misc all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/config.in0000644000076600001440000002421611732677177012074 00000000000000/* config.in. Generated from configure.ac by autoheader. */ /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T /* Define to the number of bits in type 'sig_atomic_t'. */ #undef BITSIZEOF_SIG_ATOMIC_T /* Define to the number of bits in type 'size_t'. */ #undef BITSIZEOF_SIZE_T /* Define to the number of bits in type 'wchar_t'. */ #undef BITSIZEOF_WCHAR_T /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T /* Define to make the limit macros in visible. */ #undef GL_TRIGGER_STDC_LIMIT_MACROS /* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. */ #undef HAVE_DECL_GETENV /* Define to 1 if you have the declaration of `imaxabs', and to 0 if you don't. */ #undef HAVE_DECL_IMAXABS /* Define to 1 if you have the declaration of `imaxdiv', and to 0 if you don't. */ #undef HAVE_DECL_IMAXDIV /* Define to 1 if you have the declaration of `strerror', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the declaration of `strtoimax', and to 0 if you don't. */ #undef HAVE_DECL_STRTOIMAX /* Define to 1 if you have the declaration of `strtoll', and to 0 if you don't. */ #undef HAVE_DECL_STRTOLL /* Define to 1 if you have the declaration of `strtoull', and to 0 if you don't. */ #undef HAVE_DECL_STRTOULL /* Define to 1 if you have the declaration of `strtoumax', and to 0 if you don't. */ #undef HAVE_DECL_STRTOUMAX /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `getdomainname' function. */ #undef HAVE_GETDOMAINNAME /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if the compiler supports one of the keywords 'inline', '__inline__', '__inline' and effectively inlines functions marked as such. */ #undef HAVE_INLINE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `l' library (-ll). */ #undef HAVE_LIBL /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mktime' function. */ #undef HAVE_MKTIME /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if 'sig_atomic_t' is a signed integer type. */ #undef HAVE_SIGNED_SIG_ATOMIC_T /* Define to 1 if 'wchar_t' is a signed integer type. */ #undef HAVE_SIGNED_WCHAR_T /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoimax' function. */ #undef HAVE_STRTOIMAX /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL /* Define to 1 if you have the `strtoumax' function. */ #undef HAVE_STRTOUMAX /* Define to 1 if the system has the type `struct random_data'. */ #undef HAVE_STRUCT_RANDOM_DATA /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UTSNAME_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if exists and defines unusable PRI* macros. */ #undef PRI_MACROS_BROKEN /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX /* Define this to 1 if strerror is broken. */ #undef REPLACE_STRERROR /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'size_t'. */ #undef SIZE_T_SUFFIX /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wchar_t'. */ #undef WCHAR_T_SUFFIX /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wint_t'. */ #undef WINT_T_SUFFIX /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX /* Ensure that defines the limit macros, since gnulib's relies on them. */ #if defined __cplusplus && !defined __STDC_LIMIT_MACROS && GL_TRIGGER_STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS 1 #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. __APPLE__ && __MACH__ test for MacOS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif /* Define to `int' if does not define. */ #undef pid_t /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Work around a bug in Sun C++: it does not support _Restrict, even though the corresponding Sun C compiler does, which causes "#define restrict _Restrict" in the previous line. Perhaps some future version of Sun C++ will work with _Restrict; if so, it'll probably define __RESTRICT, just as Sun C does. */ #if defined __SUNPRO_CC && !defined __RESTRICT # define _Restrict #endif /* Define as a marker that can be attached to function parameter declarations for parameters that are not used. This helps to reduce warnings, such as from GCC -Wunused-parameter. */ #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) # define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) #else # define _UNUSED_PARAMETER_ #endif genparse-0.9.1/TODO0000644000076600001440000000053407175663205010755 00000000000000- Back up output files before overwriting them. - enumerated types for strings - mandatory args can checked for - Default flags off or false - #optional as well as #mandatory? - invocation command implementation - documentation of multiple descriptions - figure out how to get make dist to work - add GNU liscence blurb to all source files genparse-0.9.1/examples/0000777000076600001440000000000011732700534012154 500000000000000genparse-0.9.1/examples/echo_clp.c0000644000076600001440000000631511110011723013776 00000000000000/****************************************************************************** ** ** echo_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "echo_clp.h" static struct option const long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->n = false; my_args->e = false; my_args->E = false; my_args->help = false; my_args->version = false; optind = 0; while ((c = getopt_long (argc, argv, "neEhv", long_options, &optind)) != - 1) { switch (c) { case 'n': my_args->n = true; break; case 'e': my_args->e = true; break; case 'E': my_args->E = true; break; case 'h': my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->version = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]... [STRING]...\n\ Echo the STRING(s) to standard output.\n\ \n\ -n do not output the trailing newline\n\ -e enable interpretation of backslash escapes (default)\n\ -E disable interpretation of backslash escapes\n\ -h, --help display this help and exit\n\ -v, --version output version information and exit\n\ \n\ If -e is in effect, the following sequences are recognized:\n\ \n\ \\0NNN the character whose ASCII code is NNN (octal)\n\ \\\\ backslash\n\ \\a alert (BEL)\n\ \\b backspace\n\ \\c suppress trailing newline\n\ \\f form feed\n\ \\n new line\n\ \\r carriage return\n\ \\t horizontal tab\n\ \\v vertical tab\n\ \n\ NOTE: your shell may have its own version of %s, which usually supersedes\n\ the version described here. Please refer to your shell's documentation\n\ for details about the options it supports.\n"), program_name, program_name); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/tail_clp.c0000644000076600001440000002031611110011723014006 00000000000000/****************************************************************************** ** ** tail_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "xstrtod.h" #include "c-strtod.h" #include "tail_clp.h" static struct option const long_options[] = { {"retry", no_argument, NULL, 256}, {"bytes", required_argument, NULL, 'c'}, {"follow", optional_argument, NULL, 'f'}, {"lines", required_argument, NULL, 'n'}, {"max-unchanged-stats", required_argument, NULL, 257}, {"pid", required_argument, NULL, 258}, {"quiet", no_argument, NULL, 'q'}, {"silent", no_argument, NULL, 259}, {"sleep-interval", required_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {"help", no_argument, NULL, 260}, {"version", no_argument, NULL, 261}, {"-presume-input-pipe", no_argument, NULL, 262}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->retry = false; my_args->bytes = NULL; my_args->follow = NULL; my_args->follow_flag = false; my_args->F = false; my_args->lines = NULL; my_args->max_unchanged_stats = 0; my_args->pid = 0; my_args->quiet = false; my_args->silent = false; my_args->sleep_interval = 0; my_args->verbose = false; my_args->help = false; my_args->version = false; my_args->_presume_input_pipe = false; my_args->_0 = false; my_args->_1 = false; my_args->_2 = false; my_args->_3 = false; my_args->_4 = false; my_args->_5 = false; my_args->_6 = false; my_args->_7 = false; my_args->_8 = false; my_args->_9 = false; optind = 0; while ((c = getopt_long (argc, argv, "c:fFn:qs:v0123456789", long_options, &optind)) != - 1) { switch (c) { case 256: my_args->retry = true; break; case 'c': my_args->bytes = optarg; break; case 'f': my_args->follow_flag = true; if (optarg != NULL) my_args->follow = optarg; break; case 'F': my_args->F = true; break; case 'n': my_args->lines = optarg; break; case 257: if (xstrtoumax (optarg, NULL, 10, &my_args->max_unchanged_stats, NULL) != LONGINT_OK) error (EXIT_FAILURE, 0, _("%s: invalid maximum number of unchanged stats between opens"), optarg); break; case 258: if (xstrtoul (optarg, NULL, 10, &my_args->pid, NULL) != LONGINT_OK || my_args->pid > PID_T_MAX) error (EXIT_FAILURE, 0, _("%s: invalid PID"), optarg); break; case 'q': my_args->quiet = true; break; case 259: my_args->silent = true; break; case 's': if (! xstrtod (optarg, NULL, &my_args->sleep_interval, c_strtod) || my_args->sleep_interval < 0) error (EXIT_FAILURE, 0, _("%s: invalid number of seconds"), optarg); break; case 'v': my_args->verbose = true; break; case 260: my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 261: my_args->version = true; break; case 262: my_args->_presume_input_pipe = true; break; case '0': my_args->_0 = true; break; case '1': my_args->_1 = true; break; case '2': my_args->_2 = true; break; case '3': my_args->_3 = true; break; case '4': my_args->_4 = true; break; case '5': my_args->_5 = true; break; case '6': my_args->_6 = true; break; case '7': my_args->_7 = true; break; case '8': my_args->_8 = true; break; case '9': my_args->_9 = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]... [FILE]...\n\ Print the last %d lines of each FILE to standard output.\n\ With more than one FILE, precede each with a header giving the file name.\n\ With no FILE, or when FILE is -, read standard input.\n"), program_name, DEFAULT_N_LINES); puts (_("\ Mandatory arguments to long options are mandatory for short options too.")); puts (_("\ --retry keep trying to open a file even if it is\n\ inaccessible when tail starts or if it becomes\n\ inaccessible later; useful when following by name,\n\ i.e., with --follow=name\n\ -c, --bytes=N output the last N bytes; alternatively, use +N to\n\ output bytes starting with the Nth of each file")); puts (_("\ -f, --follow[={name|descriptor}]\n\ output appended data as the file grows;\n\ -f, --follow, and --follow=descriptor are\n\ equivalent\n\ -F same as --follow=name --retry")); printf (_("\ -n, --lines=N output the last N lines, instead of the last %d;\n\ or use +N to output lines starting with the Nth\n\ --max-unchanged-stats=N\n\ with --follow=name, reopen a FILE which has not\n\ changed size after N (default %d) iterations\n\ to see if it has been unlinked or renamed\n\ (this is the usual case of rotated log files)\n"), DEFAULT_N_LINES, DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS); puts (_("\ --pid=PID with -f, terminate after process ID, PID dies\n\ -q, --quiet never output headers giving file names\n\ --silent same as --quiet\n\ -s, --sleep-interval=S with -f, sleep for approximately S seconds\n\ (default 1.0) between iterations.\n\ -v, --verbose always output headers giving file names")); puts (_("\ --help display this help and exit")); puts (_("\ --version output version information and exit")); puts (_("\ \n\ If the first character of N (the number of bytes or lines) is a `+',\n\ print beginning with the Nth item from the start of each file, otherwise,\n\ print the last N items in the file. N may have a multiplier suffix:\n\ b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\ GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.")); puts (_("\ \n\ With --follow (-f), tail defaults to following the file descriptor, which\n\ means that even if a tail'ed file is renamed, tail will continue to track\n\ its end. This default behavior is not desirable when you really want to\n\ track the actual name of the file, not the file descriptor (e.g., log\n\ rotation). Use --follow=name in that case. That causes tail to track the\n\ named file by reopening it periodically to see if it has been removed and\n\ recreated by some other program.")); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/tail.h0000644000076600001440000000074110701231473013170 00000000000000/* Number of items to tail. */ #define DEFAULT_N_LINES 10 /* When tailing a file by name, if there have been this many consecutive iterations for which the file has not changed, then open/fstat the file to determine if that file name is still associated with the same device/inode-number pair as before. This option is meaningful only when following by name. --max-unchanged-stats=N */ #define DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS 5 #define PID_T_MAX 1000 genparse-0.9.1/examples/ls.gp0000644000076600001440000001433610744370056013051 00000000000000#include "coreutils.h" #include "ls.h" #exit_value LS_FAILURE a / all flag "do not ignore entries starting with ." A / almost-all flag "do not list implied . and .." NONE / author flag "with -l, print the author of each file" b / escape flag "print octal escapes for nongraphic characters__NEW_PRINT__" NONE / block-size=SIZE string "use SIZE-byte blocks" __STORE_LONGINDEX__ B / ignore-backups flag "do not list implied entries ending with ~" c flag "with -lt: sort by, and show, ctime (time of last" " modification of file status information)" " with -l: show ctime and sort by name" " otherwise: sort by ctime__NEW_PRINT__" C flag "list entries by columns" NONE / color*[=WHEN] string "control whether color is used to distinguish file" " types. WHEN may be `never', `always', or `auto'" d / directory flag "list directory entries instead of contents," " and do not dereference symbolic links" D / dired flag "generate output designed for Emacs' dired mode__NEW_PRINT__" f flag "do not sort, enable -aU, disable -ls --color" F / classify flag "append indicator (one of /=*>@|) to entries" NONE / file-type flag "likewise, except do not append `*'" NONE / format=WORD string "across -x, commas -m, horizontal -x, long -l," " single-column -1, verbose -l, vertical -C" NONE / full-time flag "like -l --time-style=full-iso__NEW_PRINT__" g flag "like -l, but do not list owner__NEW_PRINT__" NONE / group-directories-first flag "" "group directories before files__NEW_PRINT__" G / no-group flag "in a long listing, don't print group names" h / human-readable flag "with -l, print sizes in human readable format" " (e.g., 1K 234M 2G)" NONE / si flag "likewise, but use powers of 1000 not 1024__NEW_PRINT__" H / dereference-command-line flag "" "follow symbolic links listed on the command line" NONE / dereference-command-line-symlink-to-dir flag "" "follow each command line symbolic link" "that points to a directory" NONE / hide=PATTERN string "do not list implied entries matching shell PATTERN" " (overridden by -a or -A)__NEW_PRINT__" NONE / indicator-style=WORD string " append indicator with style WORD to entry names:" " none (default), slash (-p)," " file-type (--file-type), classify (-F)" i / inode flag "print the index number of each file" I / ignore=PATTERN string "do not list implied entries matching shell PATTERN" k flag "like --block-size=1K__NEW_PRINT__" NONE / kilobytes flag "__DO_NOT_DOCUMENT__" l flag "use a long listing format" L / dereference flag "when showing file information for a symbolic" " link, show information for the file the link" " references rather than for the link itself" m flag "fill width with a comma separated list of entries__NEW_PRINT__" n / numeric-uid-gid flag "like -l, but list numeric user and group IDs" N / literal flag "print raw entry names (don't treat e.g. control" " characters specially)" o flag "like -l, but do not list group information" p flag "like --indicator-style=slash" " append / indicator to directories__NEW_PRINT__" q / hide-control-chars flag "print ? instead of non graphic characters" NONE / show-control-chars flag "show non graphic characters as-is (default" "unless program is `ls' and output is a terminal)" Q / quote-name flag "enclose entry names in double quotes" NONE / quoting-style=WORD string "use quoting style WORD for entry names:" " literal, locale, shell, shell-always, c, escape__NEW_PRINT__" r / reverse flag "reverse order while sorting" R / recursive flag "list subdirectories recursively" s / size flag "print the size of each file, in blocks__NEW_PRINT__" S flag "sort by file size" NONE / sort=WORD string "sort by WORD instead of name: none -U," "extension -X, size -S, time -t, version -v" NONE / time=WORD string "with -l, show time as WORD instead of modification" "time: atime -u, access -u, use -u, ctime -c," "or status -c; use specified time as sort key" "if --sort=time__NEW_PRINT__" NONE / time-style=STYLE string "with -l, show times using style STYLE:" "full-iso, long-iso, iso, locale, +FORMAT." "FORMAT is interpreted like `date'; if FORMAT is" "FORMAT1FORMAT2, FORMAT1 applies to" "non-recent files and FORMAT2 to recent files;" "if STYLE is prefixed with `posix-', STYLE" "takes effect only outside the POSIX locale__NEW_PRINT__" t flag "sort by modification time" T / tabsize=COLS ulong [..SIZE_MAX] "assume tab stops at each COLS instead of 8__NEW_PRINT__" __ERR_MSG__("invalid tab size: %s", quotearg) u flag "with -lt: sort by, and show, access time" " with -l: show access time and sort by name" " otherwise: sort by access time" U flag "do not sort; list entries in directory order" v flag "sort by version__NEW_PRINT__" w / width=COLS ulong [1..SIZE_MAX] "assume screen width instead of current value" __ERR_MSG__("invalid line width: %s", quotearg) x flag "list entries by lines instead of by columns" X flag "sort alphabetically by entry extension" Z / context flag "print any SELinux security context of each file" 1 flag "list one file per line__NEW_PRINT__" #gp_include help_version.gp #usage_begin Usage: __PROGRAM_NAME__ [OPTION]... [FILE]...__NEW_PRINT__ List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort. __NEW_PRINT__ Mandatory arguments to long options are mandatory for short options too.__NEW_PRINT__ __GLOSSARY_GNU__(29) SIZE may be (or may be an integer optionally followed by) one of following: kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.__NEW_PRINT__ By default, color is not used to distinguish types of files. That is equivalent to using --color=none. Using the --color option without the optional WHEN argument is equivalent to using --color=always. With --color=auto, color codes are output only if standard output is connected to a terminal (tty). The environment variable LS_COLORS can influence the colors, and can be set easily by the dircolors command.__NEW_PRINT__ Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble. __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/wc.gp0000644000076600001440000000141010744370060013024 00000000000000#include "coreutils.h" c / bytes flag "print the byte counts" m / chars flag "print the character counts" l / lines flag "print the newline counts__NEW_PRINT__" NONE / files0-from=F string "read input from the files specified by" " NUL-terminated names in file F" L / max-line-length flag "print the length of the longest line" w / words flag "print the word counts__NEW_PRINT__" #gp_include help_version.gp #usage_begin Usage: __PROGRAM_NAME__ [OPTION]... [FILE]... or: __PROGRAM_NAME__ [OPTION]... --files0-from=F__NEW_PRINT__ Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified. With no FILE, or when FILE is -, read standard input. __GLOSSARY_GNU__(25) __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/ping.c0000644000076600001440000000033410733450516013173 00000000000000/* ping.c */ #include #include #include "ping_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/rm_clp.h0000644000076600001440000000141610744370060013516 00000000000000/****************************************************************************** ** ** rm_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "coreutils.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool directory; bool force; bool interactive; bool recursive; bool verbose; bool help; bool version; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/mycopy3_clp.c0000644000076600001440000000564311732675642014520 00000000000000/****************************************************************************** ** ** mycopy3_clp.c ** ** Thu Mar 22 20:21:06 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** C file for command line parser ** ** Automatically created by genparse v0.9.0 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "mycopy3_clp.h" static struct option const long_options[] = { {"iterations", required_argument, NULL, 'i'}, {"outfile", required_argument, NULL, 'o'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->i = 1; my_args->o = NULL; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "i:o:hv", long_options, &optind)) != - 1) { switch (c) { case 'i': my_args->i = atoi (optarg); if (my_args->i < 0) { fprintf (stderr, "parameter range error: i must be >= 0\n"); errflg++; } break; case 'o': my_args->o = optarg; break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -iohv ] file\n\ Print a file for a number of times to stdout.\n\ [ -i ] [ --iterations ] (type=INTEGER, range=0..., default=1)\n\ Number of times to output .\n\ File should be text format!\n\ [ -o ] [ --outfile ] (type=STRING)\n\ Output file name.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } genparse-0.9.1/examples/mycopy3.c0000644000076600001440000000113210674673706013652 00000000000000/* mycopy3.c */ #include #include #include "mycopy3_clp.h" #define VERSION "3.0" int main (int argc, char *argv[]) { int c, i; FILE *fp, *ofp; struct arg_t a; Cmdline (&a, argc, argv); if (a.v) { printf ("%s version %s\n", argv[0], VERSION); exit (0); } if (a.o) ofp = fopen (a.o, "w"); else ofp = stdout; if (!a.optind) fp = stdin; else fp = fopen (argv[a.optind],"r"); for (i = 0; i < a.i; i++) { while ((c = fgetc (fp)) != EOF) fputc (c, ofp); rewind (fp); } fclose (fp); return 0; } genparse-0.9.1/examples/rm.gp0000644000076600001440000000163010744370056013042 00000000000000#include "coreutils.h" d / directory flag "unlink directory, even if non-empty (super-user only)" f / force flag "ignore nonexistant files, never prompt" i / interactive flag "prompt before any removal" rR / recursive flag "remove the contents of directories recursively" v / verbose flag "explain what is being done" h / help flag "print this help and exit" NONE / version flag "print version information and exit" #usage_begin Remove (unlink) the FILE(s). Usage: __PROGRAM_NAME__ [OPTION]... FILE... __GLOSSARY_GNU__ To remove a file whose name starts with a `-', for example `-foo', use one of these commands: __PROGRAM_NAME__ -- -foo __PROGRAM_NAME__ ./-foo Note that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred. __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/mv.gp0000644000076600001440000000270410744370056013051 00000000000000#include "coreutils.h" NONE / backup=CONTROL string "make a backup of each existing destination file" b flag "like --backup but does not accept an argument" f / force flag "never prompt before overwriting" i / interactive flag "prompt before overwrite" NONE / strip-trailing-slashes flag " remove any trailing slashes from each SOURCE" " argument" s / suffix=SUFFIX flag "override the usual backup suffix" NONE / target-directory flag "move all SOURCE arguments into DIRECTORY" u / update flag "move only older or brand new non-directories" v / verbose flag "explain what is being done" h / help flag "display this help and exit" NONE / version flag "output version information and exit" #usage_begin Usage: __PROGRAM_NAME__ [OPTION]... SOURCE DEST or: __PROGRAM_NAME__ [OPTION]... SOURCE... DIRECTORY or: __PROGRAM_NAME__ [OPTION]... --target-directory=DIRECTORY SOURCE... Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. __GLOSSARY_GNU__(31) The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values: none, off never make backups (even if --backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/tail_clp.h0000644000076600001440000000211010744370060014021 00000000000000/****************************************************************************** ** ** tail_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "xstrtol.h" #include "coreutils.h" #include "tail.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool retry; char * bytes; char * follow; bool follow_flag; bool F; char * lines; uintmax_t max_unchanged_stats; unsigned long int pid; bool quiet; bool silent; double sleep_interval; bool verbose; bool help; bool version; bool _presume_input_pipe; bool _0; bool _1; bool _2; bool _3; bool _4; bool _5; bool _6; bool _7; bool _8; bool _9; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/help_version.gp0000644000076600001440000000020410674544702015120 00000000000000NONE / help flag "display this help and exit__NEW_PRINT__" NONE / version flag "output version information and exit__NEW_PRINT__" genparse-0.9.1/examples/uname.gp0000644000076600001440000000124710744370060013530 00000000000000#include "coreutils.h" a / all flag "print all information, in the following order," " except omit -p and -i if unknown:" s / kernel-name flag "print the kernel name" n / nodename flag "print the network node hostname" v / kernel-version flag "print the kernel name" r / kernel-release flag "print the kernel version" m / machine flag "print the kernel machine hardware name" p / processor flag "print the processor type or " NONE / version flag "print version information and exit" #usage_begin Usage: __PROGRAM_NAME__ [OPTION]... Print certain system information. With no OPTION, same as -s. __GLOSSARY_GNU__ __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/uname_clp.c0000644000076600001440000000720711110011723014166 00000000000000/****************************************************************************** ** ** uname_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "uname_clp.h" static struct option const long_options[] = { {"all", no_argument, NULL, 'a'}, {"kernel-name", no_argument, NULL, 's'}, {"nodename", no_argument, NULL, 'n'}, {"kernel-version", no_argument, NULL, 'v'}, {"kernel-release", no_argument, NULL, 'r'}, {"machine", no_argument, NULL, 'm'}, {"processor", no_argument, NULL, 'p'}, {"version", no_argument, NULL, 256}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->all = false; my_args->kernel_name = false; my_args->nodename = false; my_args->kernel_version = false; my_args->kernel_release = false; my_args->machine = false; my_args->processor = false; my_args->version = false; my_args->help = false; optind = 0; while ((c = getopt_long (argc, argv, "asnvrmph", long_options, &optind)) != - 1) { switch (c) { case 'a': my_args->all = true; break; case 's': my_args->kernel_name = true; break; case 'n': my_args->nodename = true; break; case 'v': my_args->kernel_version = true; break; case 'r': my_args->kernel_release = true; break; case 'm': my_args->machine = true; break; case 'p': my_args->processor = true; break; case 256: my_args->version = true; break; case 'h': my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]...\n\ Print certain system information. With no OPTION, same as -s.\n\ \n\ -a, --all print all information, in the following order,\n\ except omit -p and -i if unknown:\n\ -s, --kernel-name print the kernel name\n\ -n, --nodename print the network node hostname\n\ -v, --kernel-version print the kernel name\n\ -r, --kernel-release print the kernel version\n\ -m, --machine print the kernel machine hardware name\n\ -p, --processor print the processor type or \n\ --version print version information and exit\n\ -h, --help Display this help and exit.\n"), program_name); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/mycopy1.c0000644000076600001440000000050110674673706013647 00000000000000/* mycopy1.c */ #include #include int main (int argc, char *argv[]) { int c, i, n; FILE *fp; n = atoi (argv[1]); fp = fopen (argv[2],"r"); for (i = 0; i < n; i++) { while ((c = fgetc (fp)) != EOF) fputc (c, stdout); rewind (fp); } fclose (fp); return 0; } genparse-0.9.1/examples/mycopy4_clp.cc0000644000076600001440000000601411732675642014655 00000000000000/****************************************************************************** ** ** mycopy4_clp.cc ** ** Thu Mar 22 20:21:06 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** Definition of command line parser class ** ** Automatically created by genparse v0.9.0 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) { extern char *optarg; extern int optind; int c; static struct option long_options[] = { {"iterations", required_argument, NULL, 'i'}, {"outfile", required_argument, NULL, 'o'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; _program_name += argv[0]; /* default values */ _i = 1; _h = false; _v = false; optind = 0; while ((c = getopt_long (argc, argv, "i:o:hv", long_options, &optind)) != - 1) { switch (c) { case 'i': _i = atoi (optarg); if (_i < 1) { std::string s; s += "parameter range error: i must be >= 1"; throw (s); } if (_i > MAX) { std::string s; s += "parameter range error: i must be <= MAX"; throw (s); } break; case 'o': _o = optarg; if (!outfile_cb ()) this->usage (EXIT_FAILURE); break; case 'h': _h = true; this->usage (EXIT_SUCCESS); break; case 'v': _v = true; break; default: this->usage (EXIT_FAILURE); } } /* while */ _optind = optind; if (!my_callback ()) usage (EXIT_FAILURE); } /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) { if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else { std::cout << "\ usage: " << _program_name << " [ -iohv ] file\n\ Print a file for a number of times to stdout.\n\ [ -i ] [ --iterations ] (type=INTEGER, range=1...MAX, default=1)\n\ Number of times to output .\n\ do it like this\n\ [ -o ] [ --outfile ] (type=STRING)\n\ Output file.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n"; } exit (status); } genparse-0.9.1/examples/wc.c0000644000076600001440000000036310674673707012666 00000000000000/* wc.c */ #include #include "wc_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); if (a.help) usage (0, argv[0]); else printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/mv_clp.h0000644000076600001440000000153310744370056013527 00000000000000/****************************************************************************** ** ** mv_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "coreutils.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { char * backup; bool b; bool force; bool interactive; bool strip_trailing_slashes; bool suffix; bool target_directory; bool update; bool verbose; bool help; bool version; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/tail.c0000644000076600001440000000036710674673706013211 00000000000000/* tail.c */ #include #include "tail_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); if (a.help) usage (0, argv[0]); else printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/mv.c0000644000076600001440000000030410674673706012671 00000000000000/* mv.c */ #include #include "mv_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/ping_clp.c0000644000076600001440000001432611110011723014016 00000000000000/****************************************************************************** ** ** ping_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "xstrtod.h" #include "xstrtod.h" #include "ping_clp.h" static struct option const long_options[] = { {"help", no_argument, NULL, 'h'}, {"license", no_argument, NULL, 'L'}, {"version", no_argument, NULL, 'V'}, {"echo", no_argument, NULL, 256}, {"address", no_argument, NULL, 257}, {"timestamp", no_argument, NULL, 258}, {"type", required_argument, NULL, 't'}, {"router", no_argument, NULL, 259}, {"count", required_argument, NULL, 'c'}, {"debug", no_argument, NULL, 'd'}, {"interval", required_argument, NULL, 'i'}, {"numeric", no_argument, NULL, 'n'}, {"ignore-routing", no_argument, NULL, 'r'}, {"verbose", no_argument, NULL, 'v'}, {"flood", no_argument, NULL, 'f'}, {"preload", required_argument, NULL, 'l'}, {"pattern", required_argument, NULL, 'p'}, {"quiet", no_argument, NULL, 'q'}, {"route", no_argument, NULL, 'R'}, {"size", required_argument, NULL, 's'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->help = false; my_args->license = false; my_args->version = false; my_args->echo = false; my_args->address = false; my_args->timestamp = false; my_args->type = NULL; my_args->router = false; my_args->count = NULL; my_args->debug = false; my_args->interval_flag = false; my_args->numeric = false; my_args->ignore_routing = false; my_args->verbose = false; my_args->flood = false; my_args->preload = 0; my_args->pattern = NULL; my_args->quiet = false; my_args->route = false; my_args->size = NULL; optind = 0; while ((c = getopt_long (argc, argv, "hLVt:c:di:nrvfl:p:qRs:", long_options, &optind)) != - 1) { switch (c) { case 'h': my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 'L': my_args->license = true; break; case 'V': my_args->version = true; break; case 256: my_args->echo = true; break; case 257: my_args->address = true; break; case 258: my_args->timestamp = true; break; case 't': my_args->type = optarg; break; case 259: my_args->router = true; break; case 'c': my_args->count = optarg; break; case 'd': my_args->debug = true; break; case 'i': my_args->interval_flag = true; if (optarg != NULL) if (! xstrtod (optarg, NULL, &my_args->interval, strtod)) error (EXIT_FAILURE, 0, "Invalid value (`%s')", optarg); break; case 'n': my_args->numeric = true; break; case 'r': my_args->ignore_routing = true; break; case 'v': my_args->verbose = true; break; case 'f': my_args->flood = true; break; case 'l': if (xstrtoul (optarg, NULL, 10, &my_args->preload, NULL) != LONGINT_OK || my_args->preload < 1 || my_args->preload > INT_MAX) error (EXIT_FAILURE, 0, "ping: invalid preload value (%s)", optarg); break; case 'p': my_args->pattern = optarg; break; case 'q': my_args->quiet = true; break; case 'R': my_args->route = true; break; case 's': my_args->size = optarg; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ Usage: ping [OPTION]... [ADDRESS]...\n\ \n\ Informational options:\n\ -h, --help display this help and exit\n\ -L, --license display license and exit\n\ -V, --version output version information and exit\n\ Options controlling ICMP request types:\n\ --echo Send ICMP_ECHO requests (default)\n\ --address * Send ICMP_ADDRESS packets\n\ --timestamp Send ICMP_TIMESTAMP packets\n\ -t, --type Send TYPE packets\n\ --router * Send ICMP_ROUTERDISCOVERY packets\n\ Options valid for all request types:\n\ -c, --count=N stop after sending N packets\n\ -d, --debug set the SO_DEBUG option\n\ -i, --interval=N wait N seconds between sending each packet\n\ -n, --numeric do not resolve host addresses\n\ -r, --ignore-routing send directly to a host on an attached network\n\ -v, --verbose verbose output\n\ Options valid for --echo requests:\n\ -f, --flood * flood ping\n\ -l, --preload=N * send N packets as fast as possible before falling into\n\ normal mode of behavior\n\ -p, --pattern=PAT fill ICMP packet with given pattern (hex)\n\ -q, --quiet quiet output\n\ -R, --route record route\n\ -s, --size=N set number of data octets to send\n\ \n\ Options marked with an * are available only to super-user\n\ \n\ Report bugs to <%s>.\n", PACKAGE_BUGREPORT); } exit (status); } genparse-0.9.1/examples/mycopy4_clp_cb.cc0000644000076600001440000000177011732675642015325 00000000000000/****************************************************************************** ** ** mycopy4_clp_cb.cc ** ** Thu Mar 22 20:21:06 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** Callbacks for command line parser class ** ** Automatically created by genparse v0.9.0 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::my_callback () ** ** Global callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::my_callback () { return true; } /*---------------------------------------------------------------------------- ** ** Cmdline::outfile_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::outfile_cb () { return true; } genparse-0.9.1/examples/ls_clp.c0000644000076600001440000004242011110011723013473 00000000000000/****************************************************************************** ** ** ls_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "error.h" #include "xstrtol.h" #include "ls_clp.h" static struct option const long_options[] = { {"all", no_argument, NULL, 'a'}, {"almost-all", no_argument, NULL, 'A'}, {"author", no_argument, NULL, 256}, {"escape", no_argument, NULL, 'b'}, {"block-size", required_argument, NULL, 257}, {"ignore-backups", no_argument, NULL, 'B'}, {"color", optional_argument, NULL, 258}, {"directory", no_argument, NULL, 'd'}, {"dired", no_argument, NULL, 'D'}, {"classify", no_argument, NULL, 'F'}, {"file-type", no_argument, NULL, 259}, {"format", required_argument, NULL, 260}, {"full-time", no_argument, NULL, 261}, {"group-directories-first", no_argument, NULL, 262}, {"no-group", no_argument, NULL, 'G'}, {"human-readable", no_argument, NULL, 'h'}, {"si", no_argument, NULL, 263}, {"dereference-command-line", no_argument, NULL, 'H'}, {"dereference-command-line-symlink-to-dir", no_argument, NULL, 264}, {"hide", required_argument, NULL, 265}, {"indicator-style", required_argument, NULL, 266}, {"inode", no_argument, NULL, 'i'}, {"ignore", required_argument, NULL, 'I'}, {"kilobytes", no_argument, NULL, 267}, {"dereference", no_argument, NULL, 'L'}, {"numeric-uid-gid", no_argument, NULL, 'n'}, {"literal", no_argument, NULL, 'N'}, {"hide-control-chars", no_argument, NULL, 'q'}, {"show-control-chars", no_argument, NULL, 268}, {"quote-name", no_argument, NULL, 'Q'}, {"quoting-style", required_argument, NULL, 269}, {"reverse", no_argument, NULL, 'r'}, {"recursive", no_argument, NULL, 'R'}, {"size", no_argument, NULL, 's'}, {"sort", required_argument, NULL, 270}, {"time", required_argument, NULL, 271}, {"time-style", required_argument, NULL, 272}, {"tabsize", required_argument, NULL, 'T'}, {"width", required_argument, NULL, 'w'}, {"context", no_argument, NULL, 'Z'}, {"help", no_argument, NULL, 273}, {"version", no_argument, NULL, 274}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->all = false; my_args->almost_all = false; my_args->author = false; my_args->escape = false; my_args->block_size = NULL; my_args->block_size_li = 0; my_args->ignore_backups = false; my_args->c = false; my_args->C = false; my_args->color = NULL; my_args->color_flag = false; my_args->directory = false; my_args->dired = false; my_args->f = false; my_args->classify = false; my_args->file_type = false; my_args->format = NULL; my_args->full_time = false; my_args->g = false; my_args->group_directories_first = false; my_args->no_group = false; my_args->human_readable = false; my_args->si = false; my_args->dereference_command_line = false; my_args->dereference_command_line_symlink_to_dir = false; my_args->hide = NULL; my_args->indicator_style = NULL; my_args->inode = false; my_args->ignore = NULL; my_args->k = false; my_args->kilobytes = false; my_args->l = false; my_args->dereference = false; my_args->m = false; my_args->numeric_uid_gid = false; my_args->literal = false; my_args->o = false; my_args->p = false; my_args->hide_control_chars = false; my_args->show_control_chars = false; my_args->quote_name = false; my_args->quoting_style = NULL; my_args->reverse = false; my_args->recursive = false; my_args->size = false; my_args->S = false; my_args->sort = NULL; my_args->time = NULL; my_args->time_style = NULL; my_args->t = false; my_args->u = false; my_args->U = false; my_args->v = false; my_args->x = false; my_args->X = false; my_args->context = false; my_args->_1 = false; my_args->help = false; my_args->version = false; optind = 0; while ((c = getopt_long (argc, argv, "aAbBcCdDfFgGhHiI:klLmnNopqQrRsStT:uUvw:xXZ1", long_options, &optind)) != - 1) { switch (c) { case 'a': my_args->all = true; break; case 'A': my_args->almost_all = true; break; case 256: my_args->author = true; break; case 'b': my_args->escape = true; break; case 257: my_args->block_size = optarg; my_args->block_size_li = optind; break; case 'B': my_args->ignore_backups = true; break; case 'c': my_args->c = true; break; case 'C': my_args->C = true; break; case 258: my_args->color_flag = true; if (optarg != NULL) my_args->color = optarg; break; case 'd': my_args->directory = true; break; case 'D': my_args->dired = true; break; case 'f': my_args->f = true; break; case 'F': my_args->classify = true; break; case 259: my_args->file_type = true; break; case 260: my_args->format = optarg; break; case 261: my_args->full_time = true; break; case 'g': my_args->g = true; break; case 262: my_args->group_directories_first = true; break; case 'G': my_args->no_group = true; break; case 'h': my_args->human_readable = true; break; case 263: my_args->si = true; break; case 'H': my_args->dereference_command_line = true; break; case 264: my_args->dereference_command_line_symlink_to_dir = true; break; case 265: my_args->hide = optarg; break; case 266: my_args->indicator_style = optarg; break; case 'i': my_args->inode = true; break; case 'I': my_args->ignore = optarg; break; case 'k': my_args->k = true; break; case 267: my_args->kilobytes = true; break; case 'l': my_args->l = true; break; case 'L': my_args->dereference = true; break; case 'm': my_args->m = true; break; case 'n': my_args->numeric_uid_gid = true; break; case 'N': my_args->literal = true; break; case 'o': my_args->o = true; break; case 'p': my_args->p = true; break; case 'q': my_args->hide_control_chars = true; break; case 268: my_args->show_control_chars = true; break; case 'Q': my_args->quote_name = true; break; case 269: my_args->quoting_style = optarg; break; case 'r': my_args->reverse = true; break; case 'R': my_args->recursive = true; break; case 's': my_args->size = true; break; case 'S': my_args->S = true; break; case 270: my_args->sort = optarg; break; case 271: my_args->time = optarg; break; case 272: my_args->time_style = optarg; break; case 't': my_args->t = true; break; case 'T': if (xstrtoul (optarg, NULL, 10, &my_args->tabsize, NULL) != LONGINT_OK || my_args->tabsize > SIZE_MAX) error (LS_FAILURE, 0, _("invalid tab size: %s"), quotearg (optarg)); break; case 'u': my_args->u = true; break; case 'U': my_args->U = true; break; case 'v': my_args->v = true; break; case 'w': if (xstrtoul (optarg, NULL, 10, &my_args->width, NULL) != LONGINT_OK || my_args->width < 1 || my_args->width > SIZE_MAX) error (LS_FAILURE, 0, _("invalid line width: %s"), quotearg (optarg)); break; case 'x': my_args->x = true; break; case 'X': my_args->X = true; break; case 'Z': my_args->context = true; break; case '1': my_args->_1 = true; break; case 273: my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 274: my_args->version = true; break; default: usage (LS_FAILURE, argv[0]); } } /* while */ if (errflg) usage (LS_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]... [FILE]...\n"), program_name); puts (_("\ List information about the FILEs (the current directory by default).\n\ Sort entries alphabetically if none of -cftuvSUX nor --sort.")); puts (_("\ Mandatory arguments to long options are mandatory for short options too.")); puts (_("\ -a, --all do not ignore entries starting with .\n\ -A, --almost-all do not list implied . and ..\n\ --author with -l, print the author of each file\n\ -b, --escape print octal escapes for nongraphic characters")); puts (_("\ --block-size=SIZE use SIZE-byte blocks\n\ -B, --ignore-backups do not list implied entries ending with ~\n\ -c with -lt: sort by, and show, ctime (time of last\n\ modification of file status information)\n\ with -l: show ctime and sort by name\n\ otherwise: sort by ctime")); puts (_("\ -C list entries by columns\n\ --color[=WHEN] control whether color is used to distinguish file\n\ types. WHEN may be `never', `always', or `auto'\n\ -d, --directory list directory entries instead of contents,\n\ and do not dereference symbolic links\n\ -D, --dired generate output designed for Emacs' dired mode")); puts (_("\ -f do not sort, enable -aU, disable -ls --color\n\ -F, --classify append indicator (one of /=*>@|) to entries\n\ --file-type likewise, except do not append `*'\n\ --format=WORD across -x, commas -m, horizontal -x, long -l,\n\ single-column -1, verbose -l, vertical -C\n\ --full-time like -l --time-style=full-iso")); puts (_("\ -g like -l, but do not list owner")); puts (_("\ --group-directories-first\n\ group directories before files")); puts (_("\ -G, --no-group in a long listing, don't print group names\n\ -h, --human-readable with -l, print sizes in human readable format\n\ (e.g., 1K 234M 2G)\n\ --si likewise, but use powers of 1000 not 1024")); puts (_("\ -H, --dereference-command-line\n\ follow symbolic links listed on the command line\n\ --dereference-command-line-symlink-to-dir\n\ follow each command line symbolic link\n\ that points to a directory\n\ --hide=PATTERN do not list implied entries matching shell PATTERN\n\ (overridden by -a or -A)")); puts (_("\ --indicator-style=WORD append indicator with style WORD to entry names:\n\ none (default), slash (-p),\n\ file-type (--file-type), classify (-F)\n\ -i, --inode print the index number of each file\n\ -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n\ -k like --block-size=1K")); puts (_("\ -l use a long listing format\n\ -L, --dereference when showing file information for a symbolic\n\ link, show information for the file the link\n\ references rather than for the link itself\n\ -m fill width with a comma separated list of entries")); puts (_("\ -n, --numeric-uid-gid like -l, but list numeric user and group IDs\n\ -N, --literal print raw entry names (don't treat e.g. control\n\ characters specially)\n\ -o like -l, but do not list group information\n\ -p like --indicator-style=slash\n\ append / indicator to directories")); puts (_("\ -q, --hide-control-chars print ? instead of non graphic characters\n\ --show-control-chars show non graphic characters as-is (default\n\ unless program is `ls' and output is a terminal)\n\ -Q, --quote-name enclose entry names in double quotes\n\ --quoting-style=WORD use quoting style WORD for entry names:\n\ literal, locale, shell, shell-always, c, escape")); puts (_("\ -r, --reverse reverse order while sorting\n\ -R, --recursive list subdirectories recursively\n\ -s, --size print the size of each file, in blocks")); puts (_("\ -S sort by file size\n\ --sort=WORD sort by WORD instead of name: none -U,\n\ extension -X, size -S, time -t, version -v\n\ --time=WORD with -l, show time as WORD instead of modification\n\ time: atime -u, access -u, use -u, ctime -c,\n\ or status -c; use specified time as sort key\n\ if --sort=time")); puts (_("\ --time-style=STYLE with -l, show times using style STYLE:\n\ full-iso, long-iso, iso, locale, +FORMAT.\n\ FORMAT is interpreted like `date'; if FORMAT is\n\ FORMAT1FORMAT2, FORMAT1 applies to\n\ non-recent files and FORMAT2 to recent files;\n\ if STYLE is prefixed with `posix-', STYLE\n\ takes effect only outside the POSIX locale")); puts (_("\ -t sort by modification time\n\ -T, --tabsize=COLS assume tab stops at each COLS instead of 8")); puts (_("\ -u with -lt: sort by, and show, access time\n\ with -l: show access time and sort by name\n\ otherwise: sort by access time\n\ -U do not sort; list entries in directory order\n\ -v sort by version")); puts (_("\ -w, --width=COLS assume screen width instead of current value\n\ -x list entries by lines instead of by columns\n\ -X sort alphabetically by entry extension\n\ -Z, --context print any SELinux security context of each file\n\ -1 list one file per line")); puts (_("\ --help display this help and exit")); puts (_("\ --version output version information and exit")); puts (_("\ \n\ SIZE may be (or may be an integer optionally followed by) one of following:\n\ kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.")); puts (_("\ \n\ By default, color is not used to distinguish types of files. That is\n\ equivalent to using --color=none. Using the --color option without the\n\ optional WHEN argument is equivalent to using --color=always. With\n\ --color=auto, color codes are output only if standard output is connected\n\ to a terminal (tty). The environment variable LS_COLORS can influence the\n\ colors, and can be set easily by the dircolors command.")); puts (_("\ \n\ Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble.")); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/getopt.cc0000644000076600001440000007417011347173775013727 00000000000000/* * getopt entry points * * modified by Mike Borella * * $Id: getopt.cc,v 1.3 2010/03/14 14:51:17 mgeng Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef HAVE_GETOPT_LONG /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see .*/ #include "getopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } int getopt (int argc, char * const * argv, const char * optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifndef _NO_PROTO #define _NO_PROTO #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #if defined (WIN32) && !defined (__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #define getpid () GetCurrentProcessId () #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ extern char * getenv (const char *); static char * my_index (const char *str, int chr) { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; extern pid_t __libc_pid; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } text_set_element (__libc_subinit, store_args_and_env); # define SWAP_FLAGS (ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS (ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (&new_str[nonoption_flags_max_len], '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { memcpy (__getopt_nonoption_flags, orig_str, len); memset (&__getopt_nonoption_flags[len], '\0', nonoption_flags_max_len - len); } } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else { /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } #endif /* Not ELIDE_CODE. */ #endif genparse-0.9.1/examples/mycopy4.gp0000644000076600001440000000051510716376260014033 00000000000000/* mycopy4.gp */ #include "mycopy4.h" my_callback() i / iterations int 1 [1..MAX] "Number of times to output ." "do it like this" o / outfile string {""} outfile_cb () "Output file." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end genparse-0.9.1/examples/coreutils.h0000644000076600001440000000112010731300262014234 00000000000000#define _(msgid) msgid #define PACKAGE_BUGREPORT "bug-coreutils@gnu.org" static inline void emit_bug_reporting_address (void) { /* TRANSLATORS: The placeholder indicates the bug-reporting address for this package. Please add _another line_ saying "Report translation bugs to <...>\n" with the address for translation bugs (typically your translation team's web or email address). */ printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); } static inline char *quotearg (char *s) { static char rval[10]; sprintf (rval, "\"\\\"%s\\\"\"", s); return (rval); } genparse-0.9.1/examples/ls.c0000644000076600001440000000042210674673706012666 00000000000000/* ls.c */ #include #include #include "ls_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); if (a.help) usage (EXIT_SUCCESS, argv[0]); else printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/mycopy3.gp0000644000076600001440000000044510716376257014042 00000000000000/* mycopy3.gp */ i / iterations int 1 [0...] "Number of times to output ." "File should be text format!" o / outfile string {""} "Output file name." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end genparse-0.9.1/examples/wc_clp.h0000644000076600001440000000143610744370060013513 00000000000000/****************************************************************************** ** ** wc_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "coreutils.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool bytes; bool chars; bool lines; char * files0_from; bool max_line_length; bool words; bool help; bool version; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/mv_clp.c0000644000076600001440000001131211110011723013473 00000000000000/****************************************************************************** ** ** mv_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "mv_clp.h" static struct option const long_options[] = { {"backup", required_argument, NULL, 256}, {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, {"strip-trailing-slashes", no_argument, NULL, 257}, {"suffix", no_argument, NULL, 's'}, {"target-directory", no_argument, NULL, 258}, {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 259}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->backup = NULL; my_args->b = false; my_args->force = false; my_args->interactive = false; my_args->strip_trailing_slashes = false; my_args->suffix = false; my_args->target_directory = false; my_args->update = false; my_args->verbose = false; my_args->help = false; my_args->version = false; optind = 0; while ((c = getopt_long (argc, argv, "bfisuvh", long_options, &optind)) != - 1) { switch (c) { case 256: my_args->backup = optarg; break; case 'b': my_args->b = true; break; case 'f': my_args->force = true; break; case 'i': my_args->interactive = true; break; case 257: my_args->strip_trailing_slashes = true; break; case 's': my_args->suffix = true; break; case 258: my_args->target_directory = true; break; case 'u': my_args->update = true; break; case 'v': my_args->verbose = true; break; case 'h': my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 259: my_args->version = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]... SOURCE DEST\n\ or: %s [OPTION]... SOURCE... DIRECTORY\n\ or: %s [OPTION]... --target-directory=DIRECTORY SOURCE...\n\ Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\ \n\ --backup=CONTROL make a backup of each existing destination file\n\ -b like --backup but does not accept an argument\n\ -f, --force never prompt before overwriting\n\ -i, --interactive prompt before overwrite\n\ --strip-trailing-slashes remove any trailing slashes from each SOURCE\n\ argument\n\ -s, --suffix=SUFFIX override the usual backup suffix\n\ --target-directory move all SOURCE arguments into DIRECTORY\n\ -u, --update move only older or brand new non-directories\n\ -v, --verbose explain what is being done\n\ -h, --help display this help and exit\n\ --version output version information and exit\n\ \n\ The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\ The version control method may be selected via the --backup option or through\n\ the VERSION_CONTROL environment variable. Here are the values:\n\ \n\ none, off never make backups (even if --backup is given)\n\ numbered, t make numbered backups\n\ existing, nil numbered if numbered backups exist, simple otherwise\n\ simple, never always make simple backups\n"), program_name, program_name, program_name); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/tail.gp0000644000076600001440000000632510744370060013356 00000000000000#include "coreutils.h" #include "tail.h" NONE / retry flag "keep trying to open a file even if it is" "inaccessible when tail starts or if it becomes" "inaccessible later; useful when following by name," "i.e., with --follow=name" c / bytes=N string "output the last N bytes; alternatively, use +N to" "output bytes starting with the Nth of each file__NEW_PRINT__" f! / follow*[={name|descriptor}] string "" "output appended data as the file grows;" "-f, --follow, and --follow=descriptor are" "equivalent" F flag "same as --follow=name --retry__NEW_PRINT__" n / lines=N string "output the last N lines, instead of the last __INT__(DEFAULT_N_LINES);" "or use +N to output lines starting with the Nth" NONE / max-unchanged-stats=N uintmax 0 "" "with --follow=name, reopen a FILE which has not" "changed size after N (default __INT__(DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS)) iterations" "to see if it has been unlinked or renamed" "(this is the usual case of rotated log files)__NEW_PRINT__" __ERR_MSG__("%s: invalid maximum number of unchanged stats between opens") NONE / pid=PID ulong [..PID_T_MAX] 0 "with -f, terminate after process ID, PID dies" __ERR_MSG__("%s: invalid PID") q / quiet flag "never output headers giving file names" NONE / silent flag "same as --quiet" s / sleep-interval=S double [0..] 0 "with -f, sleep for approximately S seconds" "(default 1.0) between iterations." __ERR_MSG__("%s: invalid number of seconds") v / verbose flag "always output headers giving file names__NEW_PRINT__" #gp_include help_version.gp NONE / -presume-input-pipe flag "__DO_NOT_DOCUMENT__" 0 flag "__DO_NOT_DOCUMENT__" 1 flag "__DO_NOT_DOCUMENT__" 2 flag "__DO_NOT_DOCUMENT__" 3 flag "__DO_NOT_DOCUMENT__" 4 flag "__DO_NOT_DOCUMENT__" 5 flag "__DO_NOT_DOCUMENT__" 6 flag "__DO_NOT_DOCUMENT__" 7 flag "__DO_NOT_DOCUMENT__" 8 flag "__DO_NOT_DOCUMENT__" 9 flag "__DO_NOT_DOCUMENT__" #usage_begin Usage: __PROGRAM_NAME__ [OPTION]... [FILE]... Print the last __INT__(DEFAULT_N_LINES) lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input.__NEW_PRINT__ Mandatory arguments to long options are mandatory for short options too.__NEW_PRINT__ __GLOSSARY_GNU__(27) If the first character of N (the number of bytes or lines) is a `+', print beginning with the Nth item from the start of each file, otherwise, print the last N items in the file. N may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.__NEW_PRINT__ With --follow (-f), tail defaults to following the file descriptor, which means that even if a tail'ed file is renamed, tail will continue to track its end. This default behavior is not desirable when you really want to track the actual name of the file, not the file descriptor (e.g., log rotation). Use --follow=name in that case. That causes tail to track the named file by reopening it periodically to see if it has been removed and recreated by some other program. __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/echo.gp0000644000076600001440000000173610744370056013351 00000000000000#include "coreutils.h" n flag "do not output the trailing newline" e flag "enable interpretation of backslash escapes (default)" E flag "disable interpretation of backslash escapes" h / help flag "display this help and exit" v / version flag "output version information and exit" #usage_begin Usage: __PROGRAM_NAME__ [OPTION]... [STRING]... Echo the STRING(s) to standard output. __GLOSSARY_GNU__ If -e is in effect, the following sequences are recognized: \\0NNN the character whose ASCII code is NNN (octal) \\\\ backslash \\a alert (BEL) \\b backspace \\c suppress trailing newline \\f form feed \\n new line \\r carriage return \\t horizontal tab \\v vertical tab NOTE: your shell may have its own version of __PROGRAM_NAME__, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. __CODE__(emit_bug_reporting_address ();) #usage_end genparse-0.9.1/examples/ls.h0000644000076600001440000000032410674673706012674 00000000000000/* Exit statuses. */ enum { /* "ls" had a minor problem (e.g., it could not stat a directory entry). */ LS_MINOR_PROBLEM = 1, /* "ls" had more serious trouble. */ LS_FAILURE = 2 }; genparse-0.9.1/examples/mycopy2.c0000644000076600001440000000256110674673706013660 00000000000000/* mycopy2.c */ #include #include #include int main (int argc, char *argv[]) { int c, i; FILE *fp; extern char *optarg; extern int optind; int option_index = 0; char ch; int help, iterations; int errflg = 0; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"iterations", required_argument, NULL, 'i'}, {NULL, 0, NULL, 0} }; help = 0; iterations = 1; while ((ch = getopt_long (argc, argv, "hi:", long_options, &option_index)) != EOF) { switch (ch) { case 'h': help = 1; break; case 'i': iterations = atoi (optarg); if (iterations < 0) { fprintf (stderr, "error: iterations must be >= 0\n"); errflg ++; } break; default: errflg++; } } /* while */ if (errflg || help) { printf ("usage: %s [ -i ] \n", argv[0]); printf (" [ -h ] [ --help ] Print help screen \n"); printf (" [ -i ] [ --iterations ] Number of times to \ output \n"); exit (1); } if (optind >= argc) fp = stdin; else fp = fopen (argv[optind],"r"); for (i = 0; i < iterations; i++) { while ((c = fgetc (fp)) != EOF) fputc (c, stdout); rewind (fp); } fclose (fp); return 0; } genparse-0.9.1/examples/mycopy3_clp.h0000644000076600001440000000144511732675642014521 00000000000000/****************************************************************************** ** ** mycopy3_clp.h ** ** Thu Mar 22 20:21:06 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** Header file for command line parser ** ** Automatically created by genparse v0.9.0 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { int i; char * o; bool h; bool v; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/uname.c0000644000076600001440000000031210674673706013353 00000000000000/* uname.c */ #include #include "uname_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/mycopy4.h0000644000076600001440000000001707103372163013643 00000000000000#define MAX 10 genparse-0.9.1/examples/ping.h0000644000076600001440000000020110733451130013162 00000000000000/* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "bug-inetutils@gnu.org" genparse-0.9.1/examples/ping_clp.h0000644000076600001440000000201410744370056014035 00000000000000/****************************************************************************** ** ** ping_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include "ping.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool help; bool license; bool version; bool echo; bool address; bool timestamp; char * type; bool router; char * count; bool debug; double interval; bool interval_flag; bool numeric; bool ignore_routing; bool verbose; bool flood; unsigned long int preload; char * pattern; bool quiet; bool route; char * size; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/README0000644000076600001440000000155110733460270012752 00000000000000mycopy1: Simple application from the genparse info page. Doesn't use genparse. mycopy2: Extends mycopy1 with some command line options. Uses getopt_long() but still doesn't use genparse. mycopy3: Same as mycopy2 but command line parsing is now generated from genparse. mycopy4: Same as mycopy3 but in C++. mycopy5: Same as mycopy3 but in Java. echo: Demo version of the echo command from the GNU coreutils. ls: Demo version of the ls command from the GNU coreutils. mv: Demo version of the mv command from the GNU coreutils. rm: Demo version of the rm command from the GNU coreutils. tail: Demo version of the tail command from the GNU coreutils. uname: Demo version of the uname command from the GNU coreutils. wc: Demo version of the wc command from the GNU coreutils. ping: Demo version of the ping command from the GNU inetutils. genparse-0.9.1/examples/echo_clp.h0000644000076600001440000000133010744370056014016 00000000000000/****************************************************************************** ** ** echo_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "coreutils.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool n; bool e; bool E; bool help; bool version; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/rm.c0000644000076600001440000000033510674673706012671 00000000000000/* rm.c */ #include #include "rm_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); printf ("This is only a demo program. Nothing will be removed.\n"); return 0; } genparse-0.9.1/examples/mycopy5.gp0000644000076600001440000000046610716376260014041 00000000000000/* mycopy5.gp */ my_callback() i / iterations int 1 [1..10] "Number of times to output ." "do it like this" o / outfile string {""} outfile_cb() "Output file." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end genparse-0.9.1/examples/Makefile.am0000644000076600001440000000575011673365613014144 00000000000000noinst_PROGRAMS = mycopy1 mycopy2 mycopy3 mycopy4 rm echo uname mv ls tail wc ping GENPARSE = ../src/genparse GNU_GENPARSE_OPTS = --longmembers --internationalize --static-headers --gnulib AM_CPPFLAGS = -I$(srcdir)/../gnulib/lib AM_LDFLAGS = -L../gnulib/lib mycopy1_SOURCES = mycopy1.c mycopy2_SOURCES = mycopy2.c getopt.cc mycopy3_SOURCES = mycopy3_clp.c mycopy3_clp.h mycopy3.c mycopy3.gp getopt.cc mycopy3_clp.c mycopy3_clp.h: mycopy3.gp $(GENPARSE) -o mycopy3_clp mycopy3.gp mycopy4_SOURCES = mycopy4_clp.cc mycopy4_clp.h mycopy4_clp_cb.cc mycopy4.cc mycopy4.h mycopy4.gp \ getopt.cc mycopy4.o: mycopy4.cc $(CXXCOMPILE) -o mycopy4.o -c $(srcdir)/mycopy4.cc mycopy4_clp.o: mycopy4_clp.cc mycopy4_clp.h $(CXXCOMPILE) -o mycopy4_clp.o -c $(srcdir)/mycopy4_clp.cc mycopy4_clp.cc mycopy4_clp.h mycopy4_clp_cb.cc: mycopy4.gp $(GENPARSE) -l cpp -o mycopy4_clp mycopy4.gp .PHONY: mycopy5 mycopy5: classes/mycopy5.class java -classpath $(CLASSPATH):classes mycopy5 --help classes/mycopy5.class: classes/ \ CmdlineInterface.java \ CmdlineEx.java \ Cmdline.java \ mycopy5.java javac -d classes -classpath $(CLASSPATH) \ CmdlineInterface.java \ CmdlineEx.java \ Cmdline.java \ mycopy5.java CmdlineInterface.java Cmdline.java CmdlineEx.java: mycopy5.gp $(GENPARSE) -l java -o Cmdline mycopy5.gp EXTRA_DIST = mycopy5.gp classes/: mkdir -p $@ rm_SOURCES = rm_clp.c rm_clp.h rm.c rm.gp help_version.gp coreutils.h rm_clp.c rm_clp.h: rm.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o rm_clp rm.gp echo_SOURCES = echo_clp.c echo_clp.h echo.c echo.gp help_version.gp coreutils.h echo_clp.c echo_clp.h: echo.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o echo_clp echo.gp uname_SOURCES = uname_clp.c uname_clp.h uname.c uname.gp help_version.gp coreutils.h uname_clp.c uname_clp.h: uname.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o uname_clp uname.gp mv_SOURCES = mv_clp.c mv_clp.h mv.c mv.gp help_version.gp coreutils.h mv_clp.c mv_clp.h: mv.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o mv_clp mv.gp ls_SOURCES = ls_clp.c ls_clp.h ls.c ls.h ls.gp help_version.gp coreutils.h ls_LDADD = -lgnu ls_clp.c ls_clp.h: ls.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o ls_clp ls.gp wc_SOURCES = wc_clp.c wc_clp.h wc.c wc.gp help_version.gp coreutils.h wc_clp.c wc_clp.h: wc.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o wc_clp wc.gp tail_SOURCES = tail_clp.c tail_clp.h tail.c tail.h tail.gp help_version.gp coreutils.h tail_LDADD = -lgnu tail_clp.c tail_clp.h: tail.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o tail_clp tail.gp ping_SOURCES = ping_clp.c ping_clp.h ping.c ping.h ping.gp ping_LDADD = -lgnu ping_clp.c ping_clp.h: ping.gp $(GENPARSE) --longmembers --static-headers --gnulib -o ping_clp ping.gp CLEANFILES = *~ mycopy3_clp.h mycopy3_clp.c mycopy4_clp.h mycopy4_clp.cc mycopy4_clp_cb.cc \ CmdlineInterface.java Cmdline.java CmdlineEx.java rm_clp.h rm_clp.c echo_clp.h echo_clp.c \ uname_clp.h uname_clp.c mv_clp.h mv_clp.c ls_clp.h ls_clp.c wc_clp.h wc_clp.c \ tail_clp.h tail_clp.c ping_clp.h ping_clp.c clean-local: -rm -rf classes genparse-0.9.1/examples/echo.c0000644000076600001440000000031010674673700013154 00000000000000/* echo.c */ #include #include "echo_clp.h" int main (int argc, char *argv[]) { struct arg_t a; Cmdline (&a, argc, argv); printf ("This is only a demo program.\n"); return 0; } genparse-0.9.1/examples/wc_clp.c0000644000076600001440000000717711110011723013500 00000000000000/****************************************************************************** ** ** wc_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "wc_clp.h" static struct option const long_options[] = { {"bytes", no_argument, NULL, 'c'}, {"chars", no_argument, NULL, 'm'}, {"lines", no_argument, NULL, 'l'}, {"files0-from", required_argument, NULL, 256}, {"max-line-length", no_argument, NULL, 'L'}, {"words", no_argument, NULL, 'w'}, {"help", no_argument, NULL, 257}, {"version", no_argument, NULL, 258}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->bytes = false; my_args->chars = false; my_args->lines = false; my_args->files0_from = NULL; my_args->max_line_length = false; my_args->words = false; my_args->help = false; my_args->version = false; optind = 0; while ((c = getopt_long (argc, argv, "cmlLw", long_options, &optind)) != - 1) { switch (c) { case 'c': my_args->bytes = true; break; case 'm': my_args->chars = true; break; case 'l': my_args->lines = true; break; case 256: my_args->files0_from = optarg; break; case 'L': my_args->max_line_length = true; break; case 'w': my_args->words = true; break; case 257: my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 258: my_args->version = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Usage: %s [OPTION]... [FILE]...\n\ or: %s [OPTION]... --files0-from=F\n"), program_name, program_name); puts (_("\ Print newline, word, and byte counts for each FILE, and a total line if\n\ more than one FILE is specified. With no FILE, or when FILE is -,\n\ read standard input.\n\ -c, --bytes print the byte counts\n\ -m, --chars print the character counts\n\ -l, --lines print the newline counts")); puts (_("\ --files0-from=F read input from the files specified by\n\ NUL-terminated names in file F\n\ -L, --max-line-length print the length of the longest line\n\ -w, --words print the word counts")); puts (_("\ --help display this help and exit")); puts (_("\ --version output version information and exit")); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/mycopy4_clp.h0000644000076600001440000000260311732675642014517 00000000000000/****************************************************************************** ** ** mycopy4_clp.h ** ** Thu Mar 22 20:21:06 2012 ** Linux 2.6.36 (#6 Sun Jun 5 09:23:00 CEST 2011) i686 ** linux@mgpc (Michael Geng) ** ** Header file for command line parser class ** ** Automatically created by genparse v0.9.0 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #ifndef CMDLINE_H #define CMDLINE_H #include #include #include "mycopy4.h" /*---------------------------------------------------------------------------- ** ** class Cmdline ** ** command line parser class ** **--------------------------------------------------------------------------*/ class Cmdline { private: /* parameters */ int _i; std::string _o; bool _h; bool _v; /* other stuff to keep track of */ std::string _program_name; int _optind; public: /* constructor and destructor */ Cmdline (int, char **) throw (std::string); ~Cmdline (){} /* usage function */ void usage (int status); /* return next (non-option) parameter */ int next_param () { return _optind; } /* callback functions */ bool my_callback (); bool outfile_cb (); int i () const { return _i; } std::string o () const { return _o; } bool h () const { return _h; } bool v () const { return _v; } }; #endif genparse-0.9.1/examples/ls_clp.h0000644000076600001440000000327710744370056013532 00000000000000/****************************************************************************** ** ** ls_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "coreutils.h" #include "ls.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool all; bool almost_all; bool author; bool escape; char * block_size; int block_size_li; bool ignore_backups; bool c; bool C; char * color; bool color_flag; bool directory; bool dired; bool f; bool classify; bool file_type; char * format; bool full_time; bool g; bool group_directories_first; bool no_group; bool human_readable; bool si; bool dereference_command_line; bool dereference_command_line_symlink_to_dir; char * hide; char * indicator_style; bool inode; char * ignore; bool k; bool kilobytes; bool l; bool dereference; bool m; bool numeric_uid_gid; bool literal; bool o; bool p; bool hide_control_chars; bool show_control_chars; bool quote_name; char * quoting_style; bool reverse; bool recursive; bool size; bool S; char * sort; char * time; char * time_style; bool t; unsigned long int tabsize; bool u; bool U; bool v; unsigned long int width; bool x; bool X; bool context; bool _1; bool help; bool version; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/ping.gp0000644000076600001440000000310110733746160013355 00000000000000#include #include "ping.h" h / help flag " display this help and exit" L / license flag " display license and exit" V / version flag " output version information and exit" "Options controlling ICMP request types:" NONE / echo flag " Send ICMP_ECHO requests (default)" NONE / address flag "* Send ICMP_ADDRESS packets" NONE / timestamp flag " Send ICMP_TIMESTAMP packets" t / type string " Send TYPE packets" NONE / router flag "* Send ICMP_ROUTERDISCOVERY packets" "Options valid for all request types:" c / count=N string " stop after sending N packets" d / debug flag " set the SO_DEBUG option" i / interval=N double " wait N seconds between sending each packet" __ERR_MSG__("Invalid value (`%s')") __ADD_FLAG__ n / numeric flag " do not resolve host addresses" r / ignore-routing flag " send directly to a host on an attached network" v / verbose flag " verbose output" "Options valid for --echo requests:" f / flood flag "* flood ping" l / preload=N ulong [1..INT_MAX] 0 "* send N packets as fast as possible before falling into" " normal mode of behavior" __ERR_MSG__("ping: invalid preload value (%s)") p / pattern=PAT string " fill ICMP packet with given pattern (hex)" q / quiet flag " quiet output" R / route flag " record route" s / size=N string " set number of data octets to send" #usage_begin Usage: ping [OPTION]... [ADDRESS]... Informational options: __GLOSSARY_GNU__(19) Options marked with an * are available only to super-user Report bugs to <__STRING__(PACKAGE_BUGREPORT)>. #usage_end genparse-0.9.1/examples/uname_clp.h0000644000076600001440000000147410744370060014211 00000000000000/****************************************************************************** ** ** uname_clp.h ** ** Header file for command line parser ** ** Automatically created by genparse v0.7.6 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include "coreutils.h" #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { bool all; bool kernel_name; bool nodename; bool kernel_version; bool kernel_release; bool machine; bool processor; bool version; bool help; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); genparse-0.9.1/examples/mycopy4.cc0000644000076600001440000000175710674673706014033 00000000000000/* mycopy4.cc */ #include #include #include #include "mycopy4_clp.h" using namespace std; #define VERSION "3.0" int main (int argc, char *argv[]) { int i; char c; ifstream input_file; ofstream output_file; bool ofile = false, ifile = false; Cmdline cl (argc, argv); if (cl.v ()) { cout << argv[0] << " version " << VERSION << endl; exit (0); } if (!cl.o ().empty ()) { output_file.open (cl.o ().c_str ()); ofile = true; } if (cl.next_param ()) { input_file.open (argv[cl.next_param ()]); ifile = true; } for (i = 0; i < cl.i (); i++) { if (ifile) c = input_file.get (); else cin >> c; while (c != EOF) { if (ofile) output_file.put (c); else cout << c; if (ifile) c = input_file.get (); else cin >> c; } if (ifile) { input_file.clear (); input_file.seekg (0); } } input_file.close (); output_file.close (); return 0; } genparse-0.9.1/examples/rm_clp.c0000644000076600001440000000705411110011723013477 00000000000000/****************************************************************************** ** ** rm_clp.c ** ** C file for command line parser ** ** Automatically created by genparse v0.8.1 ** ** See http://genparse.sourceforge.net for details and updates ** ******************************************************************************/ #include #include #include #include "rm_clp.h" static struct option const long_options[] = { {"directory", no_argument, NULL, 'd'}, {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, {"recursive", no_argument, NULL, 'r'}, {"verbose", no_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 256}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->directory = false; my_args->force = false; my_args->interactive = false; my_args->recursive = false; my_args->verbose = false; my_args->help = false; my_args->version = false; optind = 0; while ((c = getopt_long (argc, argv, "dfirRvh", long_options, &optind)) != - 1) { switch (c) { case 'd': my_args->directory = true; break; case 'f': my_args->force = true; break; case 'i': my_args->interactive = true; break; case 'r': case 'R': my_args->recursive = true; break; case 'v': my_args->verbose = true; break; case 'h': my_args->help = true; usage (EXIT_SUCCESS, argv[0]); break; case 256: my_args->version = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else { printf (_("\ Remove (unlink) the FILE(s).\n\ \n\ Usage: %s [OPTION]... FILE...\n\ -d, --directory unlink directory, even if non-empty (super-user only)\n\ -f, --force ignore nonexistant files, never prompt\n\ -i, --interactive prompt before any removal\n\ -r -R, --recursive remove the contents of directories recursively\n\ -v, --verbose explain what is being done\n\ -h, --help print this help and exit\n\ --version print version information and exit\n\ \n\ To remove a file whose name starts with a `-', for example `-foo',\n\ use one of these commands:\n\ %s -- -foo\n\ \n\ %s ./-foo\n\ \n\ Note that if you use rm to remove a file, it is usually possible to recover\n\ the contents of that file. If you want more assurance that the contents are\n\ truly unrecoverable, consider using shred.\n"), program_name, program_name, program_name); emit_bug_reporting_address (); } exit (status); } genparse-0.9.1/examples/Makefile.in0000644000076600001440000007260711732677151014161 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = mycopy1$(EXEEXT) mycopy2$(EXEEXT) mycopy3$(EXEEXT) \ mycopy4$(EXEEXT) rm$(EXEEXT) echo$(EXEEXT) uname$(EXEEXT) \ mv$(EXEEXT) ls$(EXEEXT) tail$(EXEEXT) wc$(EXEEXT) \ ping$(EXEEXT) subdir = examples DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_echo_OBJECTS = echo_clp.$(OBJEXT) echo.$(OBJEXT) echo_OBJECTS = $(am_echo_OBJECTS) echo_LDADD = $(LDADD) am_ls_OBJECTS = ls_clp.$(OBJEXT) ls.$(OBJEXT) ls_OBJECTS = $(am_ls_OBJECTS) ls_DEPENDENCIES = am_mv_OBJECTS = mv_clp.$(OBJEXT) mv.$(OBJEXT) mv_OBJECTS = $(am_mv_OBJECTS) mv_LDADD = $(LDADD) am_mycopy1_OBJECTS = mycopy1.$(OBJEXT) mycopy1_OBJECTS = $(am_mycopy1_OBJECTS) mycopy1_LDADD = $(LDADD) am_mycopy2_OBJECTS = mycopy2.$(OBJEXT) getopt.$(OBJEXT) mycopy2_OBJECTS = $(am_mycopy2_OBJECTS) mycopy2_LDADD = $(LDADD) am_mycopy3_OBJECTS = mycopy3_clp.$(OBJEXT) mycopy3.$(OBJEXT) \ getopt.$(OBJEXT) mycopy3_OBJECTS = $(am_mycopy3_OBJECTS) mycopy3_LDADD = $(LDADD) am_mycopy4_OBJECTS = mycopy4_clp.$(OBJEXT) mycopy4_clp_cb.$(OBJEXT) \ mycopy4.$(OBJEXT) getopt.$(OBJEXT) mycopy4_OBJECTS = $(am_mycopy4_OBJECTS) mycopy4_LDADD = $(LDADD) am_ping_OBJECTS = ping_clp.$(OBJEXT) ping.$(OBJEXT) ping_OBJECTS = $(am_ping_OBJECTS) ping_DEPENDENCIES = am_rm_OBJECTS = rm_clp.$(OBJEXT) rm.$(OBJEXT) rm_OBJECTS = $(am_rm_OBJECTS) rm_LDADD = $(LDADD) am_tail_OBJECTS = tail_clp.$(OBJEXT) tail.$(OBJEXT) tail_OBJECTS = $(am_tail_OBJECTS) tail_DEPENDENCIES = am_uname_OBJECTS = uname_clp.$(OBJEXT) uname.$(OBJEXT) uname_OBJECTS = $(am_uname_OBJECTS) uname_LDADD = $(LDADD) am_wc_OBJECTS = wc_clp.$(OBJEXT) wc.$(OBJEXT) wc_OBJECTS = $(am_wc_OBJECTS) wc_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(echo_SOURCES) $(ls_SOURCES) $(mv_SOURCES) \ $(mycopy1_SOURCES) $(mycopy2_SOURCES) $(mycopy3_SOURCES) \ $(mycopy4_SOURCES) $(ping_SOURCES) $(rm_SOURCES) \ $(tail_SOURCES) $(uname_SOURCES) $(wc_SOURCES) DIST_SOURCES = $(echo_SOURCES) $(ls_SOURCES) $(mv_SOURCES) \ $(mycopy1_SOURCES) $(mycopy2_SOURCES) $(mycopy3_SOURCES) \ $(mycopy4_SOURCES) $(ping_SOURCES) $(rm_SOURCES) \ $(tail_SOURCES) $(uname_SOURCES) $(wc_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ GENPARSE = ../src/genparse GNU_GENPARSE_OPTS = --longmembers --internationalize --static-headers --gnulib AM_CPPFLAGS = -I$(srcdir)/../gnulib/lib AM_LDFLAGS = -L../gnulib/lib mycopy1_SOURCES = mycopy1.c mycopy2_SOURCES = mycopy2.c getopt.cc mycopy3_SOURCES = mycopy3_clp.c mycopy3_clp.h mycopy3.c mycopy3.gp getopt.cc mycopy4_SOURCES = mycopy4_clp.cc mycopy4_clp.h mycopy4_clp_cb.cc mycopy4.cc mycopy4.h mycopy4.gp \ getopt.cc EXTRA_DIST = mycopy5.gp rm_SOURCES = rm_clp.c rm_clp.h rm.c rm.gp help_version.gp coreutils.h echo_SOURCES = echo_clp.c echo_clp.h echo.c echo.gp help_version.gp coreutils.h uname_SOURCES = uname_clp.c uname_clp.h uname.c uname.gp help_version.gp coreutils.h mv_SOURCES = mv_clp.c mv_clp.h mv.c mv.gp help_version.gp coreutils.h ls_SOURCES = ls_clp.c ls_clp.h ls.c ls.h ls.gp help_version.gp coreutils.h ls_LDADD = -lgnu wc_SOURCES = wc_clp.c wc_clp.h wc.c wc.gp help_version.gp coreutils.h tail_SOURCES = tail_clp.c tail_clp.h tail.c tail.h tail.gp help_version.gp coreutils.h tail_LDADD = -lgnu ping_SOURCES = ping_clp.c ping_clp.h ping.c ping.h ping.gp ping_LDADD = -lgnu CLEANFILES = *~ mycopy3_clp.h mycopy3_clp.c mycopy4_clp.h mycopy4_clp.cc mycopy4_clp_cb.cc \ CmdlineInterface.java Cmdline.java CmdlineEx.java rm_clp.h rm_clp.c echo_clp.h echo_clp.c \ uname_clp.h uname_clp.c mv_clp.h mv_clp.c ls_clp.h ls_clp.c wc_clp.h wc_clp.c \ tail_clp.h tail_clp.c ping_clp.h ping_clp.c all: all-am .SUFFIXES: .SUFFIXES: .c .cc .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) echo$(EXEEXT): $(echo_OBJECTS) $(echo_DEPENDENCIES) @rm -f echo$(EXEEXT) $(LINK) $(echo_OBJECTS) $(echo_LDADD) $(LIBS) ls$(EXEEXT): $(ls_OBJECTS) $(ls_DEPENDENCIES) @rm -f ls$(EXEEXT) $(LINK) $(ls_OBJECTS) $(ls_LDADD) $(LIBS) mv$(EXEEXT): $(mv_OBJECTS) $(mv_DEPENDENCIES) @rm -f mv$(EXEEXT) $(LINK) $(mv_OBJECTS) $(mv_LDADD) $(LIBS) mycopy1$(EXEEXT): $(mycopy1_OBJECTS) $(mycopy1_DEPENDENCIES) @rm -f mycopy1$(EXEEXT) $(LINK) $(mycopy1_OBJECTS) $(mycopy1_LDADD) $(LIBS) mycopy2$(EXEEXT): $(mycopy2_OBJECTS) $(mycopy2_DEPENDENCIES) @rm -f mycopy2$(EXEEXT) $(CXXLINK) $(mycopy2_OBJECTS) $(mycopy2_LDADD) $(LIBS) mycopy3$(EXEEXT): $(mycopy3_OBJECTS) $(mycopy3_DEPENDENCIES) @rm -f mycopy3$(EXEEXT) $(CXXLINK) $(mycopy3_OBJECTS) $(mycopy3_LDADD) $(LIBS) mycopy4$(EXEEXT): $(mycopy4_OBJECTS) $(mycopy4_DEPENDENCIES) @rm -f mycopy4$(EXEEXT) $(CXXLINK) $(mycopy4_OBJECTS) $(mycopy4_LDADD) $(LIBS) ping$(EXEEXT): $(ping_OBJECTS) $(ping_DEPENDENCIES) @rm -f ping$(EXEEXT) $(LINK) $(ping_OBJECTS) $(ping_LDADD) $(LIBS) rm$(EXEEXT): $(rm_OBJECTS) $(rm_DEPENDENCIES) @rm -f rm$(EXEEXT) $(LINK) $(rm_OBJECTS) $(rm_LDADD) $(LIBS) tail$(EXEEXT): $(tail_OBJECTS) $(tail_DEPENDENCIES) @rm -f tail$(EXEEXT) $(LINK) $(tail_OBJECTS) $(tail_LDADD) $(LIBS) uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) @rm -f uname$(EXEEXT) $(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) wc$(EXEEXT): $(wc_OBJECTS) $(wc_DEPENDENCIES) @rm -f wc$(EXEEXT) $(LINK) $(wc_OBJECTS) $(wc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ls_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy3_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy4_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mycopy4_clp_cb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ping_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rm_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname_clp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wc_clp.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-local clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am mycopy3_clp.c mycopy3_clp.h: mycopy3.gp $(GENPARSE) -o mycopy3_clp mycopy3.gp mycopy4.o: mycopy4.cc $(CXXCOMPILE) -o mycopy4.o -c $(srcdir)/mycopy4.cc mycopy4_clp.o: mycopy4_clp.cc mycopy4_clp.h $(CXXCOMPILE) -o mycopy4_clp.o -c $(srcdir)/mycopy4_clp.cc mycopy4_clp.cc mycopy4_clp.h mycopy4_clp_cb.cc: mycopy4.gp $(GENPARSE) -l cpp -o mycopy4_clp mycopy4.gp .PHONY: mycopy5 mycopy5: classes/mycopy5.class java -classpath $(CLASSPATH):classes mycopy5 --help classes/mycopy5.class: classes/ \ CmdlineInterface.java \ CmdlineEx.java \ Cmdline.java \ mycopy5.java javac -d classes -classpath $(CLASSPATH) \ CmdlineInterface.java \ CmdlineEx.java \ Cmdline.java \ mycopy5.java CmdlineInterface.java Cmdline.java CmdlineEx.java: mycopy5.gp $(GENPARSE) -l java -o Cmdline mycopy5.gp classes/: mkdir -p $@ rm_clp.c rm_clp.h: rm.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o rm_clp rm.gp echo_clp.c echo_clp.h: echo.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o echo_clp echo.gp uname_clp.c uname_clp.h: uname.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o uname_clp uname.gp mv_clp.c mv_clp.h: mv.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o mv_clp mv.gp ls_clp.c ls_clp.h: ls.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o ls_clp ls.gp wc_clp.c wc_clp.h: wc.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o wc_clp wc.gp tail_clp.c tail_clp.h: tail.gp $(GENPARSE) $(GNU_GENPARSE_OPTS) -o tail_clp tail.gp ping_clp.c ping_clp.h: ping.gp $(GENPARSE) --longmembers --static-headers --gnulib -o ping_clp ping.gp clean-local: -rm -rf classes # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/missing0000755000076600001440000002546611341041447011663 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: genparse-0.9.1/NEWS0000644000076600001440000000007607175662025010764 000000000000002000-10-25 Gneparse should now compile and run under Cygwin. genparse-0.9.1/configure0000755000076600001440000120743011732677154012203 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="src/genparse.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gl_header_list= ac_subst_vars='gltests_LTLIBOBJS gltests_LIBOBJS gl_LTLIBOBJS gl_LIBOBJS LTLIBOBJS LIBOBJS HAVE_MAN2HTML_FALSE HAVE_MAN2HTML_TRUE MAN2HTML HAVE_TEXI2PDF_FALSE HAVE_TEXI2PDF_TRUE TEXI2PDF HAVE_TEXI2HTML_FALSE HAVE_TEXI2HTML_TRUE TEXI2HTML DOXYGEN_SRC_DIRECTORY HAVE_DOXYGEN_FALSE HAVE_DOXYGEN_TRUE DOT DOXYGEN HAVE_JUNIT_FALSE HAVE_JUNIT_TRUE TESTS_JUNIT JAVA_JUNIT JUNIT HAVE_CPPUNIT_FALSE HAVE_CPPUNIT_TRUE CPPUNIT_LIBS CPPUNIT_CFLAGS CPPUNIT_CONFIG HAVE_CUNIT_FALSE HAVE_CUNIT_TRUE HAVE_GETOPT_JAVA_FALSE HAVE_GETOPT_JAVA_TRUE HAVE_GETOPT_JAVA JAVAC uudecode JAVA CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX HAVE_JAVAC_FALSE HAVE_JAVAC_TRUE HAVE_JAVAC HAVE_JAVA_FALSE HAVE_JAVA_TRUE HAVE_JAVA LEXLIB LEX_OUTPUT_ROOT LEX YFLAGS YACC LIBGNU_LTLIBDEPS LIBGNU_LIBDEPS NEXT_WCHAR_H HAVE_WCHAR_H HAVE_WINT_T WCHAR_H REPLACE_WCWIDTH HAVE_DECL_WCWIDTH GNULIB_WCWIDTH HAVE_UNISTD_H NEXT_UNISTD_H UNISTD_H_HAVE_WINSOCK2_H REPLACE_WRITE REPLACE_LSEEK REPLACE_LCHOWN REPLACE_GETPAGESIZE REPLACE_GETCWD REPLACE_FCHDIR REPLACE_CLOSE REPLACE_CHOWN HAVE_SYS_PARAM_H HAVE_OS_H HAVE_DECL_GETLOGIN_R HAVE_DECL_ENVIRON HAVE_SLEEP HAVE_READLINK HAVE_GETUSERSHELL HAVE_GETPAGESIZE HAVE_GETHOSTNAME HAVE_GETDTABLESIZE HAVE_GETDOMAINNAME HAVE_FTRUNCATE HAVE_FSYNC HAVE_EUIDACCESS HAVE_DUP2 GNULIB_WRITE GNULIB_UNISTD_H_SIGPIPE GNULIB_SLEEP GNULIB_READLINK GNULIB_LSEEK GNULIB_LCHOWN GNULIB_GETUSERSHELL GNULIB_GETPAGESIZE GNULIB_GETLOGIN_R GNULIB_GETHOSTNAME GNULIB_GETDTABLESIZE GNULIB_GETDOMAINNAME GNULIB_GETCWD GNULIB_FTRUNCATE GNULIB_FSYNC GNULIB_FCHDIR GNULIB_EUIDACCESS GNULIB_ENVIRON GNULIB_DUP2 GNULIB_CLOSE GNULIB_CHOWN NEXT_STRING_H REPLACE_STRSIGNAL REPLACE_STRERROR REPLACE_STRCASESTR REPLACE_STRSTR REPLACE_STRDUP REPLACE_MEMMEM HAVE_STRVERSCMP HAVE_DECL_STRSIGNAL HAVE_DECL_STRERROR HAVE_DECL_STRTOK_R HAVE_STRCASESTR HAVE_STRSEP HAVE_STRPBRK HAVE_DECL_STRNLEN HAVE_DECL_STRNDUP HAVE_STRNDUP HAVE_DECL_STRDUP HAVE_STRCHRNUL HAVE_STPNCPY HAVE_STPCPY HAVE_RAWMEMCHR HAVE_DECL_MEMRCHR HAVE_MEMPCPY HAVE_DECL_MEMMEM GNULIB_STRVERSCMP GNULIB_STRSIGNAL GNULIB_STRERROR GNULIB_MBSTOK_R GNULIB_MBSSEP GNULIB_MBSSPN GNULIB_MBSPBRK GNULIB_MBSCSPN GNULIB_MBSCASESTR GNULIB_MBSPCASECMP GNULIB_MBSNCASECMP GNULIB_MBSCASECMP GNULIB_MBSSTR GNULIB_MBSRCHR GNULIB_MBSCHR GNULIB_MBSNLEN GNULIB_MBSLEN GNULIB_STRTOK_R GNULIB_STRCASESTR GNULIB_STRSTR GNULIB_STRSEP GNULIB_STRPBRK GNULIB_STRNLEN GNULIB_STRNDUP GNULIB_STRDUP GNULIB_STRCHRNUL GNULIB_STPNCPY GNULIB_STPCPY GNULIB_RAWMEMCHR GNULIB_MEMRCHR GNULIB_MEMPCPY GNULIB_MEMMEM NEXT_STDLIB_H VOID_UNSETENV REPLACE_STRTOD REPLACE_PUTENV REPLACE_MKSTEMP HAVE_DECL_GETLOADAVG HAVE_UNSETENV HAVE_SYS_LOADAVG_H HAVE_STRUCT_RANDOM_DATA HAVE_STRTOULL HAVE_STRTOLL HAVE_STRTOD HAVE_SETENV HAVE_RPMATCH HAVE_RANDOM_R HAVE_REALLOC_POSIX HAVE_MKDTEMP HAVE_MALLOC_POSIX HAVE_GETSUBOPT HAVE_CALLOC_POSIX HAVE_ATOLL GNULIB_UNSETENV GNULIB_STRTOULL GNULIB_STRTOLL GNULIB_STRTOD GNULIB_SETENV GNULIB_RPMATCH GNULIB_RANDOM_R GNULIB_PUTENV GNULIB_MKSTEMP GNULIB_MKDTEMP GNULIB_GETSUBOPT GNULIB_GETLOADAVG GNULIB_ATOLL GNULIB_CALLOC_POSIX GNULIB_REALLOC_POSIX GNULIB_MALLOC_POSIX HAVE__BOOL STDBOOL_H INTTYPES_H UINT64_MAX_EQ_ULONG_MAX UINT32_MAX_LT_UINTMAX_MAX INT64_MAX_EQ_LONG_MAX INT32_MAX_LT_INTMAX_MAX PRIPTR_PREFIX NEXT_INTTYPES_H HAVE_DECL_STRTOUMAX HAVE_DECL_STRTOIMAX HAVE_DECL_IMAXDIV HAVE_DECL_IMAXABS GNULIB_STRTOUMAX GNULIB_STRTOIMAX GNULIB_IMAXDIV GNULIB_IMAXABS PRI_MACROS_BROKEN STDINT_H WINT_T_SUFFIX WCHAR_T_SUFFIX SIZE_T_SUFFIX SIG_ATOMIC_T_SUFFIX PTRDIFF_T_SUFFIX HAVE_SIGNED_WINT_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_SIG_ATOMIC_T BITSIZEOF_WINT_T BITSIZEOF_WCHAR_T BITSIZEOF_SIZE_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_PTRDIFF_T HAVE_SYS_BITYPES_H HAVE_SYS_INTTYPES_H HAVE_STDINT_H NEXT_STDINT_H HAVE_SYS_TYPES_H HAVE_INTTYPES_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_LONG_LONG_INT LTLIBINTL LIBINTL GETOPT_H EOVERFLOW_VALUE EOVERFLOW_HIDDEN ENOLINK_VALUE ENOLINK_HIDDEN EMULTIHOP_VALUE EMULTIHOP_HIDDEN ERRNO_H NEXT_ERRNO_H host_os host_vendor host_cpu host build_os build_vendor build_cpu build PRAGMA_SYSTEM_HEADER INCLUDE_NEXT GL_COND_LIBTOOL_FALSE GL_COND_LIBTOOL_TRUE EGREP GREP CPP RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_cppunit_prefix with_cppunit_exec_prefix ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP YACC YFLAGS CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional) --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gl_header_list="$gl_header_list errno.h" gl_header_list="$gl_header_list stdint.h" gl_header_list="$gl_header_list wchar.h" gl_header_list="$gl_header_list inttypes.h" gl_header_list="$gl_header_list stdlib.h" gl_header_list="$gl_header_list sys/socket.h" gl_header_list="$gl_header_list string.h" gl_header_list="$gl_header_list unistd.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.10a' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=genparse VERSION=0.9.1 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h:config.in" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } if ${gl_cv_have_include_next+:} false; then : $as_echo_n "(cached) " >&6 else rm -rf conftestd1 conftestd2 mkdir conftestd1 conftestd2 cat < conftestd1/conftest.h #define DEFINED_IN_CONFTESTD1 #include #include_next #ifdef DEFINED_IN_CONFTESTD2 int foo; #else #error "include_next doesn't work" #endif EOF cat < conftestd2/conftest.h #ifndef DEFINED_IN_CONFTESTD1 #error "include_next test doesn't work" #endif #define DEFINED_IN_CONFTESTD2 EOF save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_have_include_next=yes else gl_cv_have_include_next=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" rm -rf conftestd1 conftestd2 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 $as_echo "$gl_cv_have_include_next" >&6; } PRAGMA_SYSTEM_HEADER= if test $gl_cv_have_include_next = yes; then INCLUDE_NEXT=include_next if test -n "$GCC"; then PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' fi else INCLUDE_NEXT=include fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac for ac_header in $gl_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 $as_echo_n "checking for complete errno.h... " >&6; } if ${gl_cv_header_errno_h_complete+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if !defined ENOMSG booboo #endif #if !defined EIDRM booboo #endif #if !defined ENOLINK booboo #endif #if !defined EPROTO booboo #endif #if !defined EMULTIHOP booboo #endif #if !defined EBADMSG booboo #endif #if !defined EOVERFLOW booboo #endif #if !defined ENOTSUP booboo #endif #if !defined ECANCELED booboo #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "booboo" >/dev/null 2>&1; then : gl_cv_header_errno_h_complete=no else gl_cv_header_errno_h_complete=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 $as_echo "$gl_cv_header_errno_h_complete" >&6; } if test $gl_cv_header_errno_h_complete = yes; then ERRNO_H='' else : if test $gl_cv_have_include_next = yes; then gl_cv_next_errno_h='<'errno.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_errno_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_errno_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/errno.h#{ s#.*"\(.*/errno.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_errno_h='<'errno.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 $as_echo "$gl_cv_next_errno_h" >&6; } fi NEXT_ERRNO_H=$gl_cv_next_errno_h ERRNO_H='errno.h' fi if test -n "$ERRNO_H"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 $as_echo_n "checking for EMULTIHOP value... " >&6; } if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef EMULTIHOP yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : gl_cv_header_errno_h_EMULTIHOP=yes else gl_cv_header_errno_h_EMULTIHOP=no fi rm -f conftest* if test $gl_cv_header_errno_h_EMULTIHOP = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef EMULTIHOP yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : gl_cv_header_errno_h_EMULTIHOP=hidden fi rm -f conftest* if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include "; then : fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 $as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } case $gl_cv_header_errno_h_EMULTIHOP in yes | no) EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= ;; *) EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" ;; esac fi if test -n "$ERRNO_H"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 $as_echo_n "checking for ENOLINK value... " >&6; } if ${gl_cv_header_errno_h_ENOLINK+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef ENOLINK yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : gl_cv_header_errno_h_ENOLINK=yes else gl_cv_header_errno_h_ENOLINK=no fi rm -f conftest* if test $gl_cv_header_errno_h_ENOLINK = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef ENOLINK yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : gl_cv_header_errno_h_ENOLINK=hidden fi rm -f conftest* if test $gl_cv_header_errno_h_ENOLINK = hidden; then if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include "; then : fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 $as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } case $gl_cv_header_errno_h_ENOLINK in yes | no) ENOLINK_HIDDEN=0; ENOLINK_VALUE= ;; *) ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" ;; esac fi if test -n "$ERRNO_H"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 $as_echo_n "checking for EOVERFLOW value... " >&6; } if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef EOVERFLOW yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : gl_cv_header_errno_h_EOVERFLOW=yes else gl_cv_header_errno_h_EOVERFLOW=no fi rm -f conftest* if test $gl_cv_header_errno_h_EOVERFLOW = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef EOVERFLOW yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : gl_cv_header_errno_h_EOVERFLOW=hidden fi rm -f conftest* if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include "; then : fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } case $gl_cv_header_errno_h_EOVERFLOW in yes | no) EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= ;; *) EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" ;; esac fi ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF for ac_func in strerror_r do : ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" if test "x$ac_cv_func_strerror_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi XGETTEXT_EXTRA_OPTIONS= if test -z "$GETOPT_H"; then for ac_header in getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_H 1 _ACEOF else GETOPT_H=getopt.h fi done fi if test -z "$GETOPT_H"; then for ac_func in getopt_long_only do : ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" if test "x$ac_cv_func_getopt_long_only" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG_ONLY 1 _ACEOF else GETOPT_H=getopt.h fi done fi if test -z "$GETOPT_H"; then ac_fn_c_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include " if test "x$ac_cv_have_decl_optreset" = xyes; then : GETOPT_H=getopt.h fi fi if test -z "$GETOPT_H"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5 $as_echo_n "checking for working GNU getopt function... " >&6; } if ${gl_cv_func_gnu_getopt+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_fn_c_check_decl "$LINENO" "getopt_clip" "ac_cv_have_decl_getopt_clip" "#include " if test "x$ac_cv_have_decl_getopt_clip" = xyes; then : gl_cv_func_gnu_getopt=no else gl_cv_func_gnu_getopt=yes fi else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *myargv[3]; myargv[0] = "conftest"; myargv[1] = "-+"; myargv[2] = 0; return getopt (2, myargv, "+a") != '?'; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_gnu_getopt=yes else gl_cv_func_gnu_getopt=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gnu_getopt" >&5 $as_echo "$gl_cv_func_gnu_getopt" >&6; } if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default" if test "x$ac_cv_have_decl_getenv" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV $ac_have_decl _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 $as_echo_n "checking for long long int... " >&6; } if ${ac_cv_type_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if test "$cross_compiling" = yes; then : ac_cv_type_long_long_int=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX # define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif int main () { long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_type_long_long_int=yes else ac_cv_type_long_long_int=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else ac_cv_type_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 $as_echo "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } if ${ac_cv_type_unsigned_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_type_unsigned_long_long_int=yes else ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else HAVE_LONG_LONG_INT=0 fi if test $ac_cv_type_unsigned_long_long_int = yes; then HAVE_UNSIGNED_LONG_LONG_INT=1 else HAVE_UNSIGNED_LONG_LONG_INT=0 fi if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi : if test $gl_cv_have_include_next = yes; then gl_cv_next_stdint_h='<'stdint.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_stdint_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_stdint_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdint.h#{ s#.*"\(.*/stdint.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_stdint_h='<'stdint.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 $as_echo "$gl_cv_next_stdint_h" >&6; } fi NEXT_STDINT_H=$gl_cv_next_stdint_h if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else HAVE_STDINT_H=0 fi if test $ac_cv_header_stdint_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } if ${gl_cv_header_working_stdint_h+:} false; then : $as_echo_n "(cached) " >&6 else gl_cv_header_working_stdint_h=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) #error "WCHAR_MIN, WCHAR_MAX not defined in " #endif /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) #define TYPE_MAXIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) struct s { int check_PTRDIFF: PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) ? 1 : -1; /* Detect bug in FreeBSD 6.0 / ia64. */ int check_SIG_ATOMIC: SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) ? 1 : -1; int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; int check_WCHAR: WCHAR_MIN == TYPE_MINIMUM (wchar_t) && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) ? 1 : -1; /* Detect bug in mingw. */ int check_WINT: WINT_MIN == TYPE_MINIMUM (wint_t) && WINT_MAX == TYPE_MAXIMUM (wint_t) ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_working_stdint_h=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= else for ac_header in sys/inttypes.h sys/bitypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 else HAVE_SYS_INTTYPES_H=0 fi if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 else HAVE_SYS_BITYPES_H=0 fi : for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 $as_echo_n "checking for bit size of $gltype... " >&6; } if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif #include "; then : else result=unknown fi eval gl_cv_bitsizeof_${gltype}=\$result fi eval ac_res=\$gl_cv_bitsizeof_${gltype} { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` cat >>confdefs.h <<_ACEOF #define BITSIZEOF_${GLTYPE} $result _ACEOF eval BITSIZEOF_${GLTYPE}=\$result done for gltype in sig_atomic_t wchar_t wint_t ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 $as_echo_n "checking whether $gltype is signed... " >&6; } if eval \${gl_cv_type_${gltype}_signed+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : result=yes else result=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval gl_cv_type_${gltype}_signed=\$result fi eval ac_res=\$gl_cv_type_${gltype}_signed { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SIGNED_${GLTYPE} 1 _ACEOF eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 $as_echo_n "checking for $gltype integer literal suffix... " >&6; } if eval \${gl_cv_type_${gltype}_suffix+:} false; then : $as_echo_n "(cached) " >&6 else eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif extern $gltype foo; extern $gltype1 foo; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval gl_cv_type_${gltype}_suffix=\$glsuf fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done fi eval ac_res=\$gl_cv_type_${gltype}_suffix { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result cat >>confdefs.h <<_ACEOF #define ${GLTYPE}_SUFFIX $result _ACEOF done STDINT_H=stdint.h fi for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi done if test $ac_cv_header_inttypes_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 $as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } if ${gt_cv_inttypes_pri_broken+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef PRId32 char *p = PRId32; #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gt_cv_inttypes_pri_broken=no else gt_cv_inttypes_pri_broken=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 $as_echo "$gt_cv_inttypes_pri_broken" >&6; } fi if test "$gt_cv_inttypes_pri_broken" = yes; then cat >>confdefs.h <<_ACEOF #define PRI_MACROS_BROKEN 1 _ACEOF PRI_MACROS_BROKEN=1 else PRI_MACROS_BROKEN=0 fi ac_fn_c_check_decl "$LINENO" "imaxabs" "ac_cv_have_decl_imaxabs" "$ac_includes_default" if test "x$ac_cv_have_decl_imaxabs" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_IMAXABS $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "imaxdiv" "ac_cv_have_decl_imaxdiv" "$ac_includes_default" if test "x$ac_cv_have_decl_imaxdiv" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_IMAXDIV $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default" if test "x$ac_cv_have_decl_strtoimax" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOIMAX $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" if test "x$ac_cv_have_decl_strtoumax" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOUMAX $ac_have_decl _ACEOF GNULIB_IMAXABS=0; GNULIB_IMAXDIV=0; GNULIB_STRTOIMAX=0; GNULIB_STRTOUMAX=0; HAVE_DECL_IMAXABS=1; HAVE_DECL_IMAXDIV=1; HAVE_DECL_STRTOIMAX=1; HAVE_DECL_STRTOUMAX=1; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; #if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a run-time test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); #endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi GNULIB_MALLOC_POSIX=0; GNULIB_REALLOC_POSIX=0; GNULIB_CALLOC_POSIX=0; GNULIB_ATOLL=0; GNULIB_GETLOADAVG=0; GNULIB_GETSUBOPT=0; GNULIB_MKDTEMP=0; GNULIB_MKSTEMP=0; GNULIB_PUTENV=0; GNULIB_RANDOM_R=0; GNULIB_RPMATCH=0; GNULIB_SETENV=0; GNULIB_STRTOD=0; GNULIB_STRTOLL=0; GNULIB_STRTOULL=0; GNULIB_UNSETENV=0; HAVE_ATOLL=1; HAVE_CALLOC_POSIX=1; HAVE_GETSUBOPT=1; HAVE_MALLOC_POSIX=1; HAVE_MKDTEMP=1; HAVE_REALLOC_POSIX=1; HAVE_RANDOM_R=1; HAVE_RPMATCH=1; HAVE_SETENV=1; HAVE_STRTOD=1; HAVE_STRTOLL=1; HAVE_STRTOULL=1; HAVE_STRUCT_RANDOM_DATA=1; HAVE_SYS_LOADAVG_H=0; HAVE_UNSETENV=1; HAVE_DECL_GETLOADAVG=1; REPLACE_MKSTEMP=0; REPLACE_PUTENV=0; REPLACE_STRTOD=0; VOID_UNSETENV=0; GNULIB_MEMMEM=0; GNULIB_MEMPCPY=0; GNULIB_MEMRCHR=0; GNULIB_RAWMEMCHR=0; GNULIB_STPCPY=0; GNULIB_STPNCPY=0; GNULIB_STRCHRNUL=0; GNULIB_STRDUP=0; GNULIB_STRNDUP=0; GNULIB_STRNLEN=0; GNULIB_STRPBRK=0; GNULIB_STRSEP=0; GNULIB_STRSTR=0; GNULIB_STRCASESTR=0; GNULIB_STRTOK_R=0; GNULIB_MBSLEN=0; GNULIB_MBSNLEN=0; GNULIB_MBSCHR=0; GNULIB_MBSRCHR=0; GNULIB_MBSSTR=0; GNULIB_MBSCASECMP=0; GNULIB_MBSNCASECMP=0; GNULIB_MBSPCASECMP=0; GNULIB_MBSCASESTR=0; GNULIB_MBSCSPN=0; GNULIB_MBSPBRK=0; GNULIB_MBSSPN=0; GNULIB_MBSSEP=0; GNULIB_MBSTOK_R=0; GNULIB_STRERROR=0; GNULIB_STRSIGNAL=0; GNULIB_STRVERSCMP=0; HAVE_DECL_MEMMEM=1; HAVE_MEMPCPY=1; HAVE_DECL_MEMRCHR=1; HAVE_RAWMEMCHR=1; HAVE_STPCPY=1; HAVE_STPNCPY=1; HAVE_STRCHRNUL=1; HAVE_DECL_STRDUP=1; HAVE_STRNDUP=1; HAVE_DECL_STRNDUP=1; HAVE_DECL_STRNLEN=1; HAVE_STRPBRK=1; HAVE_STRSEP=1; HAVE_STRCASESTR=1; HAVE_DECL_STRTOK_R=1; HAVE_DECL_STRERROR=1; HAVE_DECL_STRSIGNAL=1; HAVE_STRVERSCMP=1; REPLACE_MEMMEM=0; REPLACE_STRDUP=0; REPLACE_STRSTR=0; REPLACE_STRCASESTR=0; REPLACE_STRERROR=0; REPLACE_STRSIGNAL=0; if test -z "$ERRNO_H"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 $as_echo_n "checking for working strerror function... " >&6; } if ${gl_cv_func_working_strerror+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !*strerror (-2); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_func_working_strerror=yes else gl_cv_func_working_strerror=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !*strerror (-2); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : gl_cv_func_working_strerror=yes else gl_cv_func_working_strerror=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 $as_echo "$gl_cv_func_working_strerror" >&6; } if test $gl_cv_func_working_strerror = no; then REPLACE_STRERROR=1 fi else REPLACE_STRERROR=1 fi if test $REPLACE_STRERROR = 1; then ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR $ac_have_decl _ACEOF : if test $ac_cv_header_sys_socket_h != yes; then for ac_header in winsock2.h do : ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" if test "x$ac_cv_header_winsock2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF fi done fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 $as_echo_n "checking for C/C++ restrict keyword... " >&6; } if ${ac_cv_c_restrict+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef int * int_ptr; int foo (int_ptr $ac_kw ip) { return ip[0]; } int main () { int s[1]; int * $ac_kw t = s; t[0] = 0; return foo(t) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_restrict=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_restrict" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 $as_echo "$ac_cv_c_restrict" >&6; } case $ac_cv_c_restrict in restrict) ;; no) $as_echo "#define restrict /**/" >>confdefs.h ;; *) cat >>confdefs.h <<_ACEOF #define restrict $ac_cv_c_restrict _ACEOF ;; esac : if test $gl_cv_have_include_next = yes; then gl_cv_next_string_h='<'string.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_string_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_string_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/string.h#{ s#.*"\(.*/string.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_string_h='<'string.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 $as_echo "$gl_cv_next_string_h" >&6; } fi NEXT_STRING_H=$gl_cv_next_string_h GNULIB_CHOWN=0; GNULIB_CLOSE=0; GNULIB_DUP2=0; GNULIB_ENVIRON=0; GNULIB_EUIDACCESS=0; GNULIB_FCHDIR=0; GNULIB_FSYNC=0; GNULIB_FTRUNCATE=0; GNULIB_GETCWD=0; GNULIB_GETDOMAINNAME=0; GNULIB_GETDTABLESIZE=0; GNULIB_GETHOSTNAME=0; GNULIB_GETLOGIN_R=0; GNULIB_GETPAGESIZE=0; GNULIB_GETUSERSHELL=0; GNULIB_LCHOWN=0; GNULIB_LSEEK=0; GNULIB_READLINK=0; GNULIB_SLEEP=0; GNULIB_UNISTD_H_SIGPIPE=0; GNULIB_WRITE=0; HAVE_DUP2=1; HAVE_EUIDACCESS=1; HAVE_FSYNC=1; HAVE_FTRUNCATE=1; HAVE_GETDOMAINNAME=1; HAVE_GETDTABLESIZE=1; HAVE_GETHOSTNAME=1; HAVE_GETPAGESIZE=1; HAVE_GETUSERSHELL=1; HAVE_READLINK=1; HAVE_SLEEP=1; HAVE_DECL_ENVIRON=1; HAVE_DECL_GETLOGIN_R=1; HAVE_OS_H=0; HAVE_SYS_PARAM_H=0; REPLACE_CHOWN=0; REPLACE_CLOSE=0; REPLACE_FCHDIR=0; REPLACE_GETCWD=0; REPLACE_GETPAGESIZE=0; REPLACE_LCHOWN=0; REPLACE_LSEEK=0; REPLACE_WRITE=0; UNISTD_H_HAVE_WINSOCK2_H=0; GNULIB_WCWIDTH=0; HAVE_DECL_WCWIDTH=1; REPLACE_WCWIDTH=0; WCHAR_H=''; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 $as_echo_n "checking for wint_t... " >&6; } if ${gt_cv_c_wint_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include wint_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gt_cv_c_wint_t=yes else gt_cv_c_wint_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 $as_echo "$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then $as_echo "#define HAVE_WINT_T 1" >>confdefs.h fi if false; then GL_COND_LIBTOOL_TRUE= GL_COND_LIBTOOL_FALSE='#' else GL_COND_LIBTOOL_TRUE='#' GL_COND_LIBTOOL_FALSE= fi gl_cond_libtool=false gl_libdeps= gl_ltlibdeps= gl_source_base='gnulib/lib' gl_LIBOBJS="$gl_LIBOBJS c-strtod.$ac_objext" : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if ${ac_cv_lib_error_at_line+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" fi : XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format" XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format" gl_LIBOBJS="$gl_LIBOBJS exitfail.$ac_objext" : if test -n "$GETOPT_H"; then : gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" GETOPT_H=getopt.h $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 $as_echo_n "checking whether the compiler generally respects inline... " >&6; } if ${gl_cv_c_inline_effective+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_c_inline = no; then gl_cv_c_inline_effective=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifdef __NO_INLINE__ #error "inline is not effective" #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_c_inline_effective=yes else gl_cv_c_inline_effective=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 $as_echo "$gl_cv_c_inline_effective" >&6; } if test $gl_cv_c_inline_effective = yes; then $as_echo "#define HAVE_INLINE 1" >>confdefs.h fi : : : : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inttypes.h conforms to C99" >&5 $as_echo_n "checking whether inttypes.h conforms to C99... " >&6; } if ${gl_cv_header_working_inttypes_h+:} false; then : $as_echo_n "(cached) " >&6 else gl_cv_header_working_inttypes_h=no if test "$gl_cv_header_working_stdint_h" = yes \ && test $ac_cv_header_inttypes_h = yes \ && test "$ac_cv_have_decl_imaxabs" = yes \ && test "$ac_cv_have_decl_imaxdiv" = yes \ && test "$ac_cv_have_decl_strtoimax" = yes \ && test "$ac_cv_have_decl_strtoumax" = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* work if build isn't clean */ #include /* No need to duplicate the tests of stdint.m4; they are subsumed by $gl_cv_header_working_stdint_h = yes. */ /* Tests for macros supposed to be defined in inttypes.h. */ const char *k = /* implicit string concatenation */ #ifdef INT8_MAX PRId8 PRIi8 #endif #ifdef UINT8_MAX PRIo8 PRIu8 PRIx8 PRIX8 #endif #ifdef INT16_MAX PRId16 PRIi16 #endif #ifdef UINT16_MAX PRIo16 PRIu16 PRIx16 PRIX16 #endif #ifdef INT32_MAX PRId32 PRIi32 #endif #ifdef UINT32_MAX PRIo32 PRIu32 PRIx32 PRIX32 #endif #ifdef INT64_MAX PRId64 PRIi64 #endif #ifdef UINT64_MAX PRIo64 PRIu64 PRIx64 PRIX64 #endif PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 PRIdLEAST64 PRIiLEAST64 PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 PRIdFAST64 PRIiFAST64 PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX #ifdef INTPTR_MAX PRIdPTR PRIiPTR #endif #ifdef UINTPTR_MAX PRIoPTR PRIuPTR PRIxPTR PRIXPTR #endif ; const char *l = /* implicit string concatenation */ #ifdef INT8_MAX SCNd8 SCNi8 #endif #ifdef UINT8_MAX SCNo8 SCNu8 SCNx8 #endif #ifdef INT16_MAX SCNd16 SCNi16 #endif #ifdef UINT16_MAX SCNo16 SCNu16 SCNx16 #endif #ifdef INT32_MAX SCNd32 SCNi32 #endif #ifdef UINT32_MAX SCNo32 SCNu32 SCNx32 #endif #ifdef INT64_MAX SCNd64 SCNi64 #endif #ifdef UINT64_MAX SCNo64 SCNu64 SCNx64 #endif SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 SCNdLEAST64 SCNiLEAST64 SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 SCNdFAST64 SCNiFAST64 SCNoFAST64 SCNuFAST64 SCNxFAST64 SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX #ifdef INTPTR_MAX SCNdPTR SCNiPTR #endif #ifdef UINTPTR_MAX SCNoPTR SCNuPTR SCNxPTR #endif ; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_working_inttypes_h=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_inttypes_h" >&5 $as_echo "$gl_cv_header_working_inttypes_h" >&6; } if false && test $gl_cv_header_working_inttypes_h = yes; then INTTYPES_H='' else : if test $gl_cv_have_include_next = yes; then gl_cv_next_inttypes_h='<'inttypes.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_inttypes_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_inttypes_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/inttypes.h#{ s#.*"\(.*/inttypes.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_inttypes_h='<'inttypes.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 $as_echo "$gl_cv_next_inttypes_h" >&6; } fi NEXT_INTTYPES_H=$gl_cv_next_inttypes_h $as_echo "#define GL_TRIGGER_STDC_LIMIT_MACROS 1" >>confdefs.h PRIPTR_PREFIX= if test -n "$STDINT_H"; then PRIPTR_PREFIX='"l"' else for glpfx in '' l ll I64; do case $glpfx in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; I64) gltype1='__int64';; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern intptr_t foo; extern $gltype1 foo; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : PRIPTR_PREFIX='"'$glpfx'"' fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test -n "$PRIPTR_PREFIX" && break done fi if test "$ac_cv_have_decl_imaxabs" = yes; then HAVE_DECL_IMAXABS=1 else HAVE_DECL_IMAXABS=0 fi if test "$ac_cv_have_decl_imaxdiv" = yes; then HAVE_DECL_IMAXDIV=1 else HAVE_DECL_IMAXDIV=0 fi if test "$ac_cv_have_decl_strtoimax" = yes; then HAVE_DECL_STRTOIMAX=1 else HAVE_DECL_STRTOIMAX=0 fi if test "$ac_cv_have_decl_strtoumax" = yes; then HAVE_DECL_STRTOUMAX=1 else HAVE_DECL_STRTOUMAX=0 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 $as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Work also in C++ mode. */ #define __STDC_LIMIT_MACROS 1 /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H #include #if HAVE_STDINT_H #include #endif #if defined INT32_MAX && defined INTMAX_MAX #define CONDITION (INT32_MAX < INTMAX_MAX) #elif HAVE_LONG_LONG_INT #define CONDITION (sizeof (int) < sizeof (long long int)) #else #define CONDITION 0 #endif int test[CONDITION ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes else gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 $as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then INT32_MAX_LT_INTMAX_MAX=1; else INT32_MAX_LT_INTMAX_MAX=0; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 $as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Work also in C++ mode. */ #define __STDC_LIMIT_MACROS 1 /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H #include #if HAVE_STDINT_H #include #endif #if defined INT64_MAX #define CONDITION (INT64_MAX == LONG_MAX) #elif HAVE_LONG_LONG_INT #define CONDITION (sizeof (long long int) == sizeof (long int)) #else #define CONDITION 0 #endif int test[CONDITION ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes else gl_cv_test_INT64_MAX_EQ_LONG_MAX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 $as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then INT64_MAX_EQ_LONG_MAX=1; else INT64_MAX_EQ_LONG_MAX=0; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 $as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Work also in C++ mode. */ #define __STDC_LIMIT_MACROS 1 /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H #include #if HAVE_STDINT_H #include #endif #if defined UINT32_MAX && defined UINTMAX_MAX #define CONDITION (UINT32_MAX < UINTMAX_MAX) #elif HAVE_LONG_LONG_INT #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) #else #define CONDITION 0 #endif int test[CONDITION ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes else gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 $as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then UINT32_MAX_LT_UINTMAX_MAX=1; else UINT32_MAX_LT_UINTMAX_MAX=0; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 $as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Work also in C++ mode. */ #define __STDC_LIMIT_MACROS 1 /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H #include #if HAVE_STDINT_H #include #endif #if defined UINT64_MAX #define CONDITION (UINT64_MAX == ULONG_MAX) #elif HAVE_LONG_LONG_INT #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) #else #define CONDITION 0 #endif int test[CONDITION ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes else gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then UINT64_MAX_EQ_ULONG_MAX=1; else UINT64_MAX_EQ_ULONG_MAX=0; fi INTTYPES_H='inttypes.h' fi # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else HAVE_LONG_LONG_INT=0 fi if test $ac_cv_type_unsigned_long_long_int = yes; then HAVE_UNSIGNED_LONG_LONG_INT=1 else HAVE_UNSIGNED_LONG_LONG_INT=0 fi if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi : if test $gl_cv_have_include_next = yes; then gl_cv_next_stdint_h='<'stdint.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_stdint_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_stdint_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdint.h#{ s#.*"\(.*/stdint.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_stdint_h='<'stdint.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 $as_echo "$gl_cv_next_stdint_h" >&6; } fi NEXT_STDINT_H=$gl_cv_next_stdint_h if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else HAVE_STDINT_H=0 fi if test $ac_cv_header_stdint_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } if ${gl_cv_header_working_stdint_h+:} false; then : $as_echo_n "(cached) " >&6 else gl_cv_header_working_stdint_h=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) #error "WCHAR_MIN, WCHAR_MAX not defined in " #endif /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) #define TYPE_MAXIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) struct s { int check_PTRDIFF: PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) ? 1 : -1; /* Detect bug in FreeBSD 6.0 / ia64. */ int check_SIG_ATOMIC: SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) ? 1 : -1; int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; int check_WCHAR: WCHAR_MIN == TYPE_MINIMUM (wchar_t) && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) ? 1 : -1; /* Detect bug in mingw. */ int check_WINT: WINT_MIN == TYPE_MINIMUM (wint_t) && WINT_MAX == TYPE_MAXIMUM (wint_t) ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_working_stdint_h=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= else for ac_header in sys/inttypes.h sys/bitypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 else HAVE_SYS_INTTYPES_H=0 fi if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 else HAVE_SYS_BITYPES_H=0 fi : for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 $as_echo_n "checking for bit size of $gltype... " >&6; } if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif #include "; then : else result=unknown fi eval gl_cv_bitsizeof_${gltype}=\$result fi eval ac_res=\$gl_cv_bitsizeof_${gltype} { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` cat >>confdefs.h <<_ACEOF #define BITSIZEOF_${GLTYPE} $result _ACEOF eval BITSIZEOF_${GLTYPE}=\$result done for gltype in sig_atomic_t wchar_t wint_t ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 $as_echo_n "checking whether $gltype is signed... " >&6; } if eval \${gl_cv_type_${gltype}_signed+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : result=yes else result=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval gl_cv_type_${gltype}_signed=\$result fi eval ac_res=\$gl_cv_type_${gltype}_signed { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SIGNED_${GLTYPE} 1 _ACEOF eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 $as_echo_n "checking for $gltype integer literal suffix... " >&6; } if eval \${gl_cv_type_${gltype}_suffix+:} false; then : $as_echo_n "(cached) " >&6 else eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif extern $gltype foo; extern $gltype1 foo; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval gl_cv_type_${gltype}_suffix=\$glsuf fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done fi eval ac_res=\$gl_cv_type_${gltype}_suffix { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result cat >>confdefs.h <<_ACEOF #define ${GLTYPE}_SUFFIX $result _ACEOF done STDINT_H=stdint.h fi : if test $gl_cv_have_include_next = yes; then gl_cv_next_stdlib_h='<'stdlib.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_stdlib_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_stdlib_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdlib.h#{ s#.*"\(.*/stdlib.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_stdlib_h='<'stdlib.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 $as_echo "$gl_cv_next_stdlib_h" >&6; } fi NEXT_STDLIB_H=$gl_cv_next_stdlib_h ac_fn_c_check_type "$LINENO" "struct random_data" "ac_cv_type_struct_random_data" "#include " if test "x$ac_cv_type_struct_random_data" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_RANDOM_DATA 1 _ACEOF else HAVE_STRUCT_RANDOM_DATA=0 fi if test $REPLACE_STRERROR = 1; then gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" cat >>confdefs.h <<_ACEOF #define REPLACE_STRERROR $REPLACE_STRERROR _ACEOF fi GNULIB_STRERROR=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines strtoimax as a macro" >&5 $as_echo_n "checking whether defines strtoimax as a macro... " >&6; } if ${gl_cv_func_strtoimax_macro+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef strtoimax inttypes_h_defines_strtoimax #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inttypes_h_defines_strtoimax" >/dev/null 2>&1; then : gl_cv_func_strtoimax_macro=yes else gl_cv_func_strtoimax_macro=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoimax_macro" >&5 $as_echo "$gl_cv_func_strtoimax_macro" >&6; } if test "$gl_cv_func_strtoimax_macro" != yes; then for ac_func in strtoimax do : ac_fn_c_check_func "$LINENO" "strtoimax" "ac_cv_func_strtoimax" if test "x$ac_cv_func_strtoimax" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOIMAX 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_strtoimax = no; then ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default" if test "x$ac_cv_have_decl_strtoll" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOLL $ac_have_decl _ACEOF fi fi GNULIB_STRTOIMAX=1 for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOL 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test "$ac_cv_type_long_long_int" = yes; then for ac_func in strtoll do : ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" if test "x$ac_cv_func_strtoll" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOLL 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_strtoll = no; then HAVE_STRTOLL=0 : fi fi GNULIB_STRTOLL=1 for ac_func in strtoul do : ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" if test "x$ac_cv_func_strtoul" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOUL 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test "$ac_cv_type_unsigned_long_long_int" = yes; then for ac_func in strtoull do : ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" if test "x$ac_cv_func_strtoull" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOULL 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_strtoull = no; then HAVE_STRTOULL=0 : fi fi GNULIB_STRTOULL=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines strtoumax as a macro" >&5 $as_echo_n "checking whether defines strtoumax as a macro... " >&6; } if ${gl_cv_func_strtoumax_macro+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef strtoumax inttypes_h_defines_strtoumax #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inttypes_h_defines_strtoumax" >/dev/null 2>&1; then : gl_cv_func_strtoumax_macro=yes else gl_cv_func_strtoumax_macro=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtoumax_macro" >&5 $as_echo "$gl_cv_func_strtoumax_macro" >&6; } if test "$gl_cv_func_strtoumax_macro" != yes; then for ac_func in strtoumax do : ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax" if test "x$ac_cv_func_strtoumax" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOUMAX 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_strtoumax = no; then ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" if test "x$ac_cv_have_decl_strtoull" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOULL $ac_have_decl _ACEOF fi fi GNULIB_STRTOUMAX=1 : if test $gl_cv_have_include_next = yes; then gl_cv_next_unistd_h='<'unistd.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_unistd_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_unistd_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/unistd.h#{ s#.*"\(.*/unistd.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_unistd_h='<'unistd.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 $as_echo "$gl_cv_next_unistd_h" >&6; } fi NEXT_UNISTD_H=$gl_cv_next_unistd_h : if test $ac_cv_header_unistd_h = yes; then HAVE_UNISTD_H=1 else HAVE_UNISTD_H=0 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is standalone" >&5 $as_echo_n "checking whether is standalone... " >&6; } if ${gl_cv_header_wchar_h_standalone+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include wchar_t w; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gl_cv_header_wchar_h_standalone=yes else gl_cv_header_wchar_h_standalone=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_standalone" >&5 $as_echo "$gl_cv_header_wchar_h_standalone" >&6; } if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else HAVE_WINT_T=0 fi if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then WCHAR_H=wchar.h fi : if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi : if test $gl_cv_have_include_next = yes; then gl_cv_next_wchar_h='<'wchar.h'>' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 $as_echo_n "checking absolute name of ... " >&6; } if ${gl_cv_next_wchar_h+:} false; then : $as_echo_n "(cached) " >&6 else if test $ac_cv_header_wchar_h = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/wchar.h#{ s#.*"\(.*/wchar.h\)".*#\1# s#^/[^/]#//&# p q }'`'"' else gl_cv_next_wchar_h='<'wchar.h'>' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 $as_echo "$gl_cv_next_wchar_h" >&6; } fi NEXT_WCHAR_H=$gl_cv_next_wchar_h gl_LIBOBJS="$gl_LIBOBJS xmalloc.$ac_objext" : : gl_LIBOBJS="$gl_LIBOBJS xstrtod.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS xstrtol.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS xstrtoul.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS xstrtol-error.$ac_objext" gltests_libdeps= gltests_ltlibdeps= gl_source_base='tests' LIBGNU_LIBDEPS="$gl_libdeps" LIBGNU_LTLIBDEPS="$gl_ltlibdeps" for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { yyless (input () != 0); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in java do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_JAVA"; then ac_cv_prog_HAVE_JAVA="$HAVE_JAVA" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_HAVE_JAVA="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_JAVA=$ac_cv_prog_HAVE_JAVA if test -n "$HAVE_JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_JAVA" >&5 $as_echo "$HAVE_JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$HAVE_JAVA" && break done if test "$HAVE_JAVA"; then HAVE_JAVA_TRUE= HAVE_JAVA_FALSE='#' else HAVE_JAVA_TRUE='#' HAVE_JAVA_FALSE= fi for ac_prog in javac do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_JAVAC"; then ac_cv_prog_HAVE_JAVAC="$HAVE_JAVAC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_HAVE_JAVAC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_JAVAC=$ac_cv_prog_HAVE_JAVAC if test -n "$HAVE_JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_JAVAC" >&5 $as_echo "$HAVE_JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$HAVE_JAVAC" && break done if test "$HAVE_JAVAC"; then HAVE_JAVAC_TRUE= HAVE_JAVAC_FALSE='#' else HAVE_JAVAC_TRUE='#' HAVE_JAVAC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi for ac_header in time.h stdlib.h unistd.h sys/param.h sys/utsname.h sys/time.h sys/types.h pwd.h getopt.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ll" >&5 $as_echo_n "checking for main in -ll... " >&6; } if ${ac_cv_lib_l_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_l_main=yes else ac_cv_lib_l_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_l_main" >&5 $as_echo "$ac_cv_lib_l_main" >&6; } if test "x$ac_cv_lib_l_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBL 1 _ACEOF LIBS="-ll $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done for ac_func in mktime gethostname gettimeofday strdup strerror uname getdomainname getopt_long do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x$JAVAPREFIX = x; then test x$JAVA = x && for ac_prog in kaffe$EXEEXT java$EXEEXT do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$JAVA"; then ac_cv_prog_JAVA="$JAVA" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_JAVA="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi JAVA=$ac_cv_prog_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$JAVA" && break done else test x$JAVA = x && for ac_prog in kaffe$EXEEXT java$EXEEXT do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$JAVA"; then ac_cv_prog_JAVA="$JAVA" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_JAVA="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi JAVA=$ac_cv_prog_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$JAVA" && break done test -n "$JAVA" || JAVA="$JAVAPREFIX" fi test x$JAVA = x && as_fn_error $? "no acceptable Java virtual machine found in \$PATH" "$LINENO" 5 # Extract the first word of "uudecode$EXEEXT", so it can be a program name with args. set dummy uudecode$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_uudecode+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$uudecode"; then ac_cv_prog_uudecode="$uudecode" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_uudecode="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi uudecode=$ac_cv_prog_uudecode if test -n "$uudecode"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $uudecode" >&5 $as_echo "$uudecode" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$uudecode = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uudecode can decode base 64 file" >&5 $as_echo_n "checking if uudecode can decode base 64 file... " >&6; } if ${ac_cv_prog_uudecode_base64+:} false; then : $as_echo_n "(cached) " >&6 else cat << \EOF > Test.uue begin-base64 644 Test.class yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ= ==== EOF if uudecode$EXEEXT Test.uue; then ac_cv_prog_uudecode_base64=yes else echo "configure: 9928: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 echo "configure: failed file was:" >&5 cat Test.uue >&5 ac_cv_prog_uudecode_base64=no fi rm -f Test.uue fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_uudecode_base64" >&5 $as_echo "$ac_cv_prog_uudecode_base64" >&6; } fi if test x$ac_cv_prog_uudecode_base64 != xyes; then rm -f Test.class { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: I have to compile Test.class from scratch" >&5 $as_echo "$as_me: WARNING: I have to compile Test.class from scratch" >&2;} if test x$ac_cv_prog_javac_works = xno; then as_fn_error $? "Cannot compile java source. $JAVAC does not work properly" "$LINENO" 5 fi if test x$ac_cv_prog_javac_works = x; then if test "x$JAVAPREFIX" = x; then test "x$JAVAC" = x && for ac_prog in "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$JAVAC"; then ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_JAVAC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi JAVAC=$ac_cv_prog_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$JAVAC" && break done else test "x$JAVAC" = x && for ac_prog in "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$JAVAC"; then ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_JAVAC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi JAVAC=$ac_cv_prog_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$JAVAC" && break done test -n "$JAVAC" || JAVAC="$JAVAPREFIX" fi test "x$JAVAC" = x && as_fn_error $? "no acceptable Java compiler found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $JAVAC works" >&5 $as_echo_n "checking if $JAVAC works... " >&6; } if ${ac_cv_prog_javac_works+:} false; then : $as_echo_n "(cached) " >&6 else JAVA_TEST=Test.java CLASS_TEST=Test.class cat << \EOF > $JAVA_TEST /* #line 10046 "configure" */ public class Test { } EOF if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } >/dev/null 2>&1; then ac_cv_prog_javac_works=yes else as_fn_error $? "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5 echo "configure: failed program was:" >&5 cat $JAVA_TEST >&5 fi rm -f $JAVA_TEST $CLASS_TEST fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_javac_works" >&5 $as_echo "$ac_cv_prog_javac_works" >&6; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $JAVA works" >&5 $as_echo_n "checking if $JAVA works... " >&6; } if ${ac_cv_prog_java_works+:} false; then : $as_echo_n "(cached) " >&6 else JAVA_TEST=Test.java CLASS_TEST=Test.class TEST=Test cat << \EOF > $JAVA_TEST /* [#]line 10081 "configure" */ public class Test { public static void main (String args[]) { System.exit (0); } } EOF if test x$ac_cv_prog_uudecode_base64 != xyes; then if { ac_try='$JAVAC $JAVACFLAGS $JAVA_TEST' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } && test -s $CLASS_TEST; then : else echo "configure: failed program was:" >&5 cat $JAVA_TEST >&5 as_fn_error $? "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5 fi fi if { ac_try='$JAVA $JAVAFLAGS $TEST' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } >/dev/null 2>&1; then ac_cv_prog_java_works=yes else echo "configure: failed program was:" >&5 cat $JAVA_TEST >&5 as_fn_error $? "The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" "$LINENO" 5 fi rm -fr $JAVA_TEST $CLASS_TEST Test.uue fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_java_works" >&5 $as_echo "$ac_cv_prog_java_works" >&6; } ac_var_name=`echo gnu.getopt.Getopt | sed 's/\./_/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnu.getopt.Getopt class" >&5 $as_echo_n "checking for gnu.getopt.Getopt class... " >&6; } if eval \${ac_cv_class_$ac_var_name+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_prog_uudecode_base64 = xyes; then cat << \EOF > Test.uue begin-base64 644 Test.class yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA JwAAAAIAKA== ==== EOF if uudecode$EXEEXT Test.uue; then : else echo "configure: 10153: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 echo "configure: failed file was:" >&5 cat Test.uue >&5 ac_cv_prog_uudecode_base64=no fi rm -f Test.uue if { ac_try='$JAVA $JAVAFLAGS Test gnu.getopt.Getopt' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } >/dev/null 2>&1; then eval "ac_cv_class_$ac_var_name=yes" else eval "ac_cv_class_$ac_var_name=no" fi rm -f Test.class else cat << \EOF > Test.java /* #line 10173 "configure" */ import gnu.getopt.Getopt; public class Test { } EOF if { ac_try='$JAVAC $JAVACFLAGS Test.java' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } && test -s Test.class then eval "ac_cv_class_$ac_var_name=yes" else echo "configure: failed program was:" >&5 cat Test.java >&5 rm -fr Test* eval "ac_cv_class_$ac_var_name=no" fi rm -fr Test* fi eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`" HAVE_LAST_CLASS=$ac_var_val if test x$ac_var_val = xyes; then : else : fi fi eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_var_val" >&5 $as_echo "$ac_var_val" >&6; } if test "x$ac_cv_class_gnu_getopt_Getopt" = xyes ; then HAVE_GETOPT_JAVA="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Java class gnu.getopt.Getopt not found. You can build genparse anyway but not its test suite for the java output." >&5 $as_echo "$as_me: WARNING: Java class gnu.getopt.Getopt not found. You can build genparse anyway but not its test suite for the java output." >&2;} fi if test "$HAVE_GETOPT_JAVA"; then HAVE_GETOPT_JAVA_TRUE= HAVE_GETOPT_JAVA_FALSE='#' else HAVE_GETOPT_JAVA_TRUE='#' HAVE_GETOPT_JAVA_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CU_initialize_registry in -lcunit" >&5 $as_echo_n "checking for CU_initialize_registry in -lcunit... " >&6; } if ${ac_cv_lib_cunit_CU_initialize_registry+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcunit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char CU_initialize_registry (); int main () { return CU_initialize_registry (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cunit_CU_initialize_registry=yes else ac_cv_lib_cunit_CU_initialize_registry=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cunit_CU_initialize_registry" >&5 $as_echo "$ac_cv_lib_cunit_CU_initialize_registry" >&6; } if test "x$ac_cv_lib_cunit_CU_initialize_registry" = xyes; then : HAVE_CUNIT="yes" fi if test x$HAVE_CUNIT != xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CUnit not found. You can build Genparse anyway but not its test suite for the C output." >&5 $as_echo "$as_me: WARNING: CUnit not found. You can build Genparse anyway but not its test suite for the C output." >&2;} fi if test "$HAVE_CUNIT"; then HAVE_CUNIT_TRUE= HAVE_CUNIT_FALSE='#' else HAVE_CUNIT_TRUE='#' HAVE_CUNIT_FALSE= fi # Check whether --with-cppunit-prefix was given. if test "${with_cppunit_prefix+set}" = set; then : withval=$with_cppunit_prefix; cppunit_config_prefix="$withval" else cppunit_config_prefix="" fi # Check whether --with-cppunit-exec-prefix was given. if test "${with_cppunit_exec_prefix+set}" = set; then : withval=$with_cppunit_exec_prefix; cppunit_config_exec_prefix="$withval" else cppunit_config_exec_prefix="" fi if test x$cppunit_config_exec_prefix != x ; then cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config fi fi if test x$cppunit_config_prefix != x ; then cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config fi fi # Extract the first word of "cppunit-config", so it can be a program name with args. set dummy cppunit-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CPPUNIT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $CPPUNIT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_CPPUNIT_CONFIG="$CPPUNIT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CPPUNIT_CONFIG" && ac_cv_path_CPPUNIT_CONFIG="no" ;; esac fi CPPUNIT_CONFIG=$ac_cv_path_CPPUNIT_CONFIG if test -n "$CPPUNIT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPPUNIT_CONFIG" >&5 $as_echo "$CPPUNIT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cppunit_version_min=1.10.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cppunit - version >= $cppunit_version_min" >&5 $as_echo_n "checking for Cppunit - version >= $cppunit_version_min... " >&6; } no_cppunit="" if test "$CPPUNIT_CONFIG" = "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } no_cppunit=yes else CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` cppunit_version=`$CPPUNIT_CONFIG --version` cppunit_major_version=`echo $cppunit_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` cppunit_minor_version=`echo $cppunit_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` cppunit_micro_version=`echo $cppunit_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` cppunit_major_min=`echo $cppunit_version_min | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` if test "x${cppunit_major_min}" = "x" ; then cppunit_major_min=0 fi cppunit_minor_min=`echo $cppunit_version_min | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` if test "x${cppunit_minor_min}" = "x" ; then cppunit_minor_min=0 fi cppunit_micro_min=`echo $cppunit_version_min | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x${cppunit_micro_min}" = "x" ; then cppunit_micro_min=0 fi cppunit_version_proper=`expr \ $cppunit_major_version \> $cppunit_major_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \> $cppunit_minor_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \= $cppunit_minor_min \& \ $cppunit_micro_version \>= $cppunit_micro_min ` if test "$cppunit_version_proper" = "1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&5 $as_echo "$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } no_cppunit=yes fi fi if test "x$no_cppunit" = x ; then : else CPPUNIT_CFLAGS="" CPPUNIT_LIBS="" : fi if test "x$CPPUNIT_LIBS" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CPPUnit not found. You can build Genparse anyway but not its test suite for the C++ output." >&5 $as_echo "$as_me: WARNING: CPPUnit not found. You can build Genparse anyway but not its test suite for the C++ output." >&2;} fi if test "$CPPUNIT_LIBS"; then HAVE_CPPUNIT_TRUE= HAVE_CPPUNIT_FALSE='#' else HAVE_CPPUNIT_TRUE='#' HAVE_CPPUNIT_FALSE= fi if ${ac_cv_prog_JUNIT+:} false; then : $as_echo_n "(cached) " >&6 else ac_var_name=`echo junit.textui.TestRunner | sed 's/\./_/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for junit.textui.TestRunner class" >&5 $as_echo_n "checking for junit.textui.TestRunner class... " >&6; } if eval \${ac_cv_class_$ac_var_name+:} false; then : $as_echo_n "(cached) " >&6 else if test x$ac_cv_prog_uudecode_base64 = xyes; then cat << \EOF > Test.uue begin-base64 644 Test.class yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA JwAAAAIAKA== ==== EOF if uudecode$EXEEXT Test.uue; then : else echo "configure: 10470: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 echo "configure: failed file was:" >&5 cat Test.uue >&5 ac_cv_prog_uudecode_base64=no fi rm -f Test.uue if { ac_try='$JAVA $JAVAFLAGS Test junit.textui.TestRunner' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } >/dev/null 2>&1; then eval "ac_cv_class_$ac_var_name=yes" else eval "ac_cv_class_$ac_var_name=no" fi rm -f Test.class else cat << \EOF > Test.java /* #line 10490 "configure" */ import junit.textui.TestRunner; public class Test { } EOF if { ac_try='$JAVAC $JAVACFLAGS Test.java' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } && test -s Test.class then eval "ac_cv_class_$ac_var_name=yes" else echo "configure: failed program was:" >&5 cat Test.java >&5 rm -fr Test* eval "ac_cv_class_$ac_var_name=no" fi rm -fr Test* fi eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`" HAVE_LAST_CLASS=$ac_var_val if test x$ac_var_val = xyes; then : else : fi fi eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_var_val" >&5 $as_echo "$ac_var_val" >&6; } if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner' fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for junit" >&5 $as_echo_n "checking for junit... " >&6; } if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then JUNIT="$ac_cv_prog_JUNIT" JAVA_JUNIT='$(JAVA_JUNIT)' TESTS_JUNIT='$(TESTS_JUNIT)' else JUNIT= JAVA_JUNIT= TESTS_JUNIT= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_JUNIT" >&5 $as_echo "$JAVA_JUNIT" >&6; } if test "x$JAVA_JUNIT" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JUnit not found. You can build Genparse anyway but not its test suite for the Java output." >&5 $as_echo "$as_me: WARNING: JUnit not found. You can build Genparse anyway but not its test suite for the Java output." >&2;} fi if test "$JAVA_JUNIT"; then HAVE_JUNIT_TRUE= HAVE_JUNIT_FALSE='#' else HAVE_JUNIT_TRUE='#' HAVE_JUNIT_FALSE= fi for ac_prog in doxygen do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DOXYGEN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DOXYGEN" && break done test -n "$DOXYGEN" || DOXYGEN="no" if test x$DOXYGEN = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Doxygen not found, Doxygen documentation will not be built" >&5 $as_echo "$as_me: WARNING: Doxygen not found, Doxygen documentation will not be built" >&2;} else for ac_prog in dot do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOT"; then ac_cv_prog_DOT="$DOT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DOT="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DOT=$ac_cv_prog_DOT if test -n "$DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 $as_echo "$DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DOT" && break done test -n "$DOT" || DOT="no" if test x$DOT = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: graphviz / dot not found, Doxygen documentation will not be built" >&5 $as_echo "$as_me: WARNING: graphviz / dot not found, Doxygen documentation will not be built" >&2;} fi fi if test "$DOXYGEN" != no -a "$DOT" != no; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' else HAVE_DOXYGEN_TRUE='#' HAVE_DOXYGEN_FALSE= fi DOXYGEN_SRC_DIRECTORY=$srcdir/../src for ac_prog in texi2html do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TEXI2HTML+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TEXI2HTML"; then ac_cv_prog_TEXI2HTML="$TEXI2HTML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TEXI2HTML="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi TEXI2HTML=$ac_cv_prog_TEXI2HTML if test -n "$TEXI2HTML"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2HTML" >&5 $as_echo "$TEXI2HTML" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TEXI2HTML" && break done test -n "$TEXI2HTML" || TEXI2HTML="no" if test x$TEXI2HTML = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: texi2html not found, html version of info pages will not be built" >&5 $as_echo "$as_me: WARNING: texi2html not found, html version of info pages will not be built" >&2;} fi if test "$TEXI2HTML" != no; then HAVE_TEXI2HTML_TRUE= HAVE_TEXI2HTML_FALSE='#' else HAVE_TEXI2HTML_TRUE='#' HAVE_TEXI2HTML_FALSE= fi for ac_prog in texi2pdf do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TEXI2PDF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TEXI2PDF"; then ac_cv_prog_TEXI2PDF="$TEXI2PDF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TEXI2PDF="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi TEXI2PDF=$ac_cv_prog_TEXI2PDF if test -n "$TEXI2PDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2PDF" >&5 $as_echo "$TEXI2PDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TEXI2PDF" && break done test -n "$TEXI2PDF" || TEXI2PDF="no" if test x$TEXI2PDF = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: texi2pdf not found, pdf version of info pages will not be built" >&5 $as_echo "$as_me: WARNING: texi2pdf not found, pdf version of info pages will not be built" >&2;} fi if test "$TEXI2PDF" != no; then HAVE_TEXI2PDF_TRUE= HAVE_TEXI2PDF_FALSE='#' else HAVE_TEXI2PDF_TRUE='#' HAVE_TEXI2PDF_FALSE= fi for ac_prog in man2html do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MAN2HTML+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MAN2HTML"; then ac_cv_prog_MAN2HTML="$MAN2HTML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MAN2HTML="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MAN2HTML=$ac_cv_prog_MAN2HTML if test -n "$MAN2HTML"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAN2HTML" >&5 $as_echo "$MAN2HTML" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MAN2HTML" && break done test -n "$MAN2HTML" || MAN2HTML="no" if test x$MAN2HTML = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: man2html not found, html version of man page will not be built" >&5 $as_echo "$as_me: WARNING: man2html not found, html version of man page will not be built" >&2;} fi if test "$MAN2HTML" != no; then HAVE_MAN2HTML_TRUE= HAVE_MAN2HTML_FALSE='#' else HAVE_MAN2HTML_TRUE='#' HAVE_MAN2HTML_FALSE= fi case " $LIBOBJS " in *" xstrtol.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS xstrtol.$ac_objext" ;; esac case " $LIBOBJS " in *" xstrtoul.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS xstrtoul.$ac_objext" ;; esac case " $LIBOBJS " in *" xstrtol-error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS xstrtol-error.$ac_objext" ;; esac ac_config_files="$ac_config_files Makefile gnulib/Makefile gnulib/lib/Makefile src/Makefile doc/Makefile examples/Makefile tests/Makefile tests/ccheck/Makefile tests/cppcheck/Makefile tests/javacheck/Makefile tests/misc/Makefile doc/Doxyfile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi gl_libobjs= gl_ltlibobjs= if test -n "$gl_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" done fi gl_LIBOBJS=$gl_libobjs gl_LTLIBOBJS=$gl_ltlibobjs gltests_libobjs= gltests_ltlibobjs= if test -n "$gltests_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do gltests_libobjs="$gltests_libobjs $i.$ac_objext" gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" done fi gltests_LIBOBJS=$gltests_libobjs gltests_LTLIBOBJS=$gltests_ltlibobjs if test -z "${HAVE_JAVA_TRUE}" && test -z "${HAVE_JAVA_FALSE}"; then as_fn_error $? "conditional \"HAVE_JAVA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_JAVAC_TRUE}" && test -z "${HAVE_JAVAC_FALSE}"; then as_fn_error $? "conditional \"HAVE_JAVAC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GETOPT_JAVA_TRUE}" && test -z "${HAVE_GETOPT_JAVA_FALSE}"; then as_fn_error $? "conditional \"HAVE_GETOPT_JAVA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CUNIT_TRUE}" && test -z "${HAVE_CUNIT_FALSE}"; then as_fn_error $? "conditional \"HAVE_CUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CPPUNIT_TRUE}" && test -z "${HAVE_CPPUNIT_FALSE}"; then as_fn_error $? "conditional \"HAVE_CPPUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_JUNIT_TRUE}" && test -z "${HAVE_JUNIT_FALSE}"; then as_fn_error $? "conditional \"HAVE_JUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_TEXI2HTML_TRUE}" && test -z "${HAVE_TEXI2HTML_FALSE}"; then as_fn_error $? "conditional \"HAVE_TEXI2HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_TEXI2PDF_TRUE}" && test -z "${HAVE_TEXI2PDF_FALSE}"; then as_fn_error $? "conditional \"HAVE_TEXI2PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MAN2HTML_TRUE}" && test -z "${HAVE_MAN2HTML_FALSE}"; then as_fn_error $? "conditional \"HAVE_MAN2HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "gnulib/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;; "gnulib/lib/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/lib/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/ccheck/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ccheck/Makefile" ;; "tests/cppcheck/Makefile") CONFIG_FILES="$CONFIG_FILES tests/cppcheck/Makefile" ;; "tests/javacheck/Makefile") CONFIG_FILES="$CONFIG_FILES tests/javacheck/Makefile" ;; "tests/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tests/misc/Makefile" ;; "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in "$ac_file" | "$ac_file":* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for "$ac_file"" >`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi genparse-0.9.1/install-sh0000755000076600001440000003246411341041447012264 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: genparse-0.9.1/AUTHORS0000644000076600001440000000010110475616607011324 00000000000000Mike Borella mike@borella.net Michael Geng linux@michaelgeng.de genparse-0.9.1/ylwrap0000755000076600001440000001376310731300500011513 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2007-11-22.22 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: genparse-0.9.1/genparse.gp0000644000076600001440000000161711341041447012410 00000000000000/* * Genparse file for...genparse!!! */ #mandatory file c / cppext string {"cc"} "C++ file extension." d flag "Turns on logging." D / directory string {""} "Directory for storing results." f / logfile string {"genparse.log"} "Log file name." g / gnulib flag "Use GNU Portability Library (Gnulib)." i / internationalize flag "Put internationalization macro _() around text output." l / language string {"c"} "Output language." m / longmembers flag "Use long names for class members." o / outfile string {"parse_cl"} "Output file name." p / parsefunc string {"Cmdline"} "Name of parsing function / class." P / manyprints flag "Output help text for every command line parameter in a" "separate print command." q / quiet flag "Turns on quiet mode." s / static-headers flag "Keep headers of generated files static. Don't add" "creation date, username, kernel version etc." genparse-0.9.1/doc/0000777000076600001440000000000011732700534011103 500000000000000genparse-0.9.1/doc/texinfo.tex0000644000076600001440000105234011341041450013211 00000000000000% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2007-09-03.05} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 2007, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex % (and all CTAN mirrors, see http://www.ctan.org). % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt} % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\undefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % For @cropmarks command. % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarily, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as enviroments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At runtime, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Evironment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty out of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} %% Simple single-character @ commands % @@ prints an @ % Kludge this until the fonts are right (grr). \def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. %% Define @` and @' to be the same as ` and ' %% but suppressing ligatures. %\def\`{{`}} %\def\'{{'}} % Used to generate quoted braces. \def\mylbrace {{\tt\char123}} \def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \t \let\ubaraccent = \b \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ptexi \else\ifx\temp\jmacro \j \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% \kern-.15em \TeX } % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in % Old definition--didn't work. %\parseargdef\need{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @include file insert text of that file as input. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable \def\temp{\input #1 }% \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\next\centerH \else \let\next\centerV \fi \next{\hfil \ignorespaces#1\unskip \hfil}% } \def\centerH#1{% {% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }% } \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a \ character. % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not % otherwise define @\. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus } } % @bullet and @minus need the same treatment as @math, just above. \def\bullet{$\ptexbullet$} \def\minus{$-$} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @comma{} is so commas can be inserted into text without messing up % Texinfo's parsing. % \let\comma = , % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as \undefined, % borrowed from ifpdf.sty. \ifx\pdfoutput\undefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html % (and related messages, the final outcome is that it is up to the TeX % user to double the backslashes and otherwise make the string valid, so % that's what we do). % double active backslashes. % {\catcode`\@=0 \catcode`\\=\active @gdef@activebackslashdouble{% @catcode`@\=@active @let\=@doublebackslash} } % To handle parens, we must adopt a different approach, since parens are % not active characters. hyperref.dtx (which has the same problem as % us) handles it with this amazing macro to replace tokens, with minor % changes for Texinfo. It is included here under the GPL by permission % from the author, Heiko Oberdiek. % % #1 is the tokens to replace. % #2 is the replacement. % #3 is the control sequence with the string. % \def\HyPsdSubst#1#2#3{% \def\HyPsdReplace##1#1##2\END{% ##1% \ifx\\##2\\% \else #2% \HyReturnAfterFi{% \HyPsdReplace##2\END }% \fi }% \xdef#3{\expandafter\HyPsdReplace#3#1\END}% } \long\def\HyReturnAfterFi#1\fi{\fi#1} % #1 is a control sequence in which to do the replacements. \def\backslashparens#1{% \xdef#1{#1}% redefine it as its expansion; the definition is simply % \lastnode when called from \setref -> \pdfmkdest. \HyPsdSubst{(}{\realbackslash(}{#1}% \HyPsdSubst{)}{\realbackslash)}{#1}% } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex. \def\cmykDarkRed{0.28 1 1 0.35} \def\cmykBlack{0 0 0 1} % \def\pdfsetcolor#1{\pdfliteral{#1 k}} % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\cmykBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .png, .jpg, .pdf (among % others). Let's try in that order. \let\pdfimgext=\empty \begingroup \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \openin 1 #1.pdf \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{pdf}% \fi \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \closein 1 \endgroup % % without \immediate, pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \imagewidth \fi \ifdim \wd2 >0pt height \imageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \activebackslashdouble \makevalueexpandable \def\pdfdestname{#1}% \backslashparens\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\cmykDarkRed} \def\linkcolor{\cmykDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \def\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else % Doubled backslashes in the name. {\activebackslashdouble \xdef\pdfoutlinedest{#3}% \backslashparens\pdfoutlinedest}% \fi % % Also double the backslashes in the display string. {\activebackslashdouble \xdef\pdfoutlinetext{#1}% \backslashparens\pdfoutlinetext}% % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % % Read toc silently, to get counts of subentries for \pdfoutline. \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % xx to do this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Right % now, I guess we'll just let the pdf reader have its way. \indexnofonts \setupdatafile \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \ifx\p\space\else\addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \fi \nextsp} \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Default leading. \newdimen\textleading \textleading = 13.2pt % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % % PDF CMaps. See also LaTeX's t1.cmap. % % \cmapOT1 \ifpdf \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \else \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble \fi % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass % empty to omit). \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\undefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. This is the default in % Texinfo. % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} \def\authortt{\sectt} \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} % reset the current fonts \textfonts \rm } % end of 11pt text font size definitions % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} \def\authortt{\sectt} \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} % reduce space between paragraphs \divide\parskip by 2 % reset the current fonts \textfonts \rm } % end of 10pt text font size definitions % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xword{10} \def\xiword{11} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% \wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % % I wish the USA used A4 paper. % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else \ptexslash\fi\fi\fi} \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} % like \smartslanted except unconditionally uses \ttsl. % @var is set to this for defun arguments. \def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} % like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\slanted=\smartslanted \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % @b, explicit bold. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } \def\samp#1{`\tclose{#1}'\null} \setfont\keyrm\rmshape{8}{1000}{OT1} \font\keysy=cmsy9 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% \kern-.06em\raise0.4pt\hbox{\angleright}}}} \def\key #1{{\nohyphenation \uppercase{#1}}\null} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active % \global\def\code{\begingroup \catcode\rquoteChar=\active \catcode\lquoteChar=\active \let'\codequoteright \let`\codequoteleft % \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\realdash \let_\realunder \fi \codex } } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } \def\codex #1{\tclose{#1}\endgroup} % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is undesirable in % some manuals, especially if they don't have long identifiers in % general. @allowcodebreaks provides a way to control this. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg'}% \fi\fi } % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle option `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct.' \kbdinputstyle distinct \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. \let\indicateurl=\code \let\env=\code \let\command=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. Perhaps eventually put in % a hypertex \special here. % \def\uref#1{\douref #1,,,\finish} \def\douref#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi } % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Hacks for glyphs from the EC fonts similar to \euro. We don't % use \let for the aliases, because sometimes we redefine the original % macro, and the alias should reflect the redefinition. \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % \def\ecfont{% % We can't distinguish serif/sanserif and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\undefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } %%% Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines \let\tt=\authortt} \parseargdef\title{% \checkenv\titlepage \leftline{\titlefonts\rm #1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\authorfont \leftline{#1}}% \fi } %%% Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\HEADINGSoff{% \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\undefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi \def\itemcontents{#1}% % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. Note that \everycr resets \everytab. \def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we encounter the problem it was intended to solve again. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\realdash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \undefined % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname\donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these in case \tex is in effect and \{ is a \delimiter again. % But can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control% words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\L \definedummyword\OE \definedummyword\O \definedummyword\aa \definedummyword\ae \definedummyword\l \definedummyword\oe \definedummyword\o \definedummyword\ss \definedummyword\exclamdown \definedummyword\questiondown \definedummyword\ordf \definedummyword\ordm % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\expansion \definedummyword\minus \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sc \definedummyword\t % % Commands that take arguments. \definedummyword\acronym \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % Hopefully, all control words can become @asis. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% % how to handle braces? \def\_{\normalunderscore}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\aa{aa}% \def\ae{ae}% \def\l{l}% \def\oe{oe}% \def\o{o}% \def\ss{ss}% \def\exclamdown{!}% \def\questiondown{?}% \def\ordf{a}% \def\ordm{o}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\registeredsymbol{R}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\expansion{==>}% \def\minus{-}% \def\pounds{pounds}% \def\point{.}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\result{=>}% \def\textdegree{degrees}% % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{% \ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this frozes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % \unnumberedno is an oxymoron, of course. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achive this, remember the "biggest" unnum. sec. we are currently in: \chardef\unmlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unmlevel \chardef\unmlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unmlevel \def\headtype{U}% \else \chardef\unmlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % \message{\putwordChapter\space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % \def\appendixnum{\putwordAppendix\space \appendixletter}% \message{\appendixnum}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } \outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } \outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. \outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } \outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}% \bigskip \par\penalty 200\relax \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% \hbox to 0pt{}% \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rm % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. \csname #2fonts\endcsname \rm % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) \vskip-\parskip % % This is purely so the last item on the list is a known \penalty > % 10000. This is so \startdefun can avoid allowing breakpoints after % section headings. Otherwise, it would insert a valid breakpoint between: % % @section sec-whatever % @deffn def-whatever \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. \envdef\tex{% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \escapechar=`\\ % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of \def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt \parindent = 0pt \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it by one command: \def\makedispenv #1#2{ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two synonyms: \def\maketwodispenvs #1#2#3{ \makedispenv{#1}{#3} \makedispenv{#2}{#3} } % @lisp: indented, narrowed, typewriter font; @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvs {lisp}{example}{% \nonfillstart \tt\quoteexpand \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenv {display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenv{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill \gobble } \let\Eflushright = \afterenvbreak % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \envdef\quotation{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\undefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % [Knuth] pp. 380,381,391 % Disable Spanish ligatures ?` and !` of \tt font \begingroup \catcode`\`=\active\gdef`{\relax\lq} \endgroup % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \catcode`\`=\active \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} % Allow an option to not replace quotes with a regular directed right % quote/apostrophe (char 0x27), but instead use the undirected quote % from cmtt (char 0x0d). The undirected quote is ugly, so don't make it % the default, but it works for pasting with more pdf viewers (at least % evince), the lilypond developers report. xpdf does work with the % regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax `% \else \char'22 \fi \else \char'22 \fi } % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen0=\wd0 % the width so far, or since the previous tab \divide\dimen0 by\tabw \multiply\dimen0 by\tabw % compute previous multiple of \tabw \advance\dimen0 by\tabw % advance to next multiple of \tabw \wd0=\dimen0 \box0 \starttabbox }% } \catcode`\'=\active \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}% % \catcode`\`=\active \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}% % \gdef\quoteexpand{\rquoteexpand \lquoteexpand}% \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% \catcode`\`=\active \tabexpand \quoteexpand % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a minor refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remainnig is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } %%% Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } %%% Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } %%% Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } %%% Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } %%% Type: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % How we'll format the type name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % (plain.tex says that \dimen1 should be used only as global.) \parshape 2 0in \dimen0 \defargsindent \dimen2 % % Put the type name to the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% return value type \ifx\temp\empty\else \tclose{\temp} \fi #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. Let's try @var for that. \let\var=\ttslanted #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{% \begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % ... and \example \spaceisspace % % Append \endinput to make sure that TeX does not see the ending newline. % I've verified that it is necessary both for e-TeX and for ordinary TeX % --kasal, 29nov03 \scantokens{#1\endinput}% \endgroup } \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. \def\scanctxt{% \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% \scanctxt \catcode`\\=\other } % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0% \else \expandafter\parsemargdef \argl;% \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname #1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.blah for each blah % in the params list, to be ##N where N is the position in that list. % That gets used by \mbodybackslash (above). % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. \def\parsemargdef#1;{\paramno=0\def\paramlist{}% \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1% \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% % This defines the macro itself. There are six cases: recursive and % nonrecursive macros of zero, one, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \fi \fi} \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout }% \fi } % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% \def\printedrefname{\ignorespaces #3}% \setbox1=\hbox{\printedmanual\unskip}% \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf \leavevmode \getfilename{#4}% {\indexnofonts \turnoffactive % See comments at \activebackslashdouble. {\activebackslashdouble \xdef\pdfxrefdest{#1}% \backslashparens\pdfxrefdest}% % \ifnum\filenamelength>0 \startlink attr{/Border [0 0 0]}% goto file{\the\filename.pdf} name{\pdfxrefdest}% \else \startlink attr{/Border [0 0 0]}% goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd0 = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % if the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd1 > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifdim \wd1 > 0pt \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via a macro so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \fi \endlink \endgroup} % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs \message{\linenumber Undefined cross reference `#1'.}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarily, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing this stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \nobreak\bigskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \line\bgroup \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \egroup \bigbreak \fi % space after the image \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % @documentlanguage is usually given very early, just after % @setfilename. If done too late, it may not override everything % properly. Single argument is the language (de) or locale (de_DE) % abbreviation. It would be nice if we could set up a hyphenation file. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \input txi-#1.tex \fi \closein 1 \endgroup \endgroup} } % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \def\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \input txi-#1.tex \fi \closein 1 } % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? In the current directory should work if nowhere else does.} % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{~} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{~} \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} \gdef^^b2{\missingcharmsg{OGONEK}} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'\i} \gdef^^ee{\^\i} \gdef^^ef{\v d} % \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other \catcode`\$=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} \def\normalunderscore{_} \def\normalverticalbar{|} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active @def@normalbackslash{{@tt@backslashcurfont}} % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. % @def@normalturnoffactive{% @let\=@normalbackslash @let"=@normaldoublequote @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus @let$=@normaldollar %$ font-lock fix @unsepspaces } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore genparse-0.9.1/doc/stamp-vti0000644000076600001440000000014511732677215012677 00000000000000@set UPDATED 18 December 2011 @set UPDATED-MONTH December 2011 @set EDITION 0.9.1 @set VERSION 0.9.1 genparse-0.9.1/doc/mdate-sh0000755000076600001440000001267011341041447012452 00000000000000#!/bin/sh # Get modification time of a file or directory and pretty-print it. scriptversion=2007-03-30.02 # Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software # Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No file. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: mdate-sh [--help] [--version] FILE Pretty-print the modification time of FILE. Report bugs to . EOF exit $? ;; -v | --v*) echo "mdate-sh $scriptversion" exit $? ;; esac # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume `unset' works, revert this # variable to its documented default. if test "${TIME_STYLE+set}" = set; then TIME_STYLE=posix-long-iso export TIME_STYLE fi save_arg1=$1 # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # Avoid user/group names that might have spaces, when possible. if ls -n /dev/null 1>/dev/null 2>&1; then ls_command="$ls_command -n" fi # A `ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named `Jan', or `Feb', etc. However, it's unlikely that `/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set x`$ls_command /` # Find which argument is the month. month= command= until test $month do shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done # Get the extended ls output of the file or directory. set dummy x`eval "$ls_command \"\$save_arg1\""` # Remove all preceding arguments eval $command # Because of the dummy argument above, month is in $2. # # On a POSIX system, we should have # # $# = 5 # $1 = file size # $2 = month # $3 = day # $4 = year or time # $5 = filename # # On Darwin 7.7.0 and 7.6.0, we have # # $# = 4 # $1 = day # $2 = month # $3 = year or time # $4 = filename # Get the month. case $2 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac case $3 in ???*) day=$1;; *) day=$3; shift;; esac # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: genparse-0.9.1/doc/genparse.texi0000644000076600001440000023535511673365613013544 00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename genparse.info @settitle Genparse @c For double-sided printing, uncomment: @c @setchapternewpage odd @c %**end of header @include version.texi @iftex @finalout @end iftex @ifinfo @format INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * Genparse: (genparse). Command line parser generator. END-INFO-DIR-ENTRY @end format Genparse: command line parser generator, by Mike Borella and Michael Geng This file documents the Genparse package for creating command line parser generators in C, C++ and Java. Copyright (C) 1997-2011, Mike Borella, Michael Geng Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Author. @end ifinfo @titlepage @title Genparse @subtitle Command Line Parser Generator @subtitle Edition @value{EDITION}, for Genparse version @value{VERSION} @subtitle @value{UPDATED} @author Mike Borella, Michael Geng @page @vskip 0pt plus 1filll Copyright @copyright{} 1997-2007, Mike Borella, Michael Geng Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Author. @end titlepage @c TABLE OF CONTENTS @contents @c Define an environment variable index. @defcodeindex ev @c Define an output variable index. @defcodeindex ov @c Define a CPP variable index. @defcodeindex cv @c Define a macro index that @@defmac doesn't write to. @defcodeindex ma @node Top, Introduction, (dir), (dir) @comment node-name, next, previous, up @ifinfo This file documents the Genparse package for creating command line parsing routines in C, C++ and Java using a simple descriptive file. This is edition @value{EDITION}, for Genparse version @value{VERSION}. @end ifinfo @c The master menu, created with texinfo-master-menu, goes here. @menu * Introduction:: Overview of Genparse * Making Genparse Files:: Step-by-Step Instructions for Writing Genparse Files * Genparse Options:: * Genparse File Syntax:: * The Future:: * Some History:: * Index:: @end menu @c CHAPTER @node Introduction, Making Genparse Files, Top, Top @chapter Introduction The Genparse package allows the automated creation of command line parsing routines, based on a command line option description file. Given a target language, Genparse outputs a suitable parser. For example, in C, a function is created that reads the command line parameters and stores their values in a data structure. In C++ and Java, a command line parsing class is created, with member functions that return parameter values. @cindex Genparse file The goal of Genparse is to eliminate the effort required to write a command line parser for every newly-developed program. Typically, these parsers all follow a very similar format, with a series of calls to the @code{getopt ()} or @code{getopt_long ()} library functions. Genparse allows users to specify their program's command line options in a concise text file (hereafter, a "Genparse File"). Genparse reads this file, and produces the appropriate parsing routines in the user's language of choice. Users may call the parser's functions from their main code in order to obtain the values of the parameters. In addition to providing a simple interface to the parameters, Genparse also has the following features: @itemize @bullet @item A default value may be provided for each parameter. @item Both short (@code{-o}) and long (@code{--option}) parameters are supported. @item For parameters that take numerical values, Genparse can make sure that the input values fall within a given range. @cindex Usage function @item A @code{usage ()} function is automatically created, which can be used to describe a program's command line parameters. Genparse also allows a description string to be associated with each parameter. These strings will be displayed in the @code{usage ()} function. @item For C and C++ extra include files may be added to any command line parser. @item Each parameter can have a callback function associated with it. Genparse will automatically create a skeleton for callback functions, which the user can fill in. Also, global callback functions can be specified. @item The generated parser is 100% GNU compatible because the parsing itself is done by the GNU getopt_long function. @item The generated code is internationalizable (@xref{internationalize}.). @end itemize @cindex Limitations Currently, we do not believe that Genparse has any significant limitations. It cannot handle dependencies between different options, but the user can write callback function to accomplish this task. A virtually unlimited number of long command line options are available, but only 52 single-character options can be used by a given program. @cindex Contact info Mail suggestions and bug reports for Genparse to @email{mike@@borella.net}. The latest version of Genparse can always be found at @uref{http://genparse.sourceforge.net}. @c CHAPTER @node Making Genparse Files, Genparse Options, Introduction, Top @chapter Making Genparse Files @cindex Genparse files, making In this section we discuss how to write Genparse files and how to invoke Genparse on these files. We take a pedagogical approach, walking through a very simple example program and showing how Genparse can simplify its development. @menu * A Simple Application:: * Adding Command Line Options:: * Simplifying Command Line Parsing with Genparse:: * Include Files and Callbacks:: * C++ Output:: * Java Output:: * Idiosyncrasies:: @end menu @node A Simple Application, Adding Command Line Options, Making Genparse Files, Making Genparse Files @section A Simple Application Suppose that we want to write a C program that outputs a given text file some number of times. This is a simple, and perhaps not terribly useful program, but its simplicity will help illustrate the utility of Genparse. Our program, @command{mycopy1}, might look like this: @example /* mycopy1.c */ #include #include int main (int argc, char *argv[]) @{ int c, i, n; FILE *fp; n = atoi (argv[1]); fp = fopen (argv[2],"r"); for (i = 0; i < n; i++) @{ while ((c = fgetc (fp)) != EOF) fputc (c, stdout); rewind (fp); @} fclose (fp); return 0; @} @end example The user is expected to invoke @command{mycopy1} with two items on the command line: an integer followed by a filename. The former is the number of times that the latter should be displayed. While this program accomplishes what we set out to do, it is not very robust nor user friendly. For example, if the user specifies a negative integer, the program does not display a warning or error message (in fact, it displays nothing). If the user does not know what is expected on the command line, how will he or she find this information out (assuming that nice documentation, such as what you are now reading, does not exist for @command{mycopy1}). Furthermore, wouldn't this program be more flexible if there were a default number of iterations, the user could specify the command line parameters in any order or omit some altogether? All of these issues, and perhaps others, can be addressed in a number of ways. Traditionally, the author of @command{mycopy1} would publish the command line format, typically in a @command{man} page, and write a routine to pull the command line parameters out of the @code{argv} array, assuming that the format was followed (not unlike what we've done for @command{mycopy1}). However, as the number of command line parameters increases, this task becomes much more difficult and cumbersome. @cindex getopt () With the introduction of the @code{getopt ()} and @code{getopt_long ()} functions, now part of the GNU C Library, a great deal of the command line parsing burden was lifted from programmers. The @code{getopt ()} function takes in an @code{argv}-style command line and assumes that it contains a series of command line options. An option is indicated with a single character preceded by a dash - for example, @option{-o} or @option{-Z}. These options may be followed by a command line parameter - for example, @option{-o} or @option{-Z 3}. Using @code{getopt} we could add an @option{-i} to allow the number of iterations to be specified. The advantage to doing so is that it would no longer matter where on the command line @option{-i} appears, and if @option{-i} does not appear at all, we can assign a default number of iterations. @cindex getopt_long () The @code{getopt_long ()} function extends @code{getopt ()}, by allowing long options to coexist with single character options. Long options are preceded by two dashes and may be more than one character long - for example @option{--iterations}. Long options may also take parameters, in the form @option{--option param} or @option{--option=param}. @node Adding Command Line Options, Simplifying Command Line Parsing with Genparse, A Simple Application, Making Genparse Files @section Adding Command Line Options From the previous section's @command{mycopy1}, we will now add command line option parsing with @code{getopt_long ()} to create @command{mycopy2}. Along the way we'll add a small number of useful features. @example /* mycopy2.c */ #include #include #include int main (int argc, char *argv[]) @{ int c, i; FILE *fp; extern char *optarg; extern int optind; int option_index = 0; char ch; int help, iterations; int errflg = 0; static struct option long_options[] = @{ @{"help", no_argument, NULL, 'h'@}, @{"iterations", required_argument, NULL, 'i'@}, @{NULL, 0, NULL, 0@} @}; help = 0; iterations = 1; while ((ch = getopt_long (argc, argv, "hi:", long_options, &option_index)) != EOF) @{ switch (ch) @{ case 'h': help = 1; break; case 'i': iterations = atoi (optarg); if (iterations < 0) @{ fprintf (stderr, "error: iterations must be >= 0\n"); errflg ++; @} break; default: errflg++; @} @} /* while */ if (errflg || help) @{ printf ("usage: %s [ -i ] \n", argv[0]); printf (" [ -h ] [ --help ] Print help screen \n"); printf (" [ -i ] [ --iterations ] Number of times to \ output \n"); exit (1); @} if (optind >= argc) fp = stdin; else fp = fopen (argv[optind],"r"); for (i = 0; i < iterations; i++) @{ while ((c = fgetc (fp)) != EOF) fputc (c, stdout); rewind (fp); @} fclose (fp); return 0; @} @end example This program performs the same function as @command{mycopy1} but does so in a more flexible and reliable fashion. Two command line options are supported, @option{-h} and @option{-i}. When @option{-h}, or its long form, @option{--help}, appears on the command line, all other options are ignored and a usage message is displayed. The @option{-i} option allows the user to specify the number of iterations, as discussed above. It also has a long form, @option{--iterations}. The number of iterations defaults to 1 if @option{-i} does not appear on the command line, and the program prevents negative values from being specified with @option{-i}. The usage message is a useful way of summarizing a program's options without needed a @command{man} or @command{info} page. There are three ways that the usage message for @command{mycopy2} will be displayed: @itemize @bullet @item If the @option{-h} or @option{--help} options appear on the command line. @item If an unknown option appears on the command line. @item If the @option{-i} option appears with a negative value. @end itemize @cindex Command line, rearranging @cindex Optind A nice feature of @code{getopt ()} and @code{getopt_long ()} is that they will rearrange the command line within @code{argv} so that all non-options follow all of the options@footnote{@code{argv[0]} is not rearranged - it remains in its place.}. The external variable @code{optind} is set to point to the first non-option in the re-arranged @code{argv}. Thus, by comparing @code{optind} to @code{argc}, we can determine whether or not an input file has been specified. If there is no input file on the command line, we can redirect @command{mycopy2} to use @emph{stdin}. While @command{mycopy2} is an improvement over @command{mycopy1}, there are a number of drawbacks to using @code{getopt ()} in all of your programs. The most obvious is time. In @command{mycopy2}, two-thirds (about 50 lines) of the code does the command line parsing, and only two options are supported. If there we're 10 options, the command line parsing code could easily reach 200 lines or more. Additionally, since each option's parameter may need to be checked for validity and assigned to a variable, this becomes a tedious process that can be error prone. Observing the source code for @code{mycopy2}, it becomes clear that, like any repetitive task, the command line parsing code follows a number of simple patterns. If these patterns can be abstracted and generalized so that the user can indicate option use in a concise format, most, if not all, of the parsing code can be automatically generated. With this thought in mind, we turn our attention to Genparse. @node Simplifying Command Line Parsing with Genparse, Include Files and Callbacks, Adding Command Line Options, Making Genparse Files @section Simplifying Command Line Parsing with Genparse Genparse automatically creates command line parsing code, not unlike the code in @code{mycopy2.c}. It creates two or three files: a header file, a parsing file, and an optional callback file. In this section, we'll write a Genparse specification for our file copying program and examine the parser that it creates. Genparse runs on a simple input file, which we'll call a Genparse file. In a Genparse file, each command line option is specified on one or more lines. The following code is a Genparse file for @command{mycopy3}. @cindex Genparse file, simple example @example @group /* mycopy3.gp */ i / iterations int 1 [0...] "Number of times to output ." "File should be text format!" o / outfile string @{""@} "Output file name." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end @end group @end example @noindent The naming of this file follows the convention of all Genparse files ending in the extension @code{.gp}. Let's walk through @code{mycopy3.gp}. The first line is a comment. It is ignored by Genparse. The second line is the first option specification. This is the @option{-i} option, which, as before, may be specified in long form as @option{--iterations}. Our @code{mycopy3.gp} file indicates that @option{-i} must take an integer parameter, the default value of which is 1. The allowed range is non-negative. The final part of the third line is a description of the option's usage (to appear in the @code{usage ()} function). The third line introduces a new option, that was not in @command{mycopy2}. The @option{-o} option takes a string parameter (where a "string" is any series of characters) with a default value of empty. As indicated by the description, this option is used to specify an output file to which @command{mycopy3}'s output will be directed. Default values for strings must be specified within braces and quotes like @{"This is a stupid comment"@}, for chars it must be enclosed in single quotes, e.g. 'a' or '\0x13'. For other integers use the plain default value. Starting in the third line the help screen is defined which will be printed if @option{-h} or @option{--help} is set or if an invalid command line is given. @code{__PROGRAM_NAME__} will be replaced with the name of the executable (probably mycopy3), @code{__OPTIONS_SHORT__} will be replaced with a list of allowed short options ("[ -iohv ]" in this example). "Print a file for a number of times to stdout." will be printed verbatim. @code{__GLOSSARY__} will be replaced with a list explanations for each of the command line parameters. For more explanations on the @code{#usage} section @xref{Usage Function}. @code{mycopy3 --help} will print the following help screen: @cindex Genparse, invoking, example @example usage: mycopy3 [ -iohv ] file Print file for a number of times to stdout. [ -i ] [ --iterations ] (type=INTEGER, range=0..., default=1) Number of times to output . File should be text format! [ -o ] [ --outfile ] (type=STRING) Output file name. [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. @end example Genparse can be invoked on @code{mycopy3.gp} in a number of ways (Yes, Genparse has its own command line options! @xref{Genparse Options}.), but we'll invoke it as follows. @cindex Genparse, invoking, example @example genparse -o mycopy3_clp mycopy3.gp @end example @cindex C output @noindent This command tells Genparse to run on @code{mycopy3.gp} and to output program files named with @code{mycopy3_clp}. This particular Genparse file creates only a header file and a parser file since no callbacks are specified. Let's first take a look at the header file, @code{mycopy3_clp.h}. @menu * Header Files:: * Parser Files:: * Main Program:: @end menu @node Header Files, Parser Files, Simplifying Command Line Parsing with Genparse, Simplifying Command Line Parsing with Genparse @subsection Header Files @cindex C header file Below, we walk through @code{mycopy3_clp.h}, an example header file created by Genparse. Header files, such as this one, @emph{must} be included in all linked code that needs to access the command line parameter values. @example /* mycopy3_clp.h */ #include #ifndef bool typedef enum bool_t @{ false = 0, true @} bool; #endif /* customized structure for command line parameters */ struct arg_t @{ int i; char * o; bool h; bool v; int optind; @}; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); @end example Although "real" Genparse output files begin with a section of comments, for purposes of saving space, we'll replace all of those with a short comment containing only the file's name. A Genparse-created header file contains four major sections: (1) includes and type definitions, (2) the definition of @code{struct arg_t}, (3) parsing function prototypes, and (4) callback function prototypes. Since we are not using callbacks in this example, only the first three sections appear in this header file. The file begins with a list of header files to include. Including @code{stdio.h} is the default, and other includes may be specified in the Genparse file. Then the @code{bool} type is conditionally defined. While @code{bool} is typically predefined in C++, it is not in C. It comes in handy as a type for all flag options, which can only be on or off (true or false). The @code{struct arg_t} structure contains a variable for each of the options defined in @code{mycopy3.gp}. This include @code{i}, an integer, and @code{o}, a character pointer. For C output, all variables defined to be strings in Genparse files are declared as character pointers. For C++ output, the C++ string type from the standard C++ library is used. @cindex Option, help @cindex Option, quiet @cindex Option, version In addition to the user-defined options, Genparse adds two extra flag options, @option{-h} and @option{-v}. The @option{-h} option (long form of @option{--help}) will cause the @code{usage ()} function to be called, and the program to terminate. The @option{-v} option (long form of @option{--version}) will be passed back for the calling function to process. It is intended that the caller will display the program's version number if this option is set. Note that if the calling program does not process the @option{-v} flag, its behavior will not be affected by this flag. The @code{optind} variable records the value of the @code{optind} static variable that is used by @code{getopt ()} and @code{getopt_long ()}. However, Genparse has changed the behavior of this variable slightly. (@xref{Parser Files}.) The final section of @code{mycopy3_clp.h} consists of function prototypes for the command line parser @code{Cmdline ()}@footnote{The name of the command line parsing function can be user-defined. @xref{Genparse Options}.}, and the @code{usage ()} function. The @code{Cmdline ()} function is where the meat of Genparse processing occurs. It takes as arguments a pointer to an @code{arg_t} struct which will be filled with the values of the options, and @code{argc} and @code{argv} which should be passed as the @code{main ()} function receives them. Genparse asumes that @code{arg_t} is a valid pointer to an @code{arg_t} struct, the calling program is responsible for properly allocating memory for it. Typically, the parsing function should be called at the beginning of the program. The usage function lists the command line options for the program, as well as any mandatory command line parameters. Once this information is displayed, the program is terminated. For example, the usage function output for @command{mycopy3}, as invoked by the @option{-h} option, is as follows: @example usage: mycopy3 [ -iohqv ] file [ -i ] [ --iterations ] Number of times to output . (default = 1) [ -o ] [ --outfile ] Output file. [ -h ] [ --help ] Display help information. (default = 0) [ -v ] [ --version ] Output version. (default = 0) @end example After displaying a brief list of all single-character options and mandatory options, the usage message lists all options in short and long forms, along with user-defined descriptions and each option's default value. @node Parser Files, Main Program, Header Files, Simplifying Command Line Parsing with Genparse @subsection Parser Files @cindex C parser file In this section we examine the parser file generated from running Genparse on @code{mycopy3.gp}. @example /* mycopy3_clp.c */ #include #include #include #include "mycopy3_clp.h" static struct option const long_options[] = @{ @{"iterations", required_argument, NULL, 'i'@}, @{"outfile", required_argument, NULL, 'o'@}, @{"help", no_argument, NULL, 'h'@}, @{"version", no_argument, NULL, 'v'@}, @{NULL, 0, NULL, 0@} @}; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) @{ extern char *optarg; extern int optind; int c; int errflg = 0; my_args->i = 1; my_args->o = NULL; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "i:o:hv", long_options, &optind)) != EOF) @{ switch (c) @{ case 'i': my_args->i = atoi (optarg); if (my_args->i < 0) @{ fprintf (stderr, "parameter range error: i must be >= 0\n"); errflg++; @} break; case 'o': my_args->o = optarg; break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); @} @} /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; @} /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) @{ if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else @{ printf ("\ usage: %s [ -iohv ] file\n\ Print a file for a number of times to stdout.\n\ [ -i ] [ --iterations ] (type=INTEGER, range=0..., default=1)\n\ Number of times to output .\n\ File should be text format!\n\ [ -o ] [ --outfile ] (type=STRING)\n\ Output file name.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); @} exit (status); @} @end example The parser file consists of two main functions. The @code{usage ()} function displays the program's usage information, then terminates. The parsing function, named @code{Cmdline ()} in this case@footnote{The name of the parser function can be set by the user. @xref{Genparse Options}.}, reads the command line and fills an @code{arg_t} struct with the command line parameters. Since the @code{usage ()} function is straightforward, we will not examine it in detail. Instead, we will focus our attention on @code{Cmdline ()}. This function begins by defining a @code{struct long_options} array based on the specification in the @code{mycopy3.gp} file. This array will tell @code{getopt_long ()} what options to expect on the command line. The @code{struct arg_t} is then initialized and the default parameter values from @code{mycopy3.gp} are set. Once this is complete, @code{getopt_long ()} is looped through until all command line options have been processed. Each option has its own @code{case} in the @code{switch} statement. While this processing is fairly simple, there are several options worth examining in more detail. @itemize @bullet @item For the @option{-h} option, the @code{usage ()} function is automatically called. @item Range checking for @option{-i} occurs. If @option{-i} has a negative value, an error message is printed to @emph{stderr} and the error flag is raised. @end itemize @noindent After the loop over @code{getopt_long ()} is complete, the error flag is checked. If it is raised, or if the help option has been set, the @code{usage ()} function is called. At the end of @code{Cmdline ()}, the behavior of @code{optind} is modified slightly. While @code{optind} is returned to the caller in the @code{struct arg_t}, we set it to 0 if there are no non-option command line parameters. Otherwise, we pass it back as is, so that it can be used as a pointer into @code{argv}. @node Main Program, , Parser Files, Simplifying Command Line Parsing with Genparse @subsection Main Program @cindex C main program Next to specification of the Genparse file, the most important part of using Genparse is interfacing it with user code. In this section, we show the main program code for @code{mycopy3.c} and describe how the routines created by Genparse are used. @example /* mycopy3.c */ #include #include #include "mycopy3_clp.h" #define VERSION "3.0" int main (int argc, char *argv[]) @{ int c, i; FILE *fp, *ofp; struct arg_t a; Cmdline (&a, argc, argv); if (a.v) @{ printf ("%s version %s\n", argv[0], VERSION); exit (0); @} if (a.o) ofp = fopen (a.o, "w"); else ofp = stdout; if (!a.optind) fp = stdin; else fp = fopen (argv[a.optind],"r"); for (i = 0; i < a.i; i++) @{ while ((c = fgetc (fp)) != EOF) fputc (c, ofp); rewind (fp); @} fclose (fp); return 0; @} @end example The @code{mycopy3.c} module begins by including @code{mycopy3_clp.h}, which is necessary for the definition of the @code{arg_t} struct and the parser function prototypes. The @code{Cmdline ()} function fills an @code{arg_t} struct with the command line options. While the parsing function does not always have to be called before all other processing, it must be called before any command line parameters are used. The program then checks a number of the parameters, as returned in the structure. In particular, if the @option{-v} option is set, the version number is displayed and then the program is terminated. If the @code{optind} pointer is set to 0, indicating that there are no non-option parameters on the command line, the input is redirected to @emph{stdin}, If the output file is not specified with the @option{-o} option, output is redirected to @emph{stdout}. @node Include Files and Callbacks, C++ Output, Simplifying Command Line Parsing with Genparse, Making Genparse Files @section Include Files and Callbacks So far, our examples have only considered the basic features of Genparse. In fact, these features are probably more than enough for 90% of all command line parsing needs. However, some programs require additional flexibility. In this section, we explore some of the advanced features of Genparse. @cindex Include files Include files may be specified at the beginning of a Genparse file. They are listed in C style, e.g., @code{#include } or @code{#include "file.h"}. One of the possible uses of include files are for when a macro needs to be used in a Genparse file. Consider the following modification to @code{mycopy3.gp}. @example @group /* mycopy3.gp */ #include i / iterations int 1 [0...MAX] "Number of times to output ." o / outfile string @{""@} "Output file." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end @end group @end example @noindent This example assumes that the macro @code{MAX} is defined in @code{mycopy3.h}. @cindex Callback functions In order to demonstrate the utility of callback functions, let's further modify @code{mycopy3.gp}. In fact, let's just call it @code{mycopy4.gp}. @example @group /* mycopy4.gp */ #include my_callback () i / iterations int 1 [1..MAX] "Number of times to output ." o / outfile string @{""@} outfile_cb () "Output file." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end @end group @end example This file instructs Genparse to create a global callback function @code{my_callback ()} and the option callback function @code{outfile_cb ()}. For these callbacks, Genparse adds prototypes to the header file, a call to the parser file, and callback skeletons in a callback file. Rather than display the whole header and parse files, we'll just show the lines that are added. Callback functions are useful if extra processing needs to occur before one or more parameters are used by the main program. For example, if one parameter is dependent on the values of two others, a user-defined global callback function can contain the logic to check for the proper conditions. @example @group /* mycopy4_clp.h */ /* global and local callbacks */ int my_callback (struct arg_t *); int outfile_cb (char *); @end group @end example In the @code{mycopy4_clp.h} file, prototypes for the global and the option callback functions are added. @example /* mycopy4_clp.c */ @group case 'o': my_args->o = optarg; if (!outfile_cb (my_args->o)) usage (EXIT_FAILURE, argv[0]); break; @end group ... @group if (!my_callback (my_args)) usage (argv[0]); @end group @end example In the @code{mycopy4_clp.c} file, a call to the callback functions is made. If a 0 is returned, an error is assumed and the usage function is called. The main difference in Genparse behavior that including callbacks produces is the creation of a callback file. This file contains skeletons of all of the callback functions. It is up to the user to fill them in. Note that callbacks should return 0 on error and non-zero otherwise. @example /* mycopy4_clp_cb.c */ #include #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** my_callback () ** ** User defined global callback. ** **--------------------------------------------------------------------------*/ int my_callback (struct arg_t *a) @{ return 1; @} /*---------------------------------------------------------------------------- ** ** outfile_cb () ** ** User defined parameter callback. ** **--------------------------------------------------------------------------*/ int outfile_cb (char * var) @{ return 1; @} @end example Note that the @code{struct arg_t} structure must be passed to the global callback, while the option value is expected to be passed in character array format to option callbacks. @node C++ Output, Java Output, Include Files and Callbacks, Making Genparse Files @section C++ Output @cindex C++ output All of our example so far have shown Genparse creating C code. Genparse also supports C++ output. This section examines the difference between C and C++ output and how to interface a program with a command line parsing class created by Genparse. As with C output, Genparse creates two or three C++ output files: a header file, a parser class file, and a callback file. We'll use @code{mycopy4.gp} as input to create these files. We invoke Genparse as follows. @example genparse -l cpp -o mycopy4_clp mycopy4.gp @end example The three created files are named, @code{mycopy4_clp.h}, @code{mycopy4_clp.cc}, and @code{mycopy4_clp_cb.cc}. We'll walk through each one in turn. @menu * Header File:: * Parser File:: * Callback File:: * Main C++ Program:: @end menu @node Header File, Parser File, C++ Output, C++ Output @subsection Header File @cindex C++ header file The code for @code{mycopy4_clp.h} appears below. @example /* mycopy4_clp.h */ #ifndef CMDLINE_H #define CMDLINE_H #include #include #include "mycopy4.h" /*---------------------------------------------------------------------------- ** ** class Cmdline ** ** command line parser class ** **--------------------------------------------------------------------------*/ class Cmdline @{ private: /* parameters */ int _i; std::string _o; bool _h; bool _v; /* other stuff to keep track of */ std::string _program_name; int _optind; public: /* constructor and destructor */ Cmdline (int, char **) throw (std::string); ~Cmdline ()@{@} /* usage function */ void usage (int status); /* return next (non-option) parameter */ int next_param () @{ return _optind; @} /* callback functions */ bool my_callback (); bool outfile_cb (); int i () @{ return _i; @} std::string o () @{ return _o; @} bool h () @{ return _h; @} bool v () @{ return _v; @} @}; #endif @end example The header file contains the definition of the command line parser class. The class defines a logical structure that puts different requirements on the main program than when the output code is in C. We summarize the differences between C and C++ output below. @itemize @bullet @item Each parameter value is stored in a private member variable, and must be accessed through a call to the member function named with the short form of the option. If Genparse was called with the option @option{--longmembers} then this function is named by the long form of the option. @item The name of the executable is stored in a private member variable, but is not available to the via the interface (the main program has access to @code{argv[0]}). @item A copy of the @code{optind} variable is stored in a private member variable, and is accessible through the @code{next_param ()} member function. @item All callbacks are public member functions. @item The usage function is a public member function. @item The constructor throws a string exception if command line parsing fails. @end itemize @node Parser File, Callback File, Header File, C++ Output @subsection Parser File @cindex C++ parser file The parser file defines the non-inlined member functions; i.e., the constructor and the usage function. The code for @code{mycopy4_clp.cc} appears below. @example /* mycopy4_clp.cc */ #include #include #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) @{ extern char *optarg; extern int optind; int c; static struct option long_options[] = @{ @{"iterations", required_argument, NULL, 'i'@}, @{"outfile", required_argument, NULL, 'o'@}, @{"help", no_argument, NULL, 'h'@}, @{"version", no_argument, NULL, 'v'@}, @{NULL, 0, NULL, 0@} @}; _program_name += argv[0]; /* default values */ _i = 1; _h = false; _v = false; optind = 0; while ((c = getopt_long (argc, argv, "i:o:hv", long_options, &optind)) != EOF) @{ switch (c) @{ case 'i': _i = atoi (optarg); if (_i < 1) @{ std::string s; s += "parameter range error: i must be >= 1"; throw (s); @} if (_i > MAX) @{ std::string s; s += "parameter range error: i must be <= MAX"; throw (s); @} break; case 'o': _o = optarg; if (!outfile_cb ()) this->usage (EXIT_FAILURE); break; case 'h': _h = true; this->usage (EXIT_SUCCESS); break; case 'v': _v = true; break; default: this->usage (EXIT_FAILURE); @} @} /* while */ _optind = optind; if (!my_callback ()) usage (EXIT_FAILURE); @} /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) @{ if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else @{ std::cout << "\ usage: " << _program_name << " [ -iohv ] file\n\ Print a file for a number of times to stdout.\n\ [ -i ] [ --iterations ] (type=INTEGER, range=1...MAX, default=1)\n\ Number of times to output .\n\ do it like this\n\ [ -o ] [ --outfile ] (type=STRING)\n\ Output file.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n"; @} exit (status); @} @end example As can be seen from this example, the C++ parser is very similar to the C parser we discussed in @ref{Parser Files}. The main differences are that all strings are stored in C++ @code{string} format@footnote{Older C++ compilers may not support built-in strings. If this is a problem, upgrade your compiler! It's too old anyway.}. It is important to note that the callback file is actually included into the parser file. This is because callbacks are implemented as member functions of the parser class, and most C++ compilers will not allow splitting a class's member functions across more than one file. The bottom line of all this is that you don't have to link in the callback file, just the parser file. @node Callback File, Main C++ Program, Parser File, C++ Output @subsection Callback File @cindex C++ callback file The callback file defines skeleton callback routines for the user to fill in. Their syntax is virtually identical to the C output case, except that their return values are @code{bool} rather than @code{int}. The code for @code{mycopy4_clp_cb.cc} appears below. @example /* mycopy4_clp_cb.cc */ #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::my_callback () ** ** Global callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::my_callback () @{ return true; @} /*---------------------------------------------------------------------------- ** ** Cmdline::outfile_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::outfile_cb () @{ return true; @} @end example @node Main C++ Program, , Callback File, C++ Output @subsection Main Program @cindex C++ main program Due to the syntactic differences between C and C++, the C++ main program must interact with the command line parser class in a different fashion than in the C case. The code for @code{mycopy4.cc} appears below. @example /* mycopy4.cc */ #include #include #include #include "mycopy4_clp.h" using namespace std; #define VERSION "3.0" int main (int argc, char *argv[]) @{ int i; char c; ifstream input_file; ofstream output_file; bool ofile = false, ifile = false; Cmdline cl (argc, argv); if (cl.v ()) @{ cout << argv[0] << " version " << VERSION << endl; exit (0); @} if (!cl.o ().empty ()) @{ output_file.open (cl.o ().c_str ()); ofile = true; @} if (cl.next_param ()) @{ input_file.open (argv[cl.next_param ()]); ifile = true; @} for (i = 0; i < cl.i (); i++) @{ if (ifile) c = input_file.get (); else cin >> c; while (c != EOF) @{ if (ofile) output_file.put (c); else cout << c; if (ifile) c = input_file.get (); else cin >> c; @} if (ifile) @{ input_file.clear (); input_file.seekg (0); @} @} input_file.close (); output_file.close (); return 0; @} @end example Although @code{mycopy4} provide almost identical output and functionality as that of @code{mycopy3}, it must access all command line parameters and related information through the command line parser class interface. @node Java Output, Idiosyncrasies, C++ Output, Making Genparse Files @section Java Output @cindex Java output This section shows the Java output and how to interface a Java program with a command line parsing class created by Genparse. For Java, Genparse creates a Java interface, a parser class that implements it and an exception class that may be thrown by the parser. A separate output file is written for each of them. We'll use @code{mycopy5.gp} as input to create the two output files. Genparse generates Java code as follows. @example genparse -l java -o Cmdline mycopy5.gp @end example The three created files are named, @code{CmdlineInterface.java}, @code{Cmdline.java} and @code{CmdlineEx.java}. We'll walk through each one in turn. @menu * Java Interface:: * Java Implementation:: * Java Exception Class:: * Main Java Program:: @end menu @node Java Interface, Java Implementation, , Java Output @subsection Java Interface @cindex Java interface @example /* CmdlineInterface.java */ /*---------------------------------------------------------------------------- ** ** interface CmdlineInterface ** ** Interface of the command line parser class ** **--------------------------------------------------------------------------*/ public interface CmdlineInterface @{ /* usage function */ void usage (int status, String program_name); /* return next (non-option) parameter */ int next_param (); /* callback functions */ boolean my_callback (); boolean outfile_cb (); /* getter functions for command line parameters */ int i (); String o (); boolean h (); boolean v (); @}; @end example Each parameter value is stored in a private member variable, and must be accessed through a call to the member function named with the short form of the option. If Genparse was called with the option @option{--longmembers} then this function is named by the long form of the option. A copy of the @code{optind} variable is stored in a private member variable, and is accessible through the @code{next_param ()} member function. @node Java Implementation, Java Exception Class, Java Interface, Java Output @subsection Java Implementation @cindex Java implementation @example /* Cmdline.java */ import gnu.getopt.LongOpt; import gnu.getopt.Getopt; /*---------------------------------------------------------------------------- ** ** class Cmdline () ** ** Command line parser class. ** **--------------------------------------------------------------------------*/ public class Cmdline implements CmdlineInterface @{ /* parameters */ private int _i; private String _o; private boolean _h; private boolean _v; /* Name of the calling program */ private String _executable; /* next (non-option) parameter */ private int _optind; /* Must be constructed with parameters. */ public Cmdline (String[] argv) throws CmdlineEx @{ /* character returned by optind () */ int c; LongOpt[] longopts = new LongOpt[4]; longopts[0] = new LongOpt ("iterations", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longopts[1] = new LongOpt ("outfile", LongOpt.REQUIRED_ARGUMENT, null, 'o'); longopts[2] = new LongOpt ("help", LongOpt.NO_ARGUMENT, null, 'h'); longopts[3] = new LongOpt ("version", LongOpt.NO_ARGUMENT, null, 'v'); _executable = Cmdline.class.getName (); /* default values */ _i = 1; _h = false; _v = false; Getopt g = new Getopt (_executable, argv, "i:o:hv", longopts); while ((c = g.getopt ()) != -1) @{ switch (c) @{ case 'i': _i = Integer.parseInt (g.getOptarg ()); if (_i < 1) throw new CmdlineEx ("parameter range error: i must be >= 1"); if (_i > 10) throw new CmdlineEx ("parameter range error: i must be <= 10"); break; case 'o': _o = g.getOptarg (); if (!outfile_cb ()) usage (-1, _executable); break; case 'h': _h = true; usage (0, _executable); break; case 'v': _v = true; break; default: usage (-1, _executable); @} @} /* while */ _optind = g.getOptind (); if (!my_callback ()) usage (-1, _executable); @} public void usage (int status, String program_name) @{ if (status != 0) @{ System.err.println ("Try `" + program_name + " --help' for more information."); @} else @{ System.out.println ( "usage: " + program_name + " [ -iohv ] file\n" + "Print a file for a number of times to stdout.\n" + " [ -i ] [ --iterations ] (type=INTEGER, range=1...10, default=1)\n" + " Number of times to output .\n" + " do it like this\n" + " [ -o ] [ --outfile ] (type=STRING)\n" + " Output file.\n" + " [ -h ] [ --help ] (type=FLAG)\n" + " Display this help and exit.\n" + " [ -v ] [ --version ] (type=FLAG)\n" + " Output version information and exit."); @} System.exit (status); @} /* return next (non-option) parameter */ public int next_param () @{ return _optind; @} /* Callback functions */ /* Derive your own class and overwrite any of the callback */ /* functions if you need customized callbacks. */ public boolean my_callback () @{ return true; @} public boolean outfile_cb () @{ return true; @} /* getter functions for command line parameters */ public int i () @{ return _i; @} public String o () @{ return _o; @} public boolean h () @{ return _h; @} public boolean v () @{ return _v; @} @} @end example There is no default constructor. Instead the parser class must be constructed with an array of strings which is usually the argument to the @code{main ()} function. The constructor throws an exception if command line parsing fails. The exception type is defined in @xref{Java Exception Class}. Note that no separate callback file is generated like for C or C++. The parser class contains default implementations for each of the callback functions, if you need customized callbacks then simply derive your own class from the generated parser class. @node Java Exception Class, Main Java Program, Java Implementation, Java Output @subsection Java Exception Class @cindex Java exception class @example /* CmdlineEx.java */ /*---------------------------------------------------------------------------- ** ** class CmdlineEx ** ** Exception class thrown by the command line parser class ** **--------------------------------------------------------------------------*/ public class CmdlineEx extends RuntimeException @{ public CmdlineEx (String text) @{ super (text); @} @} @end example This exception class is always the same of course. Only the name of the class would change if --parsefunc was set with a different name than Cmdline. @node Main Java Program, , Java Exception Class, Java Output @subsection Main Java Program @cindex Java main program The example code for Java is very similar to the C++ example (@xref{Main C++ Program}.). @example /* mycopy5.java */ import gnu.getopt.LongOpt; import gnu.getopt.Getopt; import java.io.*; class mycopy5 @{ public static void main (String args[]) @{ final String _executable = "mycopy5"; /* Don't know how to set this automatically in Java */ final String VERSION = "3.0"; final int EOF = - 1; /* Is EOF predefined in Java? */ int i; int c; int length; OutputStreamWriter output_file; InputStreamReader input_file; boolean ofile = false, ifile = false; Cmdline cl = new Cmdline (args); if (cl.v ()) @{ System.out.println (_executable + " version " + VERSION); System.exit (0); @} try @{ length = cl.o ().length (); if (length != 0) @{ output_file = new OutputStreamWriter (new FileOutputStream (cl.o ())); ofile = true; @} else @{ output_file = new OutputStreamWriter (System.out); @} if (cl.next_param () != 0) @{ input_file = new InputStreamReader (new FileInputStream (args[cl.next_param ()])); ifile = true; @} else @{ input_file = new InputStreamReader (System.in); @} for (i = 0; i < cl.i (); i++) @{ c = input_file.read (); while (c != EOF) @{ output_file.write (c); c = input_file.read (); @} if (ifile) @{ input_file.close (); input_file = new InputStreamReader (new FileInputStream (args[cl.next_param ()])); @} @} input_file.close (); output_file.close (); @} catch (IOException ex) @{ System.out.println ("File I/O error: " + ex); @} System.exit (0); @} @} @end example @node Idiosyncrasies, , Java Output, Making Genparse Files @section Idiosyncrasies @cindex Idiosyncrasies Although Genparse has been designed to be as flexible as possible, it will always be more limited than manual command line parsing or using @code{getopt ()}. In this section, we document some of the strange and unusual behavior of Genparse. @itemize @bullet @item In order to specify an option that only has a long form, you must specify the token "NONE" in place of the short option. For example @example NONE / longonly flag @end example specified a flag option that only has a long form (@option{--longonly}). @item The @option{-h} and @option{-v} options will always exist. Their default behavior can be overridden, but Genparse cannot create parsers without them. (@xref{Genparse Options}.) @item In a parser, the @option{-h} option will automatically call the usage function if and only if the long form of the option is @option{--help}. Otherwise, Genparse assumes that the user has overridden @option{-h} and treats it like any other option. @cindex Linking @item For C output you must link in both the parser and the callback files. For C++ output, you only need to link in the parser file. @xref{Parser File}. @end itemize @c CHAPTER @node Genparse Options, Genparse File Syntax, Making Genparse Files, Top @chapter Genparse Options @cindex Options In this section we present the command line options that Genparse accepts, along with their default values. Genparse's command line parsing functions were created by Genparse (talk about bootstrapping), so you can expect Genparse to behave like any other program with Genparse-enabled command line parsing. @itemize @bullet @cindex C++ filename extensions @item @strong{@option{-c} / @option{--cppext}}: C++ file extension. There are a number of valid C++ file extensions, such as "C", "cc", "cpp",and "cxx". This option allows the user to specify which one should be used for the C++ files created by Genparse. The default value is "cc". If C++ is not the output language, this option is ignored. @item @strong{@option{-d}}: Debug mode. Setting this flag turns on debugging in the form of logging to a file and @command{bison} debug output to @emph{stderr}. The name of the debug/log file can be specified with the @option{-f} option (see below). The default value is off. Only useful for debugging Genparse itself. @item @strong{@option{-f} / @option{--logfile}}: Name of log file. Only used if debugging (@option{-d} option) is turned on. All debug output will be written to this file. Currently this consists of the processing of the Genparse file and dumping the state of the command line parameter list class. The default value is "genparse.log". Only useful for debugging Genparse itself. @item @anchor{gnulib}@strong{@option{-g} / @option{--gnulib}}: Use GNU Compatibility Library (Gnulib, see @uref{http://www.gnu.org/software/gnulib/}). Only available for C output. Allows some more types (unsigned long, intmax_t etc.) for which Gnulib provides conversion functions. @item @strong{@option{-h} / @option{--help}}: Help instructions. This option displays the usage of Genparse with a list of all command line options, then terminates the program. The default is off. @item @anchor{internationalize}@strong{@option{-i} / @option{--internationalize}}: Put internationalization macro _() around text output so that the generated program can be internationalized using the GNU gettext command. Presently only implemented for C output. @item @strong{@option{-l} / @option{--language}}: Output language. The programming language in which Genparse writes the output files. Currently only C, C++ and Java are supported. The default is C. To indicate C++, the following strings may be used: "c++", "cpp", "cc", and "cxx". In order to generate Java code use "java" or "Java". @item @strong{@option{-m} / @option{--longmembers}}: Use long options for the members of the parser class (struct). The default is to use the short representation except if there is only a long representation defined in the genparse file. If this option is set then the behavior is reverted. The long representation is used then except if there is only a short representation defined. @item @strong{@option{-o} / @option{--outfile}}: Output file name. Specifies the main part of the output file name. The extension will be determined by the output language and possibly by other options. For example, when the output language is C, giving this option an argument of "file" will result in output file names of "file.h", "file.c" and "file_cb.c" for the header, parser, and callback files, respectively. Default value is "parse_cl". Use the @option{-D} option in order to specify a directory for the results. @item @strong{@option{-p} / @option{--parsefunc}}: Name of the parsing function/class. This option allows the user to specify the name of the function (for C) or class (for C++ and Java) that does the actual command line parsing. Default value is "Cmdline". In Java this value is also used as a prefix for the names of the interface and the exception class. Leaving the default names the interface "CmdlineInterface" and the exception class "CmdlineEx". @item @strong{@option{-P} / @option{--manyprints}}: Output help text for every command line parameter in a separate print command. @item @strong{@option{-q} / @option{--quiet}}: Quiet mode. @item @strong{@option{-s} / @option{--static-headers}}: Keep the descriptive header on top of the generated files static. Without this option genparse prints creation date and time, Linux kernel version, kernel build time, computer architecture name, host name and user name. @item @strong{@option{-v} / @option{--version}}: Version. If this option is set, the version number is displayed, then the program is terminated. The default value is off. @item @strong{@option{-D} / @option{--directory}}: Directory for storing results. @end itemize @cindex Overriding default options The @option{-h} and @option{-v} options can be overridden by defining them to be something else in the Genparse file. However, they cannot be turned off completely. In other words, you can define your own @option{-h} and @option{-v} options or let Genparse create them with the default behavior. @c CHAPTER @node Genparse File Syntax, The Future, Genparse Options, Top @chapter Genparse File Syntax @cindex Genparse file syntax @menu * Global Definitions:: * Parameter Definitions:: * Usage Function:: * Genparse File Grammar:: @end menu @node Global Definitions, Parameter Definitions, , Genparse File Syntax @section Global Definitions The following definitions are allowed on top of the parameter definitions. All of them are optional. They may appear in any order. @itemize @bullet @item @anchor{Include files}@strong{Include files}: Include statements in the C syntax, e.g. @code{#include "file.h"} or @code{#include }. Ignored in languages other than C and C++. Only 1 include statement per line. @item @strong{Mandatory parameters}: Parameters which must be specified. They are not bound to any command line options. Example: @code{#mandatory x}. Use multiple @code{#mandatory} statements in order to specify multiple mandatory parameters. Only 1 @code{#mandatory} statement per line. Note that Genparse does not check for mandatory parameters, they are only printed in the @code{usage ()} function with the @code{__MANDATORIES__} directive (@xref{__MANDATORIES__}.). @strong{Deprecated: add mandatory parameters in the #usage section instead.} @item @strong{Exit value}: Defines the exit value in case of an error. Default is @code{EXIT_FAILURE}. Example: @code{#exit_value -1} or @code{#exit_value MY_FAILURE}. @item @anchor{#break_lines}@strong{#break_lines}: Width to which lines shall be broken on the help screen. If no @code{#break_lines} directive is specified then lines will be printed exactly as given in the genparse file. Note that genparse doesn't know the width of macros included from other files, so automatic line breaking will probably not work properly if for example @code{__STRING__} macros (@xref{__STRING__}.) are used. Lines can still be broken manually using the @code{__NL__} macro (@xref{__NL__}.) in places where Genparse doesn't break lines as expected. @item @strong{#no_struct}: If @code{#no_struct} is specified then no struct will be defined which will be filled with the command line parameters in the generated parser. This may be useful if you want to add your own code with @code{__CODE__} statements instead (@xref{__CODE__}.) Only supported for C output. @item @strong{#export_long_options}: If @code{#export_long_options} is defined then a function @code{get_long_options ()} is added which exports the longoptions array used by @code{getopt_long ()}. This directive is only available for C output, for other languages it is ignored. @item @strong{Global callback}: The name of a global callback function which will be called after all parameter specific callback functions. Example: @code{my_callback ()}. Only 1 global callback function is allowed. @end itemize @node Parameter Definitions, Usage Function, Global Definitions, Genparse File Syntax @section Parameter Definitions Each command line parameter must be defined in the form @example short_names[*|!] [/ long_name[*|!][=opt_name]] type [ options ] @end example A short_name is a single letter (small or capital) or a single digit. long_name is a longer (more descriptive) option name. On the command line a short name will be preceded by a single dash (e.g. @code{-a}) and a long version will be preceded by two dashes (e.g. @code{--all}). If a long parameter name is not necessary, you may specify only the short one (and the slash need not appear). In order to specify a parameter that only has a long name set short_names to @code{NONE}. It is possible to have multiple short options, so for example setting short_name to 'aA' and long_name to 'all' would allow to specify the command line switch as @code{-a} or @code{-A} or @code{--all}, all of them doing the same thing. long options can be followed by a descriptive designation (@xref{opt_name}.). @anchor{optional_arguments}A @code{*} after @code{short_name} or @code{long_name} makes the argument optional. This can be specified for short and long options separately. A @code{!} after @code{short_name} or @code{long_name} makes the option boolean. This allows one to combine a boolean short option with a long option with an optional or mandatory argument or to combine a boolean long option with a short option with an optional or mandatory argument. A @code{!} doesn't make sense if the option's type is @code{flag}. Examples: @example o* / oparam* string "Both short and long option have an optional" "argument" p* / pparam string "Short option has an optional argument," "long option requires an argument." q / qparam* string "Short option reqires an argument," "long option has an optional argument." P* / Pparam! string "Short option has an optional argument," "long option none." Q!/ Qparam* string "Short option has no argument, long option has an" "optional argument." @end example type must be one of @code{int} @code{float} @code{char} @code{string} or @code{flag}. The first four should be self-explanatory. The last is a "switch" option that takes no arguments. For C output and if @option{--gnulib} (@xref{gnulib}.) is set on the command line additionally the following types are allowed: @code{long} (for long int), @code{ulong} (for unsigned long int), @code{intmax} (for intmax_t, defined in Gnulib), @code{uintmax} (for uintmax_t), @code{double}. The following four options are supported. They may appear in any order and except for descriptions only one of each field may be defined per option. @itemize @bullet @item A @strong{default value} for the parameter. For a string this is just the plain default value, whatever it is. For strings, a default must be specified within braces and quotes, and may include whitespace, e.g. @{"my default value"@}. For a char parameter it must be enclosed in single quotes, e.g. 'a' or '\n'. @item @anchor{range}A @strong{range} of values within brackets. The low and high values are specified between a range specifier (either '...' or '..'). Either the high or the low value may be omitted for a range bounded on one side only. The parameter will be checked to make sure that it lies within this range. @item A @strong{callback function}. This function is called after any range checking is performed. The purpose of the callback to do validity checking that is more complicated than can be specified in the genparse file. For example, you might write a program that requires input to be prime numbers, strings of a certain length, etc. @item A @anchor{parameter-description}@strong{description} in double quotes. It is printed by the @code{usage ()} function. If one line is not enough then specify multiple descriptions, one per line and each of them in double quotes. If the description starts in the 1st column in the Genparse file then it will also be printed in the 1st column in the @code{usage ()} function. @item A @strong{Genparse include file}. Includes another Genparse (.gp) file, e.g @code{#gp_include another.gp}. Only parameter definitions are allowed in the included file, no global directives. @item An @strong{__ERR_MSG__(err_txt)} directive. Specifies the error message which is printed when the argument could not be converted. Example: @code{__ERR_MSG__("%s: invalid argument")}. This message will be printed when either the conversion function failed or when the argument was out of range (@xref{range}.). Assumes to contain one @code{%s} which will be replaced with the agrument which could not be converted. Only available when Genparse is invoked with @option{--gnulib} (@xref{gnulib}.), ignored otherwise. Optionally a conversion function can be added as a second argument, e. g. @code{__ERR_MSG__("%s: invalid argument", quotearg)}. This would lead to an error message like @code{error (EXIT_FAILURE, 0, "%s: invalid argument", quotearg (optind))}. @item An @strong{__ADD_FLAG__} directive. Makes sense only if the command line parameter is not already a flag, in this case an additional flag parameter is added which will be set if the command line parameter was specified on the command line. This option is automatically set if a parameter has an optional argument. @item @anchor{__CODE__}A @strong{__CODE__(statements)} directive. The specified code statements are copied literally. Example: @code{__CODE__(printf ("Parameter x was set");)}. The specified code can extend over more than one line. In order to give Genparse the chance to indent the code properly, do not mix space and tab indentations in one @code{__CODE__} statement. @item A @strong{__STORE_LONGINDEX__} directive. Instructs Genparse to add an interer type field to the result class which will be set to the longindex variable (last argument in the call to @code{getopt_long ()}). This new field will get the same name as the result field it is related to but with an @code{_li} postfix. @end itemize @node Usage Function, Genparse File Grammar, Parameter Definitions, Genparse File Syntax @section Usage Function Genparse also generates a usage () function which prints a help text to stdout about the usage of the program for which Genparse is generating the parser. It is automatically executed when @itemize @bullet @item The command line option -h is set. @item An invalid command line option is given. @item The optind_long function call (which is the heart of every Genparse generated parser) returns an error code. @end itemize This usage function can be customized by specifying a usage section at the bottom of the Genparse file. If no such section is specified it defaults to @example #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ __MANDATORIES__ __GLOSSARY__ #usage_end @end example The usage section starts with @code{#usage_begin} and ends with @code{#usage_end}. Any text between is printed verbatim except for the following keywords, which will be replaced as listed below: @itemize @bullet @item @code{__PROGRAM_NAME__}: The program name. In C and C++ the program name is given in @code{argv[0]}. @item @code{__OPTIONS_SHORT__}: A list of available short form options, e.g. @code{[ -abc ]}. @item @anchor{__MANDATORIES__}@code{__MANDATORIES__}: A list of all mandatory parameters as defined with @code{#mandatory} commands (@xref{Global Definitions}.). @strong{Deprecated: List mandatory parameters here directly.} @item @anchor{__GLOSSARY__}@code{__GLOSSARY__}: A description of all command line options. This is the information given for the parameter definitons (see @xref{Parameter Definitions}.) in human readable form. It includes the parameter type, default, range and any comments. A line which contains @code{__GLOSSARY__} is replaced by the glossary of the parameters, any other text in the same line is ignored. Example: @example [ -h ] [ --help ] (type=FLAG) Display help information. @end example @item @anchor{__GLOSSARY_GNU__}@code{__GLOSSARY_GNU__}: Same as @code{__GLOSSARY__} but in GNU style. Optionally followed by an integer in brackets which specifies the indentation of the descriptive text (e.g. @code{__GLOSSARY__(30)}). Default indentation is 24. Example: @example -h, --help Display help information. @end example @item @anchor{__STRING__}@code{__STRING__(s)}: A string constant, in C probably a string macro defined with the #define preprocessor command. This macro can be imported from another file using the include directive in the genparse file (@xref{Include files}.). Ignored when generating Java output. @item @code{__INT__(x)}: An integer constant, in C probably an integer macro defined with the #define preprocessor command. This macro can be imported from another file using the include directive in the genparse file (@xref{Include files}.). Ignored when generating Java output. @item @code{__CODE__(statements)}: @xref{__CODE__}. @item @code{__DO_NOT_DOCUMENT__}: Any line which contains this macro will not be printed in the @code{usage ()} function. Can be used for implementing command line parameters without listing them on the help screen. @item @anchor{__NL__}@code{__NL__}: New line. Useful for breaking lines manually while automatic line breaking is on (@xref{#break_lines}.). Ignored when generating Java output. @item @code{__NEW_PRINT__}: Close the active print command and start a new one. @item @code{__COMMENT__(text)}: Comment in the code for printing the usage text. @end itemize @anchor{opt_name}long options can be followed by an @code{=} sign and an optional designation @code{opt_name} in the genparse file (@xref{Parameter Definitions}.) which can be referred to in the following description (@xref{parameter-description}.). It will be used in the @code{usage ()} function only. For example the following genparse line @example s / block-size=SIZE int "use SIZE-byte blocks" @end example will lead to the following line in the help screen @example [ -s ] [ --block-size=SIZE ] (type=INTEGER) use SIZE-byte blocks @end example in genparse style (@xref{__GLOSSARY__}.) or @example -s, --block-size=SIZE use SIZE-byte blocks @end example in GNU style (@xref{__GLOSSARY_GNU__}.). It is also possible to put square braces around the optional name in order to indicate that the argument is optional. This has no meaning for the generated parser however. Use @code{*} postfixes in order to make an argument optional (@xref{optional_arguments}.). @example s* / block*[=SIZE] int "use blocks." "If SIZE is not given then they will get a size of 1kB." @end example will lead to the following line in the help screen @example -s, --block[=SIZE] use blocks. If SIZE is not given then they will get a size of 1kB. @end example For an example of the generated default usage () function in C @xref{Parser Files}. @node Genparse File Grammar, , Usage Function, Genparse File Syntax @section Genparse File Grammar @cindex Genparse File Grammar In order to better understand the subtleties of the Genparse file format and its parsing, in the section we provide the formal grammar of Genparse files. This is a slightly edited version of the @command{bison} grammar. Items in capitals are tokens that are defined in the lex file. @example all: globals entries usages globals: /* empty */ | globals global | global global: include | mandatory | exit_value | break_lines | export_long_options | no_struct | global_callback include: #include mandatory: #mandatory exit_value: #exit_value break_lines: #break_lines export_long_options: #export_long_options no_struct: #no_struct global_callback: callback entries: entries entry | entry entry: new_entry | gp_include new_entry: param type options options: options option | option option: default | range | callback | descs | store_longindex | err_msg | comment | code_lines descs: descs desc | desc err_msg: __ERR_MSG__ ( ALNUM ) | __ERR_MSG__ ( QUOTED ) comment: __COMMENT__ ( COMMENT_STR ) gp_include: #gp_include param: short_params | NONE / long_param | short_params / long_param short_params: VAR | VAR * | VAR ! long_param: multi_long_option | multi_long_option mandatory_opt_name | multi_long_option optional_opt_name mandatory_opt_name: EQUAL C_VAR | EQUAL OPT_NAME optional_opt_name: [ mandatory_opt_name ] multi_long_option: VAR | VAR * | VAR ! type: INT | LONG | ULONG | INTMAX | UINTMAX | FLOAT | DOUBLE | STRING | CHAR | FLAG default: ALNUM | CHAR_VAL | QUOTED_STR range: [ contiguous_range ] contiguous_range: ALNUM range_spec more_range | range_spec more_range more_range: ALNUM | C_VAR | range_spec: .. | ... callback: VAR () description: QUOTED_STR usages: /* empty */ | usages usage | usage usage: USAGE_STR code_lines: code_lines code_line | code_line code_line: single_code_line CODE_END | CODE_END ; single_code_line: CODE_LINE | OPEN_ROUND_BRACE | CLOSE_ROUND_BRACE | single_code_line single_code_line @end example @c CHAPTER @node The Future, Some History, Genparse File Syntax, Top @chapter The Future While there's practically no limit to the number of enhancements that could be made to Genparse, I'll limit this section to a number of features that actually have a chance of being implemented. @itemize @bullet @item Back up output files before overwriting them. Minimally, old callback files should be saved, because those are meant to be modified by the user. This isn't hard, but I'd like to do it "right" by encapsulating the functionality into a general-purpose file manipulation class. @item Enumerated types for strings. Currently command line strings are not checked for any sort of validity. This would allow the user to specify a list of valid values for a particular string. The syntax would probably be like an enumerated type in C. @item A way to distinguish between optional and mandatory non-option command line parameters. @item Support for more output languages. Perhaps tcl and perl first, and other scripting languages afterwards. This should be pretty easy to do since it would only require adding the appropriate member functions to the command line parameter list class and a little bit of supporting code here and there. @item Place @command{getopt.h}, @command{getopt.c}, and @command{getopt_internal.c} in a neutral shared directory so that others can copy them locally for their own use. @end itemize @c CHAPTER @node Some History, Index, The Future, Top @chapter Some History @cindex History Long, long ago in a lab far, far away, I became frustrated with the time required to write command line parsing routines, even with @code{getopt ()}, for all of the new programs that I developed. I felt that it was tedious work that offered too many opportunities to cut corners and produce error-prone code. In late 1997, the seeds of Genparse fell together in my head, and I released version 0.1, written in C, on New Year's Day, 1998. The only output language supported was C, and it did not allow long options. Parameter types were limited to flags, integers, floats, and strings, and range checking was supported. It soon became clear that although Genparse was fairly useful (I was already using it to create parsers for my own projects), it was severely limited and could use a number of additional features. With the help of a handful of people who provided feedback and constructive criticism, version 0.2 was soon released. New features included a more flexible Genparse file format (essentially, the current format) which was parsed by @command{lex} and @command{bison} rather than by my C code. Parameter descriptions and callback functions were now supported. A few bug fixes later, version 0.2.2 was released. It was to remain current for over a year. In June 1999, I revisited Genparse to add the @code{#include} and @code{#mandatory} directives, as well as to clean up the code a bit and perform some minor bug stomping. The resulting version 0.3 was distributed with Debian/GNU Linux. During my revision that produced 0.3, I became aware of the acute coding slop that had evolved. To call the output functions "spaghetti logic" would have been an understatement. Naturally, I needed to modularize Genparse, and the best way of doing so seemed to be a re-write in C++. In December 1999, I undertook this task. The code became separated into three logical sections: @itemize @bullet @item The parser, a @command{bison} grammar with supporting code. @item An internal representation, encapsulated in a C++ class. @item Output functions for each supported language, built into the C++ class. @end itemize This design greatly improved the extensibility of Genparse. In order to support a new output language, one only needs to add appropriate member functions to the C++ class. This implementation became version 0.4. An important part of 0.4 was support for C++ as an output language. Rather than returning a @code{struct} containing the command line parameter values, a C++ command line parser would be encapsulated by a C++ class. The user would call the member functions of this class to access parameter values, making for a cleaner interface than C can support. Version 0.4 also included a more comprehensive set of test suites along with the documentation that you currently are reading. In Fall 2000, I revisited Genparse. Version 0.4 did not support options with no short form, and thus was limited to 52 options at most. Version 0.5 lifted this restriction, included @command{} rather than the depreciated @command{} in output files, and fixed up user-defined include files so that they worked with quotes as well as "<>". Also, I finally figured out how to get Genparse to reliably compile on systems both with and without the @command{getopt_long ()} function. Version 0.5.1 fixed a few problems with the lexical analyzer that resulted in default values for floats not being used properly. This version also eliminated the mandatory use of the @option{-q} option. @node Index, , Some History, Top @chapter Index @printindex cp @bye genparse-0.9.1/doc/genparse.10000644000076600001440000003575511673365613012735 00000000000000.\" -*- nroff -*- .TH GENPARSE 1 2008-01-19 "" "Programmer's Manual" .SH NAME genparse \- command line parser generator .SH SYNOPSIS .B genparse .RI [ options ] " files" ... .SH "DESCRIPTION" \fBgenparse\fP is a generic command line parser generator. From simple and concise specification file, you can define the command line parameters and switches that you would like to be able to pass to your program. Genparse creates the C, C++ or Java code of the parser for you. .PP Genparse assumes that the GNU getopt_long(3) function is built into your C library. For Java you may have to specify an appropriate jar file to your Java compiler. .SH OPTIONS \fBgenparse\fP accepts these options: .TP .BR -c , " --cppext " \fIextension\fP C++ file extension. (default = cc) .TP .BR -d Turn on logging. .TP .BR -f , " --logfile " \fIname\fP Log file name. (default = genparse.log) .TP .BR -h , " --help" Display help information. .TP .BR -g , " --gnulib" Use GNU Compatibility Library (Gnulib, see \fIhttp://www.gnu.org/software/gnulib/\fP). Only available for C output. Allows some more types (unsigned long, intmax_t etc.) for which Gnulib provides conversion functions. .TP .BR -i , " --internationalize" Put internationalization macro _() around text output so that the generated program can be internationalized using the GNU gettext command. Presently only implemented for C output. .TP .BR -l , " --language " \fIlang\fP Output language. Only C, C++ and Java are supported. Any of the following indicate C++: "c++", "cpp", "cc", and "cxx". For Java use: "java" or "Java". (default = c) .TP .BR -o , " --outfile " \fIname\fP Output file name. (default = parse_cl) .TP .BR -m , " --longmembers" Use long options for the members of the parser class (struct). The default is to use the short representation except if there is only a long representation defined in the genparse file. If this option is set then the behavior is reverted. The long representation is used then except if there is only a short representation defined. .TP .BR -o , " --outfile " \fIfilename\fP Root name of output file. The extension will be determined by the output language and possibly by other options. For example, when the output language is C, giving this option an argument of "file" will result in output file names of "file.h", "file.c" and "file_cb.c" for the header, parser, and callback files, respectively. Default value is "parse_cl". .TP .BR -p , " --parsefunc " \fIfunc\fP Name of parsing function / class. This option allows the user to specify the name of the function (for C) or class (for C++ and Java) that does the actual command line parsing (default = "Cmdline"). .TP .BR -P , " --manyprints" Output help text for every command line parameter in a separate print command. .TP .BR -q , " --quiet" Quiet mode - no on screen output. .TP .BR -s , " --static-headers" Keep the descriptive header on top of the generated files static. Without this option genparse prints creation date and time, Linux kernel version, kernel build time, computer architecture name, host name and user name. .TP .BR -v , " --version" Output version. .TP .BR -D , " --directory " Directory for storing results. .SH "INPUT FILE" A genparse specification file (usually just called a 'genparse file') consists of a number of entries, one per command line parameter, of the form: .sp .IR short_names "[*|!] [/ " "long_name" [*|!][= "opt_name" ]] " type " [ " options " ] .sp A \fIshort_name\fP is a single character (small or capital) or a single digit. \fIlong_name\fP is a longer (more descriptive) option name. On the command line a short name will be preceded by a single dash (e.g. '\-a') and a long version will be preceded by two dashes (e.g. '\-\-all'). If a long parameter name is not necessary, you may specify only the short one (and the slash need not appear). In order to specify a parameter that only has a long name set \fIshort_names\fP to \fBNONE\fP. It is possible to have multiple short options, so for example setting \fIshort_name\fP to 'aA' and \fIlong_name\fP to 'all' would allow to specify the command line switch as '\-a' or '\-A' or '\-\-all', all of them doing the same thing. .sp A \fB*\fP after \fIshort_name\fP or \fIlong_name\fP makes the argument optional. This can be specified for short and long options separately. .sp A \fB!\fP after \fIshort_name\fP or \fIlong_name\fP makes the option boolean. This allows one to combine a boolean short option with a long option with an optional or mandatory argument or to combine a boolean long option with a short option with an optional or mandatory argument. A \fB!\fP doesn't make sense if the option's type is \fBflag\fP. .PP \fItype\fP must be one of \fBint float char string\fP or \fBflag\fP. The first four should be self-explanatory. The last is a "switch" option that takes no arguments. For C output and if \-\-gnulib is set on the command line additionally the following types are allowed: \fBlong\fP (for long int), \fBulong\fP (for unsigned long int), \fBintmax\fP (for intmax_t, defined in Gnulib), \fBuintmax\fP (for uintmax_t), \fBdouble\fP. .PP The following \fIoptions\fP are supported. They may appear in any order and except for \fBdescriptions\fP only one of each field may be defined per option. .sp .RS A \fBdefault value\fP for the parameter. For a string this is just the plain default value, whatever it is. For strings, a default must be specified within braces and quotes, and may include whitespace, e.g. {"my default value"}. For a char parameter it must be enclosed in single quotes, e.g. 'a' or '\\n'. .PP A \fBrange\fP of values within brackets. The low and high values are specified between a range specifier (either '...' or '..'). Either the high or the low value may be omitted for a range bounded on one side only. The parameter will be checked to make sure that it lies within this range. .PP A \fBcallback function\fP. This function is called after any range checking is performed. The purpose of the callback to do validity checking that is more complicated than can be specified in the genparse file. For example, you might write a program that requires input to be prime numbers, strings of a certain length, etc. .PP A \fBdescription\fP in double quotes. It is printed by the \fBusage()\fP function. If one line is not enough then specify multiple descriptions, one per line and each of them in double quotes. If the description starts in the 1st column in the Genparse file then it will also be printed in the 1st column in the \fBusage()\fP function. .PP A \fB#gp_include\fP directive will instruct genparse to include another genparse file, e.g \fB#gp_include another.gp\fP. Only parameter definitions are allowed in the included file, no global directives. .PP An \fB__ERR_MSG__(err_txt)\fP directive. Specifies the error message which is printed when the argument could not be converted. Example: \fB__ERR_MSG__("%s: invalid argument")\fP. This message will be printed when either the conversion function failed or when the argument was out of range. Assumes to contain one \fB%s\fP which will be replaced with the agrument which could not be converted. Only available when Genparse is invoked with \fB--gnulib\fP, ignored otherwise. .PP Optionally a conversion function can be added as a second argument, e. g. \fB__ERR_MSG__("%s: invalid argument", quotearg)\fP. This would lead to an error message like \fBerror (EXIT_FAILURE, 0, "%s: invalid argument", quotearg (optind))\fP. .PP An \fB__ADD_FLAG__\fP directive. Makes sense only if the command line parameter is not already a flag, in this case an additional flag parameter is added which will be set if the command line parameter was specified on the command line. This option is automatically set if a parameter has an optional argument. .PP A \fB__CODE__(statements)\fP directive. The specified code statements are copied literally. Example: \fB__CODE__(printf ("Parameter x was set");)\fP. The specified code can extend over more than one line. In order to give Genparse the chance to indent the code properly, do not mix space and tab indentations in one \fB__CODE__\fP statement. .PP A \fB__STORE_LONGINDEX__\fP directive. Instructs Genparse to add an interer type field to the result class which will be set to the longindex variable (last argument in the call to @code{getopt_long()}). This new field will get the same name as the result field it is related to but with an \fB_li\fP postfix. .RE .sp The following \fIglobal directives\fP are supported. They may appear in any order. .sp .RS An \fB#include\fP directive will instruct genparse to copy the said include statement into the C or C++ code generated by genparse, but not any header files or callback files. .PP A \fB#mandatory\fP directive can be used it make usage() function calls nicer. It allows you to specify mandatory command line parameters that might follow switches. Note that Genparse does not check for mandatory parameters, they are only printed in the \fBusage ()\fP function with the \fB__MANDATORIES__\fP directive. \fBDeprecated: add mandatory parameters in the #usage section instead.\fP .PP An \fB#exit_value\fP directive which specifies the exit value in case of an error. Default is EXIT_FAILURE. .PP A \fB#break_lines\fP directive which specifies the width to which lines shall be broken on the help screen. If no \fB#break_lines\fP directive is specified then lines will be printed exactly as given in the genparse file. .PP If \fB#no_struct\fP is specified then no struct will be defined which will be filled with the command line parameters in the generated parser. This may be useful if you want to add your own code with \fB__CODE__\fP statements instead. Only supported for C output. .PP A \fB#export_long_options\fP directive. If \fB#export_long_options\fP is defined then a function \fB#get_long_options()\fP is added which exports the longoptions array used by \fB#getopt_long()\fP. This directive is only available for C output, for other languages it is ignored. .PP A \fBglobal callback function\fP. This function is useful for checking interdependencies between parameters. Interdependencies cannot be checked within each individual callback function because the order in which these functions will be called varies, depending on the order of the parameters on the command line. .RE .sp Genparse also generates a \fBusage()\fP function which prints a help text to stdout about the usage of the program for which Genparse is generating the parser. It can be customized by specifying a usage section at the bottom of the Genparse file. If no such section is specified it defaults to .sp .nf #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ __MANDATORIES__ __GLOSSARY__ #usage_end .fi .sp The usage section starts with \fB#usage_begin\fP and ends with \fB#usage_end\fP. Any text between is printed verbatim except for the following keywords, which will be replaced as listed below: .sp .RS \fB__PROGRAM_NAME__\fP: The program name. In C and C++ the program name is given in argv[0]. .PP \fB__OPTIONS_SHORT__\fP: A list of available short form options, e.g. [ \-abc ]. .PP \fB__MANDATORIES__\fP: A list of all mandatory parameters as defined with #mandatory commands. \fBDeprecated: List mandatory parameters here directly.\fP .PP \fB__GLOSSARY__\fP: A description of all command line options. This is the information given for the parameter definitons in human readable form. It includes the parameter type, default, range and any comments. A line which contains \fB__GLOSSARY__\fP is replaced by the glossary of the parameters, any other text in the same line is ignored. .PP \fB__GLOSSARY_GNU__\fP: Same as \fB__GLOSSARY__\fP but in GNU style. Optionally followed by an integer in brackets which specifies the indentation of the descriptive text (e.g. \fB__GLOSSARY__\fP(30)). Default indentation is 24. .PP \fB__STRING__(s)\fP: A string constant, in C probably a string macro defined with the #define preprocessor command. This macro can be imported from another file using the include directive in the genparse file. Ignored when generating Java output. .PP \fB__INT__(x)\fP: An integer constant, in C probably an integer macro defined with the #define preprocessor command. This macro can be imported from another file using the include directive in the genparse file. Ignored when generating Java output. .PP \fB__CODE__(statements)\fP: Same as for the parameter options, see above. .PP \fB__DO_NOT_DOCUMENT__\fP: Any line which contains this macro will not be printed in the \fIusage()\fP function. Can be used for implementing command line parameters without listing them on the help screen. .PP \fB__NL__\fP: New line. Useful for breaking lines manually while automatic line breaking is on (see \fB#break_lines\fP). Ignored when generating Java output. .PP \fB__NEW_PRINT__\fP: Close the active print command and start a new one. .PP \fB__COMMENT__(text)\fP: Comment in the code for printing the usage text. .RE .PP long options can be followed by an = sign and an optional designation \fIopt_name\fP which can be referred to in the following description. It will be used in the \fIusage()\fP function only. For example the following genparse line .sp .nf s / block-size=SIZE int "use SIZE-byte blocks" .fi .sp .PP will lead to the following line in the help screen .sp .nf [ \-s ] [ \-\-block-size=SIZE ] (type=INTEGER) use SIZE-byte blocks .fi .sp in genparse style (\fB__GLOSSARY__\fP) or .sp .nf \-s, \-\-block\-size=SIZE use SIZE\-byte blocks .fi .sp in GNU style (\fB__GLOSSARY_GNU__\fP). It is also possible to put square braces around the optional name in order to indicate that the argument is optional. This has no meaning for the generated parser however. Use * postfixes in order to make an argument optional. .nf s* / block*[=SIZE] int "use blocks." "If SIZE is not given then they will get a size of 1kB." .fi will lead to the following line in the help screen .nf \-s, \-\-block[=SIZE] use blocks. If SIZE is not given then they will get a size of 1kB. .fi .RE .sp .SH EXAMPLE Here is a sample genparse file: .sp .nf #include /* comment */ my_callback() i / iterations int 100 [10...1000] iter_callback() "Number of iterations to run for." /* * Comment */ n / name string {"mike"} name_cb() "User's name" s / str string "test string" f flag "a stupid flag!" #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ filename This is only a stupid test program. __GLOSSARY__ #usage_end .fi .sp .SH "SEE ALSO" For an example input file, see \fI/usr/share/doc/genparse/examples/test.gp\fP. .P The full documentation for \fBgenparse\fP is maintained as a Texinfo manual. If the \fBinfo\fP and \fBgenparse\fP programs are properly installed at your site, the command .sp info genparse .sp should give you access to the complete manual. .sp The latest version of \fBgenparse\fP can always be found at \fIhttp://genparse.sourceforge.net\fP. .SH AUTHOR This manual page was written by James R. Van Zandt and Michael Geng. genparse-0.9.1/doc/Doxyfile.in0000644000076600001440000017771611347201167013155 00000000000000# Doxyfile 1.6.2-20100208 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = genparse # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @DOXYGEN_SRC_DIRECTORY@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.cc \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html/doxygen # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = NO # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES genparse-0.9.1/doc/version.texi0000644000076600001440000000014511732677215013410 00000000000000@set UPDATED 18 December 2011 @set UPDATED-MONTH December 2011 @set EDITION 0.9.1 @set VERSION 0.9.1 genparse-0.9.1/doc/genparse.info0000644000076600001440000024736011732677233013525 00000000000000This is genparse.info, produced by makeinfo version 4.13 from genparse.texi. INFO-DIR-SECTION Development START-INFO-DIR-ENTRY * Genparse: (genparse). Command line parser generator. END-INFO-DIR-ENTRY Genparse: command line parser generator, by Mike Borella and Michael Geng This file documents the Genparse package for creating command line parser generators in C, C++ and Java. Copyright (C) 1997-2011, Mike Borella, Michael Geng Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Author.  File: genparse.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) This file documents the Genparse package for creating command line parsing routines in C, C++ and Java using a simple descriptive file. This is edition 0.9.1, for Genparse version 0.9.1. * Menu: * Introduction:: Overview of Genparse * Making Genparse Files:: Step-by-Step Instructions for Writing Genparse Files * Genparse Options:: * Genparse File Syntax:: * The Future:: * Some History:: * Index::  File: genparse.info, Node: Introduction, Next: Making Genparse Files, Prev: Top, Up: Top 1 Introduction ************** The Genparse package allows the automated creation of command line parsing routines, based on a command line option description file. Given a target language, Genparse outputs a suitable parser. For example, in C, a function is created that reads the command line parameters and stores their values in a data structure. In C++ and Java, a command line parsing class is created, with member functions that return parameter values. The goal of Genparse is to eliminate the effort required to write a command line parser for every newly-developed program. Typically, these parsers all follow a very similar format, with a series of calls to the `getopt ()' or `getopt_long ()' library functions. Genparse allows users to specify their program's command line options in a concise text file (hereafter, a "Genparse File"). Genparse reads this file, and produces the appropriate parsing routines in the user's language of choice. Users may call the parser's functions from their main code in order to obtain the values of the parameters. In addition to providing a simple interface to the parameters, Genparse also has the following features: * A default value may be provided for each parameter. * Both short (`-o') and long (`--option') parameters are supported. * For parameters that take numerical values, Genparse can make sure that the input values fall within a given range. * A `usage ()' function is automatically created, which can be used to describe a program's command line parameters. Genparse also allows a description string to be associated with each parameter. These strings will be displayed in the `usage ()' function. * For C and C++ extra include files may be added to any command line parser. * Each parameter can have a callback function associated with it. Genparse will automatically create a skeleton for callback functions, which the user can fill in. Also, global callback functions can be specified. * The generated parser is 100% GNU compatible because the parsing itself is done by the GNU getopt_long function. * The generated code is internationalizable (*Note internationalize::.). Currently, we do not believe that Genparse has any significant limitations. It cannot handle dependencies between different options, but the user can write callback function to accomplish this task. A virtually unlimited number of long command line options are available, but only 52 single-character options can be used by a given program. Mail suggestions and bug reports for Genparse to . The latest version of Genparse can always be found at `http://genparse.sourceforge.net'.  File: genparse.info, Node: Making Genparse Files, Next: Genparse Options, Prev: Introduction, Up: Top 2 Making Genparse Files *********************** In this section we discuss how to write Genparse files and how to invoke Genparse on these files. We take a pedagogical approach, walking through a very simple example program and showing how Genparse can simplify its development. * Menu: * A Simple Application:: * Adding Command Line Options:: * Simplifying Command Line Parsing with Genparse:: * Include Files and Callbacks:: * C++ Output:: * Java Output:: * Idiosyncrasies::  File: genparse.info, Node: A Simple Application, Next: Adding Command Line Options, Prev: Making Genparse Files, Up: Making Genparse Files 2.1 A Simple Application ======================== Suppose that we want to write a C program that outputs a given text file some number of times. This is a simple, and perhaps not terribly useful program, but its simplicity will help illustrate the utility of Genparse. Our program, `mycopy1', might look like this: /* mycopy1.c */ #include #include int main (int argc, char *argv[]) { int c, i, n; FILE *fp; n = atoi (argv[1]); fp = fopen (argv[2],"r"); for (i = 0; i < n; i++) { while ((c = fgetc (fp)) != EOF) fputc (c, stdout); rewind (fp); } fclose (fp); return 0; } The user is expected to invoke `mycopy1' with two items on the command line: an integer followed by a filename. The former is the number of times that the latter should be displayed. While this program accomplishes what we set out to do, it is not very robust nor user friendly. For example, if the user specifies a negative integer, the program does not display a warning or error message (in fact, it displays nothing). If the user does not know what is expected on the command line, how will he or she find this information out (assuming that nice documentation, such as what you are now reading, does not exist for `mycopy1'). Furthermore, wouldn't this program be more flexible if there were a default number of iterations, the user could specify the command line parameters in any order or omit some altogether? All of these issues, and perhaps others, can be addressed in a number of ways. Traditionally, the author of `mycopy1' would publish the command line format, typically in a `man' page, and write a routine to pull the command line parameters out of the `argv' array, assuming that the format was followed (not unlike what we've done for `mycopy1'). However, as the number of command line parameters increases, this task becomes much more difficult and cumbersome. With the introduction of the `getopt ()' and `getopt_long ()' functions, now part of the GNU C Library, a great deal of the command line parsing burden was lifted from programmers. The `getopt ()' function takes in an `argv'-style command line and assumes that it contains a series of command line options. An option is indicated with a single character preceded by a dash - for example, `-o' or `-Z'. These options may be followed by a command line parameter - for example, `-o' or `-Z 3'. Using `getopt' we could add an `-i' to allow the number of iterations to be specified. The advantage to doing so is that it would no longer matter where on the command line `-i' appears, and if `-i' does not appear at all, we can assign a default number of iterations. The `getopt_long ()' function extends `getopt ()', by allowing long options to coexist with single character options. Long options are preceded by two dashes and may be more than one character long - for example `--iterations'. Long options may also take parameters, in the form `--option param' or `--option=param'.  File: genparse.info, Node: Adding Command Line Options, Next: Simplifying Command Line Parsing with Genparse, Prev: A Simple Application, Up: Making Genparse Files 2.2 Adding Command Line Options =============================== From the previous section's `mycopy1', we will now add command line option parsing with `getopt_long ()' to create `mycopy2'. Along the way we'll add a small number of useful features. /* mycopy2.c */ #include #include #include int main (int argc, char *argv[]) { int c, i; FILE *fp; extern char *optarg; extern int optind; int option_index = 0; char ch; int help, iterations; int errflg = 0; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"iterations", required_argument, NULL, 'i'}, {NULL, 0, NULL, 0} }; help = 0; iterations = 1; while ((ch = getopt_long (argc, argv, "hi:", long_options, &option_index)) != EOF) { switch (ch) { case 'h': help = 1; break; case 'i': iterations = atoi (optarg); if (iterations < 0) { fprintf (stderr, "error: iterations must be >= 0\n"); errflg ++; } break; default: errflg++; } } /* while */ if (errflg || help) { printf ("usage: %s [ -i ] \n", argv[0]); printf (" [ -h ] [ --help ] Print help screen \n"); printf (" [ -i ] [ --iterations ] Number of times to \ output \n"); exit (1); } if (optind >= argc) fp = stdin; else fp = fopen (argv[optind],"r"); for (i = 0; i < iterations; i++) { while ((c = fgetc (fp)) != EOF) fputc (c, stdout); rewind (fp); } fclose (fp); return 0; } This program performs the same function as `mycopy1' but does so in a more flexible and reliable fashion. Two command line options are supported, `-h' and `-i'. When `-h', or its long form, `--help', appears on the command line, all other options are ignored and a usage message is displayed. The `-i' option allows the user to specify the number of iterations, as discussed above. It also has a long form, `--iterations'. The number of iterations defaults to 1 if `-i' does not appear on the command line, and the program prevents negative values from being specified with `-i'. The usage message is a useful way of summarizing a program's options without needed a `man' or `info' page. There are three ways that the usage message for `mycopy2' will be displayed: * If the `-h' or `--help' options appear on the command line. * If an unknown option appears on the command line. * If the `-i' option appears with a negative value. A nice feature of `getopt ()' and `getopt_long ()' is that they will rearrange the command line within `argv' so that all non-options follow all of the options(1). The external variable `optind' is set to point to the first non-option in the re-arranged `argv'. Thus, by comparing `optind' to `argc', we can determine whether or not an input file has been specified. If there is no input file on the command line, we can redirect `mycopy2' to use _stdin_. While `mycopy2' is an improvement over `mycopy1', there are a number of drawbacks to using `getopt ()' in all of your programs. The most obvious is time. In `mycopy2', two-thirds (about 50 lines) of the code does the command line parsing, and only two options are supported. If there we're 10 options, the command line parsing code could easily reach 200 lines or more. Additionally, since each option's parameter may need to be checked for validity and assigned to a variable, this becomes a tedious process that can be error prone. Observing the source code for `mycopy2', it becomes clear that, like any repetitive task, the command line parsing code follows a number of simple patterns. If these patterns can be abstracted and generalized so that the user can indicate option use in a concise format, most, if not all, of the parsing code can be automatically generated. With this thought in mind, we turn our attention to Genparse. ---------- Footnotes ---------- (1) `argv[0]' is not rearranged - it remains in its place.  File: genparse.info, Node: Simplifying Command Line Parsing with Genparse, Next: Include Files and Callbacks, Prev: Adding Command Line Options, Up: Making Genparse Files 2.3 Simplifying Command Line Parsing with Genparse ================================================== Genparse automatically creates command line parsing code, not unlike the code in `mycopy2.c'. It creates two or three files: a header file, a parsing file, and an optional callback file. In this section, we'll write a Genparse specification for our file copying program and examine the parser that it creates. Genparse runs on a simple input file, which we'll call a Genparse file. In a Genparse file, each command line option is specified on one or more lines. The following code is a Genparse file for `mycopy3'. /* mycopy3.gp */ i / iterations int 1 [0...] "Number of times to output ." "File should be text format!" o / outfile string {""} "Output file name." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end The naming of this file follows the convention of all Genparse files ending in the extension `.gp'. Let's walk through `mycopy3.gp'. The first line is a comment. It is ignored by Genparse. The second line is the first option specification. This is the `-i' option, which, as before, may be specified in long form as `--iterations'. Our `mycopy3.gp' file indicates that `-i' must take an integer parameter, the default value of which is 1. The allowed range is non-negative. The final part of the third line is a description of the option's usage (to appear in the `usage ()' function). The third line introduces a new option, that was not in `mycopy2'. The `-o' option takes a string parameter (where a "string" is any series of characters) with a default value of empty. As indicated by the description, this option is used to specify an output file to which `mycopy3''s output will be directed. Default values for strings must be specified within braces and quotes like {"This is a stupid comment"}, for chars it must be enclosed in single quotes, e.g. 'a' or '\0x13'. For other integers use the plain default value. Starting in the third line the help screen is defined which will be printed if `-h' or `--help' is set or if an invalid command line is given. `__PROGRAM_NAME__' will be replaced with the name of the executable (probably mycopy3), `__OPTIONS_SHORT__' will be replaced with a list of allowed short options ("[ -iohv ]" in this example). "Print a file for a number of times to stdout." will be printed verbatim. `__GLOSSARY__' will be replaced with a list explanations for each of the command line parameters. For more explanations on the `#usage' section *Note Usage Function::. `mycopy3 --help' will print the following help screen: usage: mycopy3 [ -iohv ] file Print file for a number of times to stdout. [ -i ] [ --iterations ] (type=INTEGER, range=0..., default=1) Number of times to output . File should be text format! [ -o ] [ --outfile ] (type=STRING) Output file name. [ -h ] [ --help ] (type=FLAG) Display this help and exit. [ -v ] [ --version ] (type=FLAG) Output version information and exit. Genparse can be invoked on `mycopy3.gp' in a number of ways (Yes, Genparse has its own command line options! *Note Genparse Options::.), but we'll invoke it as follows. genparse -o mycopy3_clp mycopy3.gp This command tells Genparse to run on `mycopy3.gp' and to output program files named with `mycopy3_clp'. This particular Genparse file creates only a header file and a parser file since no callbacks are specified. Let's first take a look at the header file, `mycopy3_clp.h'. * Menu: * Header Files:: * Parser Files:: * Main Program::  File: genparse.info, Node: Header Files, Next: Parser Files, Prev: Simplifying Command Line Parsing with Genparse, Up: Simplifying Command Line Parsing with Genparse 2.3.1 Header Files ------------------ Below, we walk through `mycopy3_clp.h', an example header file created by Genparse. Header files, such as this one, _must_ be included in all linked code that needs to access the command line parameter values. /* mycopy3_clp.h */ #include #ifndef bool typedef enum bool_t { false = 0, true } bool; #endif /* customized structure for command line parameters */ struct arg_t { int i; char * o; bool h; bool v; int optind; }; /* function prototypes */ void Cmdline (struct arg_t *my_args, int argc, char *argv[]); void usage (int status, char *program_name); Although "real" Genparse output files begin with a section of comments, for purposes of saving space, we'll replace all of those with a short comment containing only the file's name. A Genparse-created header file contains four major sections: (1) includes and type definitions, (2) the definition of `struct arg_t', (3) parsing function prototypes, and (4) callback function prototypes. Since we are not using callbacks in this example, only the first three sections appear in this header file. The file begins with a list of header files to include. Including `stdio.h' is the default, and other includes may be specified in the Genparse file. Then the `bool' type is conditionally defined. While `bool' is typically predefined in C++, it is not in C. It comes in handy as a type for all flag options, which can only be on or off (true or false). The `struct arg_t' structure contains a variable for each of the options defined in `mycopy3.gp'. This include `i', an integer, and `o', a character pointer. For C output, all variables defined to be strings in Genparse files are declared as character pointers. For C++ output, the C++ string type from the standard C++ library is used. In addition to the user-defined options, Genparse adds two extra flag options, `-h' and `-v'. The `-h' option (long form of `--help') will cause the `usage ()' function to be called, and the program to terminate. The `-v' option (long form of `--version') will be passed back for the calling function to process. It is intended that the caller will display the program's version number if this option is set. Note that if the calling program does not process the `-v' flag, its behavior will not be affected by this flag. The `optind' variable records the value of the `optind' static variable that is used by `getopt ()' and `getopt_long ()'. However, Genparse has changed the behavior of this variable slightly. (*Note Parser Files::.) The final section of `mycopy3_clp.h' consists of function prototypes for the command line parser `Cmdline ()'(1), and the `usage ()' function. The `Cmdline ()' function is where the meat of Genparse processing occurs. It takes as arguments a pointer to an `arg_t' struct which will be filled with the values of the options, and `argc' and `argv' which should be passed as the `main ()' function receives them. Genparse asumes that `arg_t' is a valid pointer to an `arg_t' struct, the calling program is responsible for properly allocating memory for it. Typically, the parsing function should be called at the beginning of the program. The usage function lists the command line options for the program, as well as any mandatory command line parameters. Once this information is displayed, the program is terminated. For example, the usage function output for `mycopy3', as invoked by the `-h' option, is as follows: usage: mycopy3 [ -iohqv ] file [ -i ] [ --iterations ] Number of times to output . (default = 1) [ -o ] [ --outfile ] Output file. [ -h ] [ --help ] Display help information. (default = 0) [ -v ] [ --version ] Output version. (default = 0) After displaying a brief list of all single-character options and mandatory options, the usage message lists all options in short and long forms, along with user-defined descriptions and each option's default value. ---------- Footnotes ---------- (1) The name of the command line parsing function can be user-defined. *Note Genparse Options::.  File: genparse.info, Node: Parser Files, Next: Main Program, Prev: Header Files, Up: Simplifying Command Line Parsing with Genparse 2.3.2 Parser Files ------------------ In this section we examine the parser file generated from running Genparse on `mycopy3.gp'. /* mycopy3_clp.c */ #include #include #include #include "mycopy3_clp.h" static struct option const long_options[] = { {"iterations", required_argument, NULL, 'i'}, {"outfile", required_argument, NULL, 'o'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; /*---------------------------------------------------------------------------- ** ** Cmdline () ** ** Parse the argv array of command line parameters ** **--------------------------------------------------------------------------*/ void Cmdline (struct arg_t *my_args, int argc, char *argv[]) { extern char *optarg; extern int optind; int c; int errflg = 0; my_args->i = 1; my_args->o = NULL; my_args->h = false; my_args->v = false; optind = 0; while ((c = getopt_long (argc, argv, "i:o:hv", long_options, &optind)) != EOF) { switch (c) { case 'i': my_args->i = atoi (optarg); if (my_args->i < 0) { fprintf (stderr, "parameter range error: i must be >= 0\n"); errflg++; } break; case 'o': my_args->o = optarg; break; case 'h': my_args->h = true; usage (EXIT_SUCCESS, argv[0]); break; case 'v': my_args->v = true; break; default: usage (EXIT_FAILURE, argv[0]); } } /* while */ if (errflg) usage (EXIT_FAILURE, argv[0]); if (optind >= argc) my_args->optind = 0; else my_args->optind = optind; } /*---------------------------------------------------------------------------- ** ** usage () ** ** Print out usage information, then exit ** **--------------------------------------------------------------------------*/ void usage (int status, char *program_name) { if (status != EXIT_SUCCESS) fprintf (stderr, "Try `%s --help' for more information.\n", program_name); else { printf ("\ usage: %s [ -iohv ] file\n\ Print a file for a number of times to stdout.\n\ [ -i ] [ --iterations ] (type=INTEGER, range=0..., default=1)\n\ Number of times to output .\n\ File should be text format!\n\ [ -o ] [ --outfile ] (type=STRING)\n\ Output file name.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n", program_name); } exit (status); } The parser file consists of two main functions. The `usage ()' function displays the program's usage information, then terminates. The parsing function, named `Cmdline ()' in this case(1), reads the command line and fills an `arg_t' struct with the command line parameters. Since the `usage ()' function is straightforward, we will not examine it in detail. Instead, we will focus our attention on `Cmdline ()'. This function begins by defining a `struct long_options' array based on the specification in the `mycopy3.gp' file. This array will tell `getopt_long ()' what options to expect on the command line. The `struct arg_t' is then initialized and the default parameter values from `mycopy3.gp' are set. Once this is complete, `getopt_long ()' is looped through until all command line options have been processed. Each option has its own `case' in the `switch' statement. While this processing is fairly simple, there are several options worth examining in more detail. * For the `-h' option, the `usage ()' function is automatically called. * Range checking for `-i' occurs. If `-i' has a negative value, an error message is printed to _stderr_ and the error flag is raised. After the loop over `getopt_long ()' is complete, the error flag is checked. If it is raised, or if the help option has been set, the `usage ()' function is called. At the end of `Cmdline ()', the behavior of `optind' is modified slightly. While `optind' is returned to the caller in the `struct arg_t', we set it to 0 if there are no non-option command line parameters. Otherwise, we pass it back as is, so that it can be used as a pointer into `argv'. ---------- Footnotes ---------- (1) The name of the parser function can be set by the user. *Note Genparse Options::.  File: genparse.info, Node: Main Program, Prev: Parser Files, Up: Simplifying Command Line Parsing with Genparse 2.3.3 Main Program ------------------ Next to specification of the Genparse file, the most important part of using Genparse is interfacing it with user code. In this section, we show the main program code for `mycopy3.c' and describe how the routines created by Genparse are used. /* mycopy3.c */ #include #include #include "mycopy3_clp.h" #define VERSION "3.0" int main (int argc, char *argv[]) { int c, i; FILE *fp, *ofp; struct arg_t a; Cmdline (&a, argc, argv); if (a.v) { printf ("%s version %s\n", argv[0], VERSION); exit (0); } if (a.o) ofp = fopen (a.o, "w"); else ofp = stdout; if (!a.optind) fp = stdin; else fp = fopen (argv[a.optind],"r"); for (i = 0; i < a.i; i++) { while ((c = fgetc (fp)) != EOF) fputc (c, ofp); rewind (fp); } fclose (fp); return 0; } The `mycopy3.c' module begins by including `mycopy3_clp.h', which is necessary for the definition of the `arg_t' struct and the parser function prototypes. The `Cmdline ()' function fills an `arg_t' struct with the command line options. While the parsing function does not always have to be called before all other processing, it must be called before any command line parameters are used. The program then checks a number of the parameters, as returned in the structure. In particular, if the `-v' option is set, the version number is displayed and then the program is terminated. If the `optind' pointer is set to 0, indicating that there are no non-option parameters on the command line, the input is redirected to _stdin_, If the output file is not specified with the `-o' option, output is redirected to _stdout_.  File: genparse.info, Node: Include Files and Callbacks, Next: C++ Output, Prev: Simplifying Command Line Parsing with Genparse, Up: Making Genparse Files 2.4 Include Files and Callbacks =============================== So far, our examples have only considered the basic features of Genparse. In fact, these features are probably more than enough for 90% of all command line parsing needs. However, some programs require additional flexibility. In this section, we explore some of the advanced features of Genparse. Include files may be specified at the beginning of a Genparse file. They are listed in C style, e.g., `#include ' or `#include "file.h"'. One of the possible uses of include files are for when a macro needs to be used in a Genparse file. Consider the following modification to `mycopy3.gp'. /* mycopy3.gp */ #include i / iterations int 1 [0...MAX] "Number of times to output ." o / outfile string {""} "Output file." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end This example assumes that the macro `MAX' is defined in `mycopy3.h'. In order to demonstrate the utility of callback functions, let's further modify `mycopy3.gp'. In fact, let's just call it `mycopy4.gp'. /* mycopy4.gp */ #include my_callback () i / iterations int 1 [1..MAX] "Number of times to output ." o / outfile string {""} outfile_cb () "Output file." #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ file Print a file for a number of times to stdout. __GLOSSARY__ #usage_end This file instructs Genparse to create a global callback function `my_callback ()' and the option callback function `outfile_cb ()'. For these callbacks, Genparse adds prototypes to the header file, a call to the parser file, and callback skeletons in a callback file. Rather than display the whole header and parse files, we'll just show the lines that are added. Callback functions are useful if extra processing needs to occur before one or more parameters are used by the main program. For example, if one parameter is dependent on the values of two others, a user-defined global callback function can contain the logic to check for the proper conditions. /* mycopy4_clp.h */ /* global and local callbacks */ int my_callback (struct arg_t *); int outfile_cb (char *); In the `mycopy4_clp.h' file, prototypes for the global and the option callback functions are added. /* mycopy4_clp.c */ case 'o': my_args->o = optarg; if (!outfile_cb (my_args->o)) usage (EXIT_FAILURE, argv[0]); break; ... if (!my_callback (my_args)) usage (argv[0]); In the `mycopy4_clp.c' file, a call to the callback functions is made. If a 0 is returned, an error is assumed and the usage function is called. The main difference in Genparse behavior that including callbacks produces is the creation of a callback file. This file contains skeletons of all of the callback functions. It is up to the user to fill them in. Note that callbacks should return 0 on error and non-zero otherwise. /* mycopy4_clp_cb.c */ #include #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** my_callback () ** ** User defined global callback. ** **--------------------------------------------------------------------------*/ int my_callback (struct arg_t *a) { return 1; } /*---------------------------------------------------------------------------- ** ** outfile_cb () ** ** User defined parameter callback. ** **--------------------------------------------------------------------------*/ int outfile_cb (char * var) { return 1; } Note that the `struct arg_t' structure must be passed to the global callback, while the option value is expected to be passed in character array format to option callbacks.  File: genparse.info, Node: C++ Output, Next: Java Output, Prev: Include Files and Callbacks, Up: Making Genparse Files 2.5 C++ Output ============== All of our example so far have shown Genparse creating C code. Genparse also supports C++ output. This section examines the difference between C and C++ output and how to interface a program with a command line parsing class created by Genparse. As with C output, Genparse creates two or three C++ output files: a header file, a parser class file, and a callback file. We'll use `mycopy4.gp' as input to create these files. We invoke Genparse as follows. genparse -l cpp -o mycopy4_clp mycopy4.gp The three created files are named, `mycopy4_clp.h', `mycopy4_clp.cc', and `mycopy4_clp_cb.cc'. We'll walk through each one in turn. * Menu: * Header File:: * Parser File:: * Callback File:: * Main C++ Program::  File: genparse.info, Node: Header File, Next: Parser File, Prev: C++ Output, Up: C++ Output 2.5.1 Header File ----------------- The code for `mycopy4_clp.h' appears below. /* mycopy4_clp.h */ #ifndef CMDLINE_H #define CMDLINE_H #include #include #include "mycopy4.h" /*---------------------------------------------------------------------------- ** ** class Cmdline ** ** command line parser class ** **--------------------------------------------------------------------------*/ class Cmdline { private: /* parameters */ int _i; std::string _o; bool _h; bool _v; /* other stuff to keep track of */ std::string _program_name; int _optind; public: /* constructor and destructor */ Cmdline (int, char **) throw (std::string); ~Cmdline (){} /* usage function */ void usage (int status); /* return next (non-option) parameter */ int next_param () { return _optind; } /* callback functions */ bool my_callback (); bool outfile_cb (); int i () { return _i; } std::string o () { return _o; } bool h () { return _h; } bool v () { return _v; } }; #endif The header file contains the definition of the command line parser class. The class defines a logical structure that puts different requirements on the main program than when the output code is in C. We summarize the differences between C and C++ output below. * Each parameter value is stored in a private member variable, and must be accessed through a call to the member function named with the short form of the option. If Genparse was called with the option `--longmembers' then this function is named by the long form of the option. * The name of the executable is stored in a private member variable, but is not available to the via the interface (the main program has access to `argv[0]'). * A copy of the `optind' variable is stored in a private member variable, and is accessible through the `next_param ()' member function. * All callbacks are public member functions. * The usage function is a public member function. * The constructor throws a string exception if command line parsing fails.  File: genparse.info, Node: Parser File, Next: Callback File, Prev: Header File, Up: C++ Output 2.5.2 Parser File ----------------- The parser file defines the non-inlined member functions; i.e., the constructor and the usage function. The code for `mycopy4_clp.cc' appears below. /* mycopy4_clp.cc */ #include #include #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::Cmdline () ** ** Constructor method. ** **--------------------------------------------------------------------------*/ Cmdline::Cmdline (int argc, char *argv[]) throw (std::string ) { extern char *optarg; extern int optind; int c; static struct option long_options[] = { {"iterations", required_argument, NULL, 'i'}, {"outfile", required_argument, NULL, 'o'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; _program_name += argv[0]; /* default values */ _i = 1; _h = false; _v = false; optind = 0; while ((c = getopt_long (argc, argv, "i:o:hv", long_options, &optind)) != EOF) { switch (c) { case 'i': _i = atoi (optarg); if (_i < 1) { std::string s; s += "parameter range error: i must be >= 1"; throw (s); } if (_i > MAX) { std::string s; s += "parameter range error: i must be <= MAX"; throw (s); } break; case 'o': _o = optarg; if (!outfile_cb ()) this->usage (EXIT_FAILURE); break; case 'h': _h = true; this->usage (EXIT_SUCCESS); break; case 'v': _v = true; break; default: this->usage (EXIT_FAILURE); } } /* while */ _optind = optind; if (!my_callback ()) usage (EXIT_FAILURE); } /*---------------------------------------------------------------------------- ** ** Cmdline::usage () ** ** Print out usage information, then exit. ** **--------------------------------------------------------------------------*/ void Cmdline::usage (int status) { if (status != EXIT_SUCCESS) std::cerr << "Try `" << _program_name << " --help' for more information.\n"; else { std::cout << "\ usage: " << _program_name << " [ -iohv ] file\n\ Print a file for a number of times to stdout.\n\ [ -i ] [ --iterations ] (type=INTEGER, range=1...MAX, default=1)\n\ Number of times to output .\n\ do it like this\n\ [ -o ] [ --outfile ] (type=STRING)\n\ Output file.\n\ [ -h ] [ --help ] (type=FLAG)\n\ Display this help and exit.\n\ [ -v ] [ --version ] (type=FLAG)\n\ Output version information and exit.\n"; } exit (status); } As can be seen from this example, the C++ parser is very similar to the C parser we discussed in *note Parser Files::. The main differences are that all strings are stored in C++ `string' format(1). It is important to note that the callback file is actually included into the parser file. This is because callbacks are implemented as member functions of the parser class, and most C++ compilers will not allow splitting a class's member functions across more than one file. The bottom line of all this is that you don't have to link in the callback file, just the parser file. ---------- Footnotes ---------- (1) Older C++ compilers may not support built-in strings. If this is a problem, upgrade your compiler! It's too old anyway.  File: genparse.info, Node: Callback File, Next: Main C++ Program, Prev: Parser File, Up: C++ Output 2.5.3 Callback File ------------------- The callback file defines skeleton callback routines for the user to fill in. Their syntax is virtually identical to the C output case, except that their return values are `bool' rather than `int'. The code for `mycopy4_clp_cb.cc' appears below. /* mycopy4_clp_cb.cc */ #include "mycopy4_clp.h" /*---------------------------------------------------------------------------- ** ** Cmdline::my_callback () ** ** Global callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::my_callback () { return true; } /*---------------------------------------------------------------------------- ** ** Cmdline::outfile_cb () ** ** Parameter callback. ** **--------------------------------------------------------------------------*/ bool Cmdline::outfile_cb () { return true; }  File: genparse.info, Node: Main C++ Program, Prev: Callback File, Up: C++ Output 2.5.4 Main Program ------------------ Due to the syntactic differences between C and C++, the C++ main program must interact with the command line parser class in a different fashion than in the C case. The code for `mycopy4.cc' appears below. /* mycopy4.cc */ #include #include #include #include "mycopy4_clp.h" using namespace std; #define VERSION "3.0" int main (int argc, char *argv[]) { int i; char c; ifstream input_file; ofstream output_file; bool ofile = false, ifile = false; Cmdline cl (argc, argv); if (cl.v ()) { cout << argv[0] << " version " << VERSION << endl; exit (0); } if (!cl.o ().empty ()) { output_file.open (cl.o ().c_str ()); ofile = true; } if (cl.next_param ()) { input_file.open (argv[cl.next_param ()]); ifile = true; } for (i = 0; i < cl.i (); i++) { if (ifile) c = input_file.get (); else cin >> c; while (c != EOF) { if (ofile) output_file.put (c); else cout << c; if (ifile) c = input_file.get (); else cin >> c; } if (ifile) { input_file.clear (); input_file.seekg (0); } } input_file.close (); output_file.close (); return 0; } Although `mycopy4' provide almost identical output and functionality as that of `mycopy3', it must access all command line parameters and related information through the command line parser class interface.  File: genparse.info, Node: Java Output, Next: Idiosyncrasies, Prev: C++ Output, Up: Making Genparse Files 2.6 Java Output =============== This section shows the Java output and how to interface a Java program with a command line parsing class created by Genparse. For Java, Genparse creates a Java interface, a parser class that implements it and an exception class that may be thrown by the parser. A separate output file is written for each of them. We'll use `mycopy5.gp' as input to create the two output files. Genparse generates Java code as follows. genparse -l java -o Cmdline mycopy5.gp The three created files are named, `CmdlineInterface.java', `Cmdline.java' and `CmdlineEx.java'. We'll walk through each one in turn. * Menu: * Java Interface:: * Java Implementation:: * Java Exception Class:: * Main Java Program::  File: genparse.info, Node: Java Interface, Next: Java Implementation, Up: Java Output 2.6.1 Java Interface -------------------- /* CmdlineInterface.java */ /*---------------------------------------------------------------------------- ** ** interface CmdlineInterface ** ** Interface of the command line parser class ** **--------------------------------------------------------------------------*/ public interface CmdlineInterface { /* usage function */ void usage (int status, String program_name); /* return next (non-option) parameter */ int next_param (); /* callback functions */ boolean my_callback (); boolean outfile_cb (); /* getter functions for command line parameters */ int i (); String o (); boolean h (); boolean v (); }; Each parameter value is stored in a private member variable, and must be accessed through a call to the member function named with the short form of the option. If Genparse was called with the option `--longmembers' then this function is named by the long form of the option. A copy of the `optind' variable is stored in a private member variable, and is accessible through the `next_param ()' member function.  File: genparse.info, Node: Java Implementation, Next: Java Exception Class, Prev: Java Interface, Up: Java Output 2.6.2 Java Implementation ------------------------- /* Cmdline.java */ import gnu.getopt.LongOpt; import gnu.getopt.Getopt; /*---------------------------------------------------------------------------- ** ** class Cmdline () ** ** Command line parser class. ** **--------------------------------------------------------------------------*/ public class Cmdline implements CmdlineInterface { /* parameters */ private int _i; private String _o; private boolean _h; private boolean _v; /* Name of the calling program */ private String _executable; /* next (non-option) parameter */ private int _optind; /* Must be constructed with parameters. */ public Cmdline (String[] argv) throws CmdlineEx { /* character returned by optind () */ int c; LongOpt[] longopts = new LongOpt[4]; longopts[0] = new LongOpt ("iterations", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longopts[1] = new LongOpt ("outfile", LongOpt.REQUIRED_ARGUMENT, null, 'o'); longopts[2] = new LongOpt ("help", LongOpt.NO_ARGUMENT, null, 'h'); longopts[3] = new LongOpt ("version", LongOpt.NO_ARGUMENT, null, 'v'); _executable = Cmdline.class.getName (); /* default values */ _i = 1; _h = false; _v = false; Getopt g = new Getopt (_executable, argv, "i:o:hv", longopts); while ((c = g.getopt ()) != -1) { switch (c) { case 'i': _i = Integer.parseInt (g.getOptarg ()); if (_i < 1) throw new CmdlineEx ("parameter range error: i must be >= 1"); if (_i > 10) throw new CmdlineEx ("parameter range error: i must be <= 10"); break; case 'o': _o = g.getOptarg (); if (!outfile_cb ()) usage (-1, _executable); break; case 'h': _h = true; usage (0, _executable); break; case 'v': _v = true; break; default: usage (-1, _executable); } } /* while */ _optind = g.getOptind (); if (!my_callback ()) usage (-1, _executable); } public void usage (int status, String program_name) { if (status != 0) { System.err.println ("Try `" + program_name + " --help' for more information."); } else { System.out.println ( "usage: " + program_name + " [ -iohv ] file\n" + "Print a file for a number of times to stdout.\n" + " [ -i ] [ --iterations ] (type=INTEGER, range=1...10, default=1)\n" + " Number of times to output .\n" + " do it like this\n" + " [ -o ] [ --outfile ] (type=STRING)\n" + " Output file.\n" + " [ -h ] [ --help ] (type=FLAG)\n" + " Display this help and exit.\n" + " [ -v ] [ --version ] (type=FLAG)\n" + " Output version information and exit."); } System.exit (status); } /* return next (non-option) parameter */ public int next_param () { return _optind; } /* Callback functions */ /* Derive your own class and overwrite any of the callback */ /* functions if you need customized callbacks. */ public boolean my_callback () { return true; } public boolean outfile_cb () { return true; } /* getter functions for command line parameters */ public int i () { return _i; } public String o () { return _o; } public boolean h () { return _h; } public boolean v () { return _v; } } There is no default constructor. Instead the parser class must be constructed with an array of strings which is usually the argument to the `main ()' function. The constructor throws an exception if command line parsing fails. The exception type is defined in *Note Java Exception Class::. Note that no separate callback file is generated like for C or C++. The parser class contains default implementations for each of the callback functions, if you need customized callbacks then simply derive your own class from the generated parser class.  File: genparse.info, Node: Java Exception Class, Next: Main Java Program, Prev: Java Implementation, Up: Java Output 2.6.3 Java Exception Class -------------------------- /* CmdlineEx.java */ /*---------------------------------------------------------------------------- ** ** class CmdlineEx ** ** Exception class thrown by the command line parser class ** **--------------------------------------------------------------------------*/ public class CmdlineEx extends RuntimeException { public CmdlineEx (String text) { super (text); } } This exception class is always the same of course. Only the name of the class would change if -parsefunc was set with a different name than Cmdline.  File: genparse.info, Node: Main Java Program, Prev: Java Exception Class, Up: Java Output 2.6.4 Main Java Program ----------------------- The example code for Java is very similar to the C++ example (*Note Main C++ Program::.). /* mycopy5.java */ import gnu.getopt.LongOpt; import gnu.getopt.Getopt; import java.io.*; class mycopy5 { public static void main (String args[]) { final String _executable = "mycopy5"; /* Don't know how to set this automatically in Java */ final String VERSION = "3.0"; final int EOF = - 1; /* Is EOF predefined in Java? */ int i; int c; int length; OutputStreamWriter output_file; InputStreamReader input_file; boolean ofile = false, ifile = false; Cmdline cl = new Cmdline (args); if (cl.v ()) { System.out.println (_executable + " version " + VERSION); System.exit (0); } try { length = cl.o ().length (); if (length != 0) { output_file = new OutputStreamWriter (new FileOutputStream (cl.o ())); ofile = true; } else { output_file = new OutputStreamWriter (System.out); } if (cl.next_param () != 0) { input_file = new InputStreamReader (new FileInputStream (args[cl.next_param ()])); ifile = true; } else { input_file = new InputStreamReader (System.in); } for (i = 0; i < cl.i (); i++) { c = input_file.read (); while (c != EOF) { output_file.write (c); c = input_file.read (); } if (ifile) { input_file.close (); input_file = new InputStreamReader (new FileInputStream (args[cl.next_param ()])); } } input_file.close (); output_file.close (); } catch (IOException ex) { System.out.println ("File I/O error: " + ex); } System.exit (0); } }  File: genparse.info, Node: Idiosyncrasies, Prev: Java Output, Up: Making Genparse Files 2.7 Idiosyncrasies ================== Although Genparse has been designed to be as flexible as possible, it will always be more limited than manual command line parsing or using `getopt ()'. In this section, we document some of the strange and unusual behavior of Genparse. * In order to specify an option that only has a long form, you must specify the token "NONE" in place of the short option. For example NONE / longonly flag specified a flag option that only has a long form (`--longonly'). * The `-h' and `-v' options will always exist. Their default behavior can be overridden, but Genparse cannot create parsers without them. (*Note Genparse Options::.) * In a parser, the `-h' option will automatically call the usage function if and only if the long form of the option is `--help'. Otherwise, Genparse assumes that the user has overridden `-h' and treats it like any other option. * For C output you must link in both the parser and the callback files. For C++ output, you only need to link in the parser file. *Note Parser File::.  File: genparse.info, Node: Genparse Options, Next: Genparse File Syntax, Prev: Making Genparse Files, Up: Top 3 Genparse Options ****************** In this section we present the command line options that Genparse accepts, along with their default values. Genparse's command line parsing functions were created by Genparse (talk about bootstrapping), so you can expect Genparse to behave like any other program with Genparse-enabled command line parsing. * *`-c' / `--cppext'*: C++ file extension. There are a number of valid C++ file extensions, such as "C", "cc", "cpp",and "cxx". This option allows the user to specify which one should be used for the C++ files created by Genparse. The default value is "cc". If C++ is not the output language, this option is ignored. * *`-d'*: Debug mode. Setting this flag turns on debugging in the form of logging to a file and `bison' debug output to _stderr_. The name of the debug/log file can be specified with the `-f' option (see below). The default value is off. Only useful for debugging Genparse itself. * *`-f' / `--logfile'*: Name of log file. Only used if debugging (`-d' option) is turned on. All debug output will be written to this file. Currently this consists of the processing of the Genparse file and dumping the state of the command line parameter list class. The default value is "genparse.log". Only useful for debugging Genparse itself. * *`-g' / `--gnulib'*: Use GNU Compatibility Library (Gnulib, see `http://www.gnu.org/software/gnulib/'). Only available for C output. Allows some more types (unsigned long, intmax_t etc.) for which Gnulib provides conversion functions. * *`-h' / `--help'*: Help instructions. This option displays the usage of Genparse with a list of all command line options, then terminates the program. The default is off. * *`-i' / `--internationalize'*: Put internationalization macro _() around text output so that the generated program can be internationalized using the GNU gettext command. Presently only implemented for C output. * *`-l' / `--language'*: Output language. The programming language in which Genparse writes the output files. Currently only C, C++ and Java are supported. The default is C. To indicate C++, the following strings may be used: "c++", "cpp", "cc", and "cxx". In order to generate Java code use "java" or "Java". * *`-m' / `--longmembers'*: Use long options for the members of the parser class (struct). The default is to use the short representation except if there is only a long representation defined in the genparse file. If this option is set then the behavior is reverted. The long representation is used then except if there is only a short representation defined. * *`-o' / `--outfile'*: Output file name. Specifies the main part of the output file name. The extension will be determined by the output language and possibly by other options. For example, when the output language is C, giving this option an argument of "file" will result in output file names of "file.h", "file.c" and "file_cb.c" for the header, parser, and callback files, respectively. Default value is "parse_cl". Use the `-D' option in order to specify a directory for the results. * *`-p' / `--parsefunc'*: Name of the parsing function/class. This option allows the user to specify the name of the function (for C) or class (for C++ and Java) that does the actual command line parsing. Default value is "Cmdline". In Java this value is also used as a prefix for the names of the interface and the exception class. Leaving the default names the interface "CmdlineInterface" and the exception class "CmdlineEx". * *`-P' / `--manyprints'*: Output help text for every command line parameter in a separate print command. * *`-q' / `--quiet'*: Quiet mode. * *`-s' / `--static-headers'*: Keep the descriptive header on top of the generated files static. Without this option genparse prints creation date and time, Linux kernel version, kernel build time, computer architecture name, host name and user name. * *`-v' / `--version'*: Version. If this option is set, the version number is displayed, then the program is terminated. The default value is off. * *`-D' / `--directory'*: Directory for storing results. The `-h' and `-v' options can be overridden by defining them to be something else in the Genparse file. However, they cannot be turned off completely. In other words, you can define your own `-h' and `-v' options or let Genparse create them with the default behavior.  File: genparse.info, Node: Genparse File Syntax, Next: The Future, Prev: Genparse Options, Up: Top 4 Genparse File Syntax ********************** * Menu: * Global Definitions:: * Parameter Definitions:: * Usage Function:: * Genparse File Grammar::  File: genparse.info, Node: Global Definitions, Next: Parameter Definitions, Up: Genparse File Syntax 4.1 Global Definitions ====================== The following definitions are allowed on top of the parameter definitions. All of them are optional. They may appear in any order. * *Include files*: Include statements in the C syntax, e.g. `#include "file.h"' or `#include '. Ignored in languages other than C and C++. Only 1 include statement per line. * *Mandatory parameters*: Parameters which must be specified. They are not bound to any command line options. Example: `#mandatory x'. Use multiple `#mandatory' statements in order to specify multiple mandatory parameters. Only 1 `#mandatory' statement per line. Note that Genparse does not check for mandatory parameters, they are only printed in the `usage ()' function with the `__MANDATORIES__' directive (*Note __MANDATORIES__::.). *Deprecated: add mandatory parameters in the #usage section instead.* * *Exit value*: Defines the exit value in case of an error. Default is `EXIT_FAILURE'. Example: `#exit_value -1' or `#exit_value MY_FAILURE'. * *#break_lines*: Width to which lines shall be broken on the help screen. If no `#break_lines' directive is specified then lines will be printed exactly as given in the genparse file. Note that genparse doesn't know the width of macros included from other files, so automatic line breaking will probably not work properly if for example `__STRING__' macros (*Note __STRING__::.) are used. Lines can still be broken manually using the `__NL__' macro (*Note __NL__::.) in places where Genparse doesn't break lines as expected. * *#no_struct*: If `#no_struct' is specified then no struct will be defined which will be filled with the command line parameters in the generated parser. This may be useful if you want to add your own code with `__CODE__' statements instead (*Note __CODE__::.) Only supported for C output. * *#export_long_options*: If `#export_long_options' is defined then a function `get_long_options ()' is added which exports the longoptions array used by `getopt_long ()'. This directive is only available for C output, for other languages it is ignored. * *Global callback*: The name of a global callback function which will be called after all parameter specific callback functions. Example: `my_callback ()'. Only 1 global callback function is allowed.  File: genparse.info, Node: Parameter Definitions, Next: Usage Function, Prev: Global Definitions, Up: Genparse File Syntax 4.2 Parameter Definitions ========================= Each command line parameter must be defined in the form short_names[*|!] [/ long_name[*|!][=opt_name]] type [ options ] A short_name is a single letter (small or capital) or a single digit. long_name is a longer (more descriptive) option name. On the command line a short name will be preceded by a single dash (e.g. `-a') and a long version will be preceded by two dashes (e.g. `--all'). If a long parameter name is not necessary, you may specify only the short one (and the slash need not appear). In order to specify a parameter that only has a long name set short_names to `NONE'. It is possible to have multiple short options, so for example setting short_name to 'aA' and long_name to 'all' would allow to specify the command line switch as `-a' or `-A' or `--all', all of them doing the same thing. long options can be followed by a descriptive designation (*Note opt_name::.). A `*' after `short_name' or `long_name' makes the argument optional. This can be specified for short and long options separately. A `!' after `short_name' or `long_name' makes the option boolean. This allows one to combine a boolean short option with a long option with an optional or mandatory argument or to combine a boolean long option with a short option with an optional or mandatory argument. A `!' doesn't make sense if the option's type is `flag'. Examples: o* / oparam* string "Both short and long option have an optional" "argument" p* / pparam string "Short option has an optional argument," "long option requires an argument." q / qparam* string "Short option reqires an argument," "long option has an optional argument." P* / Pparam! string "Short option has an optional argument," "long option none." Q!/ Qparam* string "Short option has no argument, long option has an" "optional argument." type must be one of `int' `float' `char' `string' or `flag'. The first four should be self-explanatory. The last is a "switch" option that takes no arguments. For C output and if `--gnulib' (*Note gnulib::.) is set on the command line additionally the following types are allowed: `long' (for long int), `ulong' (for unsigned long int), `intmax' (for intmax_t, defined in Gnulib), `uintmax' (for uintmax_t), `double'. The following four options are supported. They may appear in any order and except for descriptions only one of each field may be defined per option. * A *default value* for the parameter. For a string this is just the plain default value, whatever it is. For strings, a default must be specified within braces and quotes, and may include whitespace, e.g. {"my default value"}. For a char parameter it must be enclosed in single quotes, e.g. 'a' or '\n'. * A *range* of values within brackets. The low and high values are specified between a range specifier (either '...' or '..'). Either the high or the low value may be omitted for a range bounded on one side only. The parameter will be checked to make sure that it lies within this range. * A *callback function*. This function is called after any range checking is performed. The purpose of the callback to do validity checking that is more complicated than can be specified in the genparse file. For example, you might write a program that requires input to be prime numbers, strings of a certain length, etc. * A *description* in double quotes. It is printed by the `usage ()' function. If one line is not enough then specify multiple descriptions, one per line and each of them in double quotes. If the description starts in the 1st column in the Genparse file then it will also be printed in the 1st column in the `usage ()' function. * A *Genparse include file*. Includes another Genparse (.gp) file, e.g `#gp_include another.gp'. Only parameter definitions are allowed in the included file, no global directives. * An *__ERR_MSG__(err_txt)* directive. Specifies the error message which is printed when the argument could not be converted. Example: `__ERR_MSG__("%s: invalid argument")'. This message will be printed when either the conversion function failed or when the argument was out of range (*Note range::.). Assumes to contain one `%s' which will be replaced with the agrument which could not be converted. Only available when Genparse is invoked with `--gnulib' (*Note gnulib::.), ignored otherwise. Optionally a conversion function can be added as a second argument, e. g. `__ERR_MSG__("%s: invalid argument", quotearg)'. This would lead to an error message like `error (EXIT_FAILURE, 0, "%s: invalid argument", quotearg (optind))'. * An *__ADD_FLAG__* directive. Makes sense only if the command line parameter is not already a flag, in this case an additional flag parameter is added which will be set if the command line parameter was specified on the command line. This option is automatically set if a parameter has an optional argument. * A *__CODE__(statements)* directive. The specified code statements are copied literally. Example: `__CODE__(printf ("Parameter x was set");)'. The specified code can extend over more than one line. In order to give Genparse the chance to indent the code properly, do not mix space and tab indentations in one `__CODE__' statement. * A *__STORE_LONGINDEX__* directive. Instructs Genparse to add an interer type field to the result class which will be set to the longindex variable (last argument in the call to `getopt_long ()'). This new field will get the same name as the result field it is related to but with an `_li' postfix.  File: genparse.info, Node: Usage Function, Next: Genparse File Grammar, Prev: Parameter Definitions, Up: Genparse File Syntax 4.3 Usage Function ================== Genparse also generates a usage () function which prints a help text to stdout about the usage of the program for which Genparse is generating the parser. It is automatically executed when * The command line option -h is set. * An invalid command line option is given. * The optind_long function call (which is the heart of every Genparse generated parser) returns an error code. This usage function can be customized by specifying a usage section at the bottom of the Genparse file. If no such section is specified it defaults to #usage_begin usage: __PROGRAM_NAME__ __OPTIONS_SHORT__ __MANDATORIES__ __GLOSSARY__ #usage_end The usage section starts with `#usage_begin' and ends with `#usage_end'. Any text between is printed verbatim except for the following keywords, which will be replaced as listed below: * `__PROGRAM_NAME__': The program name. In C and C++ the program name is given in `argv[0]'. * `__OPTIONS_SHORT__': A list of available short form options, e.g. `[ -abc ]'. * `__MANDATORIES__': A list of all mandatory parameters as defined with `#mandatory' commands (*Note Global Definitions::.). *Deprecated: List mandatory parameters here directly.* * `__GLOSSARY__': A description of all command line options. This is the information given for the parameter definitons (see *Note Parameter Definitions::.) in human readable form. It includes the parameter type, default, range and any comments. A line which contains `__GLOSSARY__' is replaced by the glossary of the parameters, any other text in the same line is ignored. Example: [ -h ] [ --help ] (type=FLAG) Display help information. * `__GLOSSARY_GNU__': Same as `__GLOSSARY__' but in GNU style. Optionally followed by an integer in brackets which specifies the indentation of the descriptive text (e.g. `__GLOSSARY__(30)'). Default indentation is 24. Example: -h, --help Display help information. * `__STRING__(s)': A string constant, in C probably a string macro defined with the #define preprocessor command. This macro can be imported from another file using the include directive in the genparse file (*Note Include files::.). Ignored when generating Java output. * `__INT__(x)': An integer constant, in C probably an integer macro defined with the #define preprocessor command. This macro can be imported from another file using the include directive in the genparse file (*Note Include files::.). Ignored when generating Java output. * `__CODE__(statements)': *Note __CODE__::. * `__DO_NOT_DOCUMENT__': Any line which contains this macro will not be printed in the `usage ()' function. Can be used for implementing command line parameters without listing them on the help screen. * `__NL__': New line. Useful for breaking lines manually while automatic line breaking is on (*Note #break_lines::.). Ignored when generating Java output. * `__NEW_PRINT__': Close the active print command and start a new one. * `__COMMENT__(text)': Comment in the code for printing the usage text. long options can be followed by an `=' sign and an optional designation `opt_name' in the genparse file (*Note Parameter Definitions::.) which can be referred to in the following description (*Note parameter-description::.). It will be used in the `usage ()' function only. For example the following genparse line s / block-size=SIZE int "use SIZE-byte blocks" will lead to the following line in the help screen [ -s ] [ --block-size=SIZE ] (type=INTEGER) use SIZE-byte blocks in genparse style (*Note __GLOSSARY__::.) or -s, --block-size=SIZE use SIZE-byte blocks in GNU style (*Note __GLOSSARY_GNU__::.). It is also possible to put square braces around the optional name in order to indicate that the argument is optional. This has no meaning for the generated parser however. Use `*' postfixes in order to make an argument optional (*Note optional_arguments::.). s* / block*[=SIZE] int "use blocks." "If SIZE is not given then they will get a size of 1kB." will lead to the following line in the help screen -s, --block[=SIZE] use blocks. If SIZE is not given then they will get a size of 1kB. For an example of the generated default usage () function in C *Note Parser Files::.  File: genparse.info, Node: Genparse File Grammar, Prev: Usage Function, Up: Genparse File Syntax 4.4 Genparse File Grammar ========================= In order to better understand the subtleties of the Genparse file format and its parsing, in the section we provide the formal grammar of Genparse files. This is a slightly edited version of the `bison' grammar. Items in capitals are tokens that are defined in the lex file. all: globals entries usages globals: /* empty */ | globals global | global global: include | mandatory | exit_value | break_lines | export_long_options | no_struct | global_callback include: #include mandatory: #mandatory exit_value: #exit_value break_lines: #break_lines export_long_options: #export_long_options no_struct: #no_struct global_callback: callback entries: entries entry | entry entry: new_entry | gp_include new_entry: param type options options: options option | option option: default | range | callback | descs | store_longindex | err_msg | comment | code_lines descs: descs desc | desc err_msg: __ERR_MSG__ ( ALNUM ) | __ERR_MSG__ ( QUOTED ) comment: __COMMENT__ ( COMMENT_STR ) gp_include: #gp_include param: short_params | NONE / long_param | short_params / long_param short_params: VAR | VAR * | VAR ! long_param: multi_long_option | multi_long_option mandatory_opt_name | multi_long_option optional_opt_name mandatory_opt_name: EQUAL C_VAR | EQUAL OPT_NAME optional_opt_name: [ mandatory_opt_name ] multi_long_option: VAR | VAR * | VAR ! type: INT | LONG | ULONG | INTMAX | UINTMAX | FLOAT | DOUBLE | STRING | CHAR | FLAG default: ALNUM | CHAR_VAL | QUOTED_STR range: [ contiguous_range ] contiguous_range: ALNUM range_spec more_range | range_spec more_range more_range: ALNUM | C_VAR | range_spec: .. | ... callback: VAR () description: QUOTED_STR usages: /* empty */ | usages usage | usage usage: USAGE_STR code_lines: code_lines code_line | code_line code_line: single_code_line CODE_END | CODE_END ; single_code_line: CODE_LINE | OPEN_ROUND_BRACE | CLOSE_ROUND_BRACE | single_code_line single_code_line  File: genparse.info, Node: The Future, Next: Some History, Prev: Genparse File Syntax, Up: Top 5 The Future ************ While there's practically no limit to the number of enhancements that could be made to Genparse, I'll limit this section to a number of features that actually have a chance of being implemented. * Back up output files before overwriting them. Minimally, old callback files should be saved, because those are meant to be modified by the user. This isn't hard, but I'd like to do it "right" by encapsulating the functionality into a general-purpose file manipulation class. * Enumerated types for strings. Currently command line strings are not checked for any sort of validity. This would allow the user to specify a list of valid values for a particular string. The syntax would probably be like an enumerated type in C. * A way to distinguish between optional and mandatory non-option command line parameters. * Support for more output languages. Perhaps tcl and perl first, and other scripting languages afterwards. This should be pretty easy to do since it would only require adding the appropriate member functions to the command line parameter list class and a little bit of supporting code here and there. * Place `getopt.h', `getopt.c', and `getopt_internal.c' in a neutral shared directory so that others can copy them locally for their own use.  File: genparse.info, Node: Some History, Next: Index, Prev: The Future, Up: Top 6 Some History ************** Long, long ago in a lab far, far away, I became frustrated with the time required to write command line parsing routines, even with `getopt ()', for all of the new programs that I developed. I felt that it was tedious work that offered too many opportunities to cut corners and produce error-prone code. In late 1997, the seeds of Genparse fell together in my head, and I released version 0.1, written in C, on New Year's Day, 1998. The only output language supported was C, and it did not allow long options. Parameter types were limited to flags, integers, floats, and strings, and range checking was supported. It soon became clear that although Genparse was fairly useful (I was already using it to create parsers for my own projects), it was severely limited and could use a number of additional features. With the help of a handful of people who provided feedback and constructive criticism, version 0.2 was soon released. New features included a more flexible Genparse file format (essentially, the current format) which was parsed by `lex' and `bison' rather than by my C code. Parameter descriptions and callback functions were now supported. A few bug fixes later, version 0.2.2 was released. It was to remain current for over a year. In June 1999, I revisited Genparse to add the `#include' and `#mandatory' directives, as well as to clean up the code a bit and perform some minor bug stomping. The resulting version 0.3 was distributed with Debian/GNU Linux. During my revision that produced 0.3, I became aware of the acute coding slop that had evolved. To call the output functions "spaghetti logic" would have been an understatement. Naturally, I needed to modularize Genparse, and the best way of doing so seemed to be a re-write in C++. In December 1999, I undertook this task. The code became separated into three logical sections: * The parser, a `bison' grammar with supporting code. * An internal representation, encapsulated in a C++ class. * Output functions for each supported language, built into the C++ class. This design greatly improved the extensibility of Genparse. In order to support a new output language, one only needs to add appropriate member functions to the C++ class. This implementation became version 0.4. An important part of 0.4 was support for C++ as an output language. Rather than returning a `struct' containing the command line parameter values, a C++ command line parser would be encapsulated by a C++ class. The user would call the member functions of this class to access parameter values, making for a cleaner interface than C can support. Version 0.4 also included a more comprehensive set of test suites along with the documentation that you currently are reading. In Fall 2000, I revisited Genparse. Version 0.4 did not support options with no short form, and thus was limited to 52 options at most. Version 0.5 lifted this restriction, included `' rather than the depreciated `' in output files, and fixed up user-defined include files so that they worked with quotes as well as "<>". Also, I finally figured out how to get Genparse to reliably compile on systems both with and without the `getopt_long ()' function. Version 0.5.1 fixed a few problems with the lexical analyzer that resulted in default values for floats not being used properly. This version also eliminated the mandatory use of the `-q' option.  File: genparse.info, Node: Index, Prev: Some History, Up: Top 7 Index ******* [index] * Menu: * C header file: Header Files. (line 6) * C main program: Main Program. (line 6) * C output: Simplifying Command Line Parsing with Genparse. (line 80) * C parser file: Parser Files. (line 6) * C++ callback file: Callback File. (line 6) * C++ filename extensions: Genparse Options. (line 12) * C++ header file: Header File. (line 6) * C++ main program: Main C++ Program. (line 6) * C++ output: C++ Output. (line 6) * C++ parser file: Parser File. (line 6) * Callback functions: Include Files and Callbacks. (line 31) * Command line, rearranging: Adding Command Line Options. (line 107) * Contact info: Introduction. (line 60) * Genparse file: Introduction. (line 14) * Genparse File Grammar: Genparse File Grammar. (line 6) * Genparse file syntax: Genparse File Syntax. (line 6) * Genparse file, simple example: Simplifying Command Line Parsing with Genparse. (line 16) * Genparse files, making: Making Genparse Files. (line 6) * Genparse, invoking, example: Simplifying Command Line Parsing with Genparse. (line 62) * getopt (): A Simple Application. (line 59) * getopt_long (): A Simple Application. (line 72) * History: Some History. (line 6) * Idiosyncrasies: Idiosyncrasies. (line 6) * Include files: Include Files and Callbacks. (line 12) * Java exception class: Java Exception Class. (line 6) * Java implementation: Java Implementation. (line 6) * Java interface: Java Interface. (line 6) * Java main program: Main Java Program. (line 6) * Java output: Java Output. (line 6) * Limitations: Introduction. (line 54) * Linking: Idiosyncrasies. (line 27) * Optind: Adding Command Line Options. (line 107) * Option, help: Header Files. (line 58) * Option, quiet: Header Files. (line 58) * Option, version: Header Files. (line 58) * Options: Genparse Options. (line 6) * Overriding default options: Genparse Options. (line 92) * Usage function: Introduction. (line 34)  Tag Table: Node: Top1110 Node: Introduction1619 Node: Making Genparse Files4466 Node: A Simple Application5057 Node: Adding Command Line Options8319 Ref: Adding Command Line Options-Footnote-112856 Node: Simplifying Command Line Parsing with Genparse12919 Node: Header Files16898 Ref: Header Files-Footnote-121228 Node: Parser Files21329 Ref: Parser Files-Footnote-126330 Node: Main Program26421 Node: Include Files and Callbacks28421 Node: C++ Output32634 Node: Header File33521 Node: Parser File35937 Ref: Parser File-Footnote-139979 Node: Callback File40109 Node: Main C++ Program41206 Node: Java Output43009 Node: Java Interface43865 Node: Java Implementation45176 Node: Java Exception Class49799 Node: Main Java Program50564 Node: Idiosyncrasies52856 Node: Genparse Options54076 Ref: gnulib55578 Ref: internationalize56025 Node: Genparse File Syntax58909 Node: Global Definitions59166 Ref: Include files59459 Ref: #break_lines60372 Node: Parameter Definitions61752 Ref: optional_arguments62837 Ref: range64745 Ref: parameter-description65416 Ref: __CODE__67099 Node: Usage Function67780 Ref: __MANDATORIES__69011 Ref: __GLOSSARY__69205 Ref: __GLOSSARY_GNU__69710 Ref: __STRING__70019 Ref: __NL__70884 Ref: opt_name71212 Node: Genparse File Grammar72551 Node: The Future75487 Node: Some History76969 Node: Index80548  End Tag Table genparse-0.9.1/doc/Makefile.am0000644000076600001440000000131410733740572013060 00000000000000all: doxygen htmlinfo pdfinfo htmlman info_TEXINFOS = genparse.texi dist_man_MANS = genparse.1 .PHONY: doxygen doxygen: html/doxygen/index.html EXTRA_DIST = Doxyfile.in Doxyfile: $(srcdir)/Doxyfile.in html/doxygen/index.html: Doxyfile mkdir -p html @DOXYGEN@ Doxyfile .PHONY: htmlinfo htmlinfo: html/info/genparse.html html/info/genparse.html: genparse.texi mkdir -p html @TEXI2HTML@ --subdir html/info --split section $< .PHONY: pdfinfo pdfinfo: info.pdf info.pdf: genparse.texi @TEXI2PDF@ -o $@ $< .PHONY: htmlman htmlman: html/man/genparse.html html/man/genparse.html: genparse.1 mkdir -p html/man @MAN2HTML@ $< > $@ clean-local: -rm -rf html/info/*.html html/man/*.html html/doxygen/ info.pdf genparse-0.9.1/doc/Makefile.in0000644000076600001440000007263011732677151013104 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(dist_man_MANS) $(srcdir)/Doxyfile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/stamp-vti $(srcdir)/version.texi mdate-sh \ texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = Doxyfile SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/genparse.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = genparse.dvi PDFS = genparse.pdf PSS = genparse.ps HTMLS = genparse.html TEXINFOS = genparse.texi TEXI2DVI = texi2dvi MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ info_TEXINFOS = genparse.texi dist_man_MANS = genparse.1 EXTRA_DIST = Doxyfile.in all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ cd $(srcdir); \ else \ rc=$$?; \ cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texi.pdf: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $< .texi.html: rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ else \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi $(srcdir)/genparse.info: genparse.texi $(srcdir)/version.texi genparse.dvi: genparse.texi $(srcdir)/version.texi genparse.pdf: genparse.texi $(srcdir)/version.texi genparse.html: genparse.texi $(srcdir)/version.texi $(srcdir)/version.texi: $(srcdir)/stamp-vti $(srcdir)/stamp-vti: genparse.texi $(top_srcdir)/configure @(dir=.; test -f ./genparse.texi || dir=$(srcdir); \ set `$(SHELL) $(srcdir)/mdate-sh $$dir/genparse.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && \ (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf genparse.aux genparse.cp genparse.cps genparse.cv genparse.cvs \ genparse.ev genparse.evs genparse.fn genparse.fns \ genparse.ky genparse.kys genparse.log genparse.ma \ genparse.mas genparse.ov genparse.ovs genparse.pg \ genparse.pgs genparse.tmp genparse.toc genparse.tp \ genparse.tps genparse.vr genparse.vrs genparse.dvi \ genparse.pdf genparse.ps genparse.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) $(MANS) installdirs: for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-man install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ if test -d "$$d$$p"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ else \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ fi; \ done install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \ done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \ done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-man uninstall-pdf-am uninstall-ps-am uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-local \ dist-info distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-aminfo maintainer-clean-generic \ maintainer-clean-vti mostlyclean mostlyclean-aminfo \ mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-dvi-am uninstall-html-am \ uninstall-info-am uninstall-man uninstall-man1 \ uninstall-pdf-am uninstall-ps-am all: doxygen htmlinfo pdfinfo htmlman .PHONY: doxygen doxygen: html/doxygen/index.html Doxyfile: $(srcdir)/Doxyfile.in html/doxygen/index.html: Doxyfile mkdir -p html @DOXYGEN@ Doxyfile .PHONY: htmlinfo htmlinfo: html/info/genparse.html html/info/genparse.html: genparse.texi mkdir -p html @TEXI2HTML@ --subdir html/info --split section $< .PHONY: pdfinfo pdfinfo: info.pdf info.pdf: genparse.texi @TEXI2PDF@ -o $@ $< .PHONY: htmlman htmlman: html/man/genparse.html html/man/genparse.html: genparse.1 mkdir -p html/man @MAN2HTML@ $< > $@ clean-local: -rm -rf html/info/*.html html/man/*.html html/doxygen/ info.pdf # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/depcomp0000755000076600001440000004260211341041447011630 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: genparse-0.9.1/README0000644000076600001440000000367007175662025011150 00000000000000Mike Borella NOTE: the documentation is slightly out of date... ------------------------------------------------------------------------------ DESCRIPTION Genparse is a generic command line parser generator. From simple and concise specification file, you can define the command line parameters and switches that you would like to be able to pass to your program. Genparse creates the C or C++ code of the parser for you, which you can then compile as a separate file and link with your program. Genparse is documented completely in the accompanying texinfo file. Standard installation will set this file up for you. Alternatively, you can dump the texinfo to postscript or PDF. ------------------------------------------------------------------------------- OPERATION usage: genparse [ -dcoflphqv ] [ -d ] Turns on logging. [ -c ] [ --cppext ] C++ file extension. (default = cc) [ -o ] [ --outfile ] Output file name. (default = parse_cl) [ -f ] [ --logfile ] Log file name. (default = genparse.log) [ -l ] [ --language ] Output language. (default = c) [ -p ] [ --parsefunc ] Name of parsing function / class. (default = Cmdline) [ -h ] [ --help ] Display help information. (default = 0) [ -v ] [ --version ] Output version. (default = 0) ------------------------------------------------------------------------------- COMMENTS I wrote genparse because I got tired of writing a new command line parser for every little utility I made. Most of these parsers are very similar, so it seemed as if a great deal of the functionality required by most programs could be automatically generated. So far, genparse has saved me a lot of time. In fact, I used genparse to create the command-line parser for itself! However, I imagine that it may not be powerful enough for large applications with complex sets of parameters. Please send me all comments, feedback, and bug reports. genparse-0.9.1/COPYING0000644000076600001440000004311007103372162011303 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. genparse-0.9.1/aclocal.m40000644000076600001440000023477311732677146012146 00000000000000# generated automatically by aclocal 1.10a -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_check_class.html # =========================================================================== # # SYNOPSIS # # AC_CHECK_CLASS # # DESCRIPTION # # AC_CHECK_CLASS tests the existence of a given Java class, either in a # jar or in a '.class' file. # # *Warning*: its success or failure can depend on a proper setting of the # CLASSPATH env. variable. # # Note: This is part of the set of autoconf M4 macros for Java programs. # It is VERY IMPORTANT that you download the whole set, some macros depend # on other. Unfortunately, the autoconf archive does not support the # concept of set of macros, so I had to break it for submission. The # general documentation, as well as the sample configure.in, is included # in the AC_PROG_JAVA macro. # # LICENSE # # Copyright (c) 2008 Stephane Bortzmeyer # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AC_CHECK_CLASS],[ AC_REQUIRE([AC_PROG_JAVA]) ac_var_name=`echo $1 | sed 's/\./_/g'` dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is dnl dynamic I need an extra level of extraction AC_MSG_CHECKING([for $1 class]) AC_CACHE_VAL(ac_cv_class_$ac_var_name, [ if test x$ac_cv_prog_uudecode_base64 = xyes; then dnl /** dnl * Test.java: used to test dynamicaly if a class exists. dnl */ dnl public class Test dnl { dnl dnl public static void dnl main( String[] argv ) dnl { dnl Class lib; dnl if (argv.length < 1) dnl { dnl System.err.println ("Missing argument"); dnl System.exit (77); dnl } dnl try dnl { dnl lib = Class.forName (argv[0]); dnl } dnl catch (ClassNotFoundException e) dnl { dnl System.exit (1); dnl } dnl lib = null; dnl System.exit (0); dnl } dnl dnl } cat << \EOF > Test.uue begin-base64 644 Test.class yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA JwAAAAIAKA== ==== EOF if uudecode$EXEEXT Test.uue; then : else echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC echo "configure: failed file was:" >&AC_FD_CC cat Test.uue >&AC_FD_CC ac_cv_prog_uudecode_base64=no fi rm -f Test.uue if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then eval "ac_cv_class_$ac_var_name=yes" else eval "ac_cv_class_$ac_var_name=no" fi rm -f Test.class else AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"], [eval "ac_cv_class_$ac_var_name=no"]) fi eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`" HAVE_LAST_CLASS=$ac_var_val if test x$ac_var_val = xyes; then ifelse([$2], , :, [$2]) else ifelse([$3], , :, [$3]) fi ]) dnl for some reason the above statment didn't fall though here? dnl do scripts have variable scoping? eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" AC_MSG_RESULT($ac_var_val) ]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_check_junit.html # =========================================================================== # # SYNOPSIS # # AC_CHECK_JUNIT # # DESCRIPTION # # AC_CHECK_JUNIT tests the availability of the Junit testing framework, # and set some variables for conditional compilation of the test suite by # automake. # # If available, JUNIT is set to a command launching the text based user # interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT and @TESTS_JUNIT@ # is set to $TESTS_JUNIT, otherwise they are set to empty values. # # You can use these variables in your Makefile.am file like this : # # # Some of the following classes are built only if junit is available # JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java # # noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@ # # EXTRA_JAVA = $(JAVA_JUNIT) # # TESTS_JUNIT = AllJunitTests # # TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@ # # EXTRA_TESTS = $(TESTS_JUNIT) # # AllJunitTests : # echo "#! /bin/sh" > $@ # echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@ # chmod +x $@ # # LICENSE # # Copyright (c) 2008 Luc Maisonobe # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AC_CHECK_JUNIT],[ AC_CACHE_VAL(ac_cv_prog_JUNIT,[ AC_CHECK_CLASS(junit.textui.TestRunner) if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner' fi]) AC_MSG_CHECKING([for junit]) if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then JUNIT="$ac_cv_prog_JUNIT" JAVA_JUNIT='$(JAVA_JUNIT)' TESTS_JUNIT='$(TESTS_JUNIT)' else JUNIT= JAVA_JUNIT= TESTS_JUNIT= fi AC_MSG_RESULT($JAVA_JUNIT) AC_SUBST(JUNIT) AC_SUBST(JAVA_JUNIT) AC_SUBST(TESTS_JUNIT)]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_prog_java.html # =========================================================================== # # SYNOPSIS # # AC_PROG_JAVA # # DESCRIPTION # # Here is a summary of the main macros: # # AC_PROG_JAVAC: finds a Java compiler. # # AC_PROG_JAVA: finds a Java virtual machine. # # AC_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!). # # AC_CHECK_RQRD_CLASS: finds if we have the given class and stops # otherwise. # # AC_TRY_COMPILE_JAVA: attempt to compile user given source. # # AC_TRY_RUN_JAVA: attempt to compile and run user given source. # # AC_JAVA_OPTIONS: adds Java configure options. # # AC_PROG_JAVA tests an existing Java virtual machine. It uses the # environment variable JAVA then tests in sequence various common Java # virtual machines. For political reasons, it starts with the free ones. # You *must* call [AC_PROG_JAVAC] before. # # If you want to force a specific VM: # # - at the configure.in level, set JAVA=yourvm before calling AC_PROG_JAVA # # (but after AC_INIT) # # - at the configure level, setenv JAVA # # You can use the JAVA variable in your Makefile.in, with @JAVA@. # # *Warning*: its success or failure can depend on a proper setting of the # CLASSPATH env. variable. # # TODO: allow to exclude virtual machines (rationale: most Java programs # cannot run with some VM like kaffe). # # Note: This is part of the set of autoconf M4 macros for Java programs. # It is VERY IMPORTANT that you download the whole set, some macros depend # on other. Unfortunately, the autoconf archive does not support the # concept of set of macros, so I had to break it for submission. # # A Web page, with a link to the latest CVS snapshot is at # . # # This is a sample configure.in Process this file with autoconf to produce # a configure script. # # AC_INIT(UnTag.java) # # dnl Checks for programs. # AC_CHECK_CLASSPATH # AC_PROG_JAVAC # AC_PROG_JAVA # # dnl Checks for classes # AC_CHECK_RQRD_CLASS(org.xml.sax.Parser) # AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver) # # AC_OUTPUT(Makefile) # # LICENSE # # Copyright (c) 2008 Stephane Bortzmeyer # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AC_PROG_JAVA],[ AC_REQUIRE([AC_EXEEXT])dnl if test x$JAVAPREFIX = x; then test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT) else test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX) fi test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH]) AC_PROG_JAVA_WORKS AC_PROVIDE([$0])dnl ]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_prog_java_works.html # =========================================================================== # # SYNOPSIS # # AC_PROG_JAVA_WORKS # # DESCRIPTION # # Internal use ONLY. # # Note: This is part of the set of autoconf M4 macros for Java programs. # It is VERY IMPORTANT that you download the whole set, some macros depend # on other. Unfortunately, the autoconf archive does not support the # concept of set of macros, so I had to break it for submission. The # general documentation, as well as the sample configure.in, is included # in the AC_PROG_JAVA macro. # # LICENSE # # Copyright (c) 2008 Stephane Bortzmeyer # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AC_PROG_JAVA_WORKS], [ AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes) if test x$uudecode = xyes; then AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [ dnl /** dnl * Test.java: used to test if java compiler works. dnl */ dnl public class Test dnl { dnl dnl public static void dnl main( String[] argv ) dnl { dnl System.exit (0); dnl } dnl dnl } cat << \EOF > Test.uue begin-base64 644 Test.class yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ= ==== EOF if uudecode$EXEEXT Test.uue; then ac_cv_prog_uudecode_base64=yes else echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC echo "configure: failed file was:" >&AC_FD_CC cat Test.uue >&AC_FD_CC ac_cv_prog_uudecode_base64=no fi rm -f Test.uue]) fi if test x$ac_cv_prog_uudecode_base64 != xyes; then rm -f Test.class AC_MSG_WARN([I have to compile Test.class from scratch]) if test x$ac_cv_prog_javac_works = xno; then AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly]) fi if test x$ac_cv_prog_javac_works = x; then AC_PROG_JAVAC fi fi AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [ JAVA_TEST=Test.java CLASS_TEST=Test.class TEST=Test changequote(, )dnl cat << \EOF > $JAVA_TEST /* [#]line __oline__ "configure" */ public class Test { public static void main (String args[]) { System.exit (0); } } EOF changequote([, ])dnl if test x$ac_cv_prog_uudecode_base64 != xyes; then if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then : else echo "configure: failed program was:" >&AC_FD_CC cat $JAVA_TEST >&AC_FD_CC AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)) fi fi if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then ac_cv_prog_java_works=yes else echo "configure: failed program was:" >&AC_FD_CC cat $JAVA_TEST >&AC_FD_CC AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?)) fi rm -fr $JAVA_TEST $CLASS_TEST Test.uue ]) AC_PROVIDE([$0])dnl ] ) # =========================================================================== # http://autoconf-archive.cryp.to/ac_prog_javac.html # =========================================================================== # # SYNOPSIS # # AC_PROG_JAVAC # # DESCRIPTION # # AC_PROG_JAVAC tests an existing Java compiler. It uses the environment # variable JAVAC then tests in sequence various common Java compilers. For # political reasons, it starts with the free ones. # # If you want to force a specific compiler: # # - at the configure.in level, set JAVAC=yourcompiler before calling # AC_PROG_JAVAC # # - at the configure level, setenv JAVAC # # You can use the JAVAC variable in your Makefile.in, with @JAVAC@. # # *Warning*: its success or failure can depend on a proper setting of the # CLASSPATH env. variable. # # TODO: allow to exclude compilers (rationale: most Java programs cannot # compile with some compilers like guavac). # # Note: This is part of the set of autoconf M4 macros for Java programs. # It is VERY IMPORTANT that you download the whole set, some macros depend # on other. Unfortunately, the autoconf archive does not support the # concept of set of macros, so I had to break it for submission. The # general documentation, as well as the sample configure.in, is included # in the AC_PROG_JAVA macro. # # LICENSE # # Copyright (c) 2008 Stephane Bortzmeyer # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AC_PROG_JAVAC],[ AC_REQUIRE([AC_EXEEXT])dnl if test "x$JAVAPREFIX" = x; then test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT) else test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX) fi test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH]) AC_PROG_JAVAC_WORKS AC_PROVIDE([$0])dnl ]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_prog_javac_works.html # =========================================================================== # # SYNOPSIS # # AC_PROG_JAVAC_WORKS # # DESCRIPTION # # Internal use ONLY. # # Note: This is part of the set of autoconf M4 macros for Java programs. # It is VERY IMPORTANT that you download the whole set, some macros depend # on other. Unfortunately, the autoconf archive does not support the # concept of set of macros, so I had to break it for submission. The # general documentation, as well as the sample configure.in, is included # in the AC_PROG_JAVA macro. # # LICENSE # # Copyright (c) 2008 Stephane Bortzmeyer # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AC_PROG_JAVAC_WORKS],[ AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [ JAVA_TEST=Test.java CLASS_TEST=Test.class cat << \EOF > $JAVA_TEST /* [#]line __oline__ "configure" */ public class Test { } EOF if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then ac_cv_prog_javac_works=yes else AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)]) echo "configure: failed program was:" >&AC_FD_CC cat $JAVA_TEST >&AC_FD_CC fi rm -f $JAVA_TEST $CLASS_TEST ]) AC_PROVIDE([$0])dnl ]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_try_compile_java.html # =========================================================================== # # SYNOPSIS # # AC_TRY_COMPILE_JAVA # # DESCRIPTION # # AC_TRY_COMPILE_JAVA attempt to compile user given source. # # *Warning*: its success or failure can depend on a proper setting of the # CLASSPATH env. variable. # # Note: This is part of the set of autoconf M4 macros for Java programs. # It is VERY IMPORTANT that you download the whole set, some macros depend # on other. Unfortunately, the autoconf archive does not support the # concept of set of macros, so I had to break it for submission. The # general documentation, as well as the sample configure.in, is included # in the AC_PROG_JAVA macro. # # LICENSE # # Copyright (c) 2008 Devin Weaver # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AC_TRY_COMPILE_JAVA],[ AC_REQUIRE([AC_PROG_JAVAC])dnl cat << \EOF > Test.java /* [#]line __oline__ "configure" */ ifelse([$1], , , [import $1;]) public class Test { [$2] } EOF if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class then dnl Don't remove the temporary files here, so they can be examined. ifelse([$3], , :, [$3]) else echo "configure: failed program was:" >&AC_FD_CC cat Test.java >&AC_FD_CC ifelse([$4], , , [ rm -fr Test* $4 ])dnl fi rm -fr Test*]) dnl dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([AM_PATH_CPPUNIT], [ AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)], cppunit_config_prefix="$withval", cppunit_config_prefix="") AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)], cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="") if test x$cppunit_config_exec_prefix != x ; then cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config fi fi if test x$cppunit_config_prefix != x ; then cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config fi fi AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) cppunit_version_min=$1 AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min) no_cppunit="" if test "$CPPUNIT_CONFIG" = "no" ; then AC_MSG_RESULT(no) no_cppunit=yes else CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` cppunit_version=`$CPPUNIT_CONFIG --version` cppunit_major_version=`echo $cppunit_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` cppunit_minor_version=`echo $cppunit_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` cppunit_micro_version=`echo $cppunit_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` cppunit_major_min=`echo $cppunit_version_min | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` if test "x${cppunit_major_min}" = "x" ; then cppunit_major_min=0 fi cppunit_minor_min=`echo $cppunit_version_min | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` if test "x${cppunit_minor_min}" = "x" ; then cppunit_minor_min=0 fi cppunit_micro_min=`echo $cppunit_version_min | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x${cppunit_micro_min}" = "x" ; then cppunit_micro_min=0 fi cppunit_version_proper=`expr \ $cppunit_major_version \> $cppunit_major_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \> $cppunit_minor_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \= $cppunit_minor_min \& \ $cppunit_micro_version \>= $cppunit_micro_min ` if test "$cppunit_version_proper" = "1" ; then AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) else AC_MSG_RESULT(no) no_cppunit=yes fi fi if test "x$no_cppunit" = x ; then ifelse([$2], , :, [$2]) else CPPUNIT_CFLAGS="" CPPUNIT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(CPPUNIT_CFLAGS) AC_SUBST(CPPUNIT_LIBS) ]) # po.m4 serial 17 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" < sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([gnulib/m4/c-strtod.m4]) m4_include([gnulib/m4/errno_h.m4]) m4_include([gnulib/m4/error.m4]) m4_include([gnulib/m4/exitfail.m4]) m4_include([gnulib/m4/extensions.m4]) m4_include([gnulib/m4/getopt.m4]) m4_include([gnulib/m4/gnulib-common.m4]) m4_include([gnulib/m4/gnulib-comp.m4]) m4_include([gnulib/m4/include_next.m4]) m4_include([gnulib/m4/inline.m4]) m4_include([gnulib/m4/inttypes-pri.m4]) m4_include([gnulib/m4/inttypes.m4]) m4_include([gnulib/m4/longlong.m4]) m4_include([gnulib/m4/onceonly.m4]) m4_include([gnulib/m4/stdbool.m4]) m4_include([gnulib/m4/stdint.m4]) m4_include([gnulib/m4/stdlib_h.m4]) m4_include([gnulib/m4/strerror.m4]) m4_include([gnulib/m4/string_h.m4]) m4_include([gnulib/m4/strtoimax.m4]) m4_include([gnulib/m4/strtol.m4]) m4_include([gnulib/m4/strtoll.m4]) m4_include([gnulib/m4/strtoul.m4]) m4_include([gnulib/m4/strtoull.m4]) m4_include([gnulib/m4/strtoumax.m4]) m4_include([gnulib/m4/unistd_h.m4]) m4_include([gnulib/m4/wchar.m4]) m4_include([gnulib/m4/wint_t.m4]) m4_include([gnulib/m4/xalloc.m4]) m4_include([gnulib/m4/xstrtod.m4]) m4_include([gnulib/m4/xstrtol.m4]) genparse-0.9.1/INSTALL0000644000076600001440000002245011341041446011302 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. genparse-0.9.1/mkinstalldirs0000755000076600001440000000664711341041447013072 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2006-05-11.19 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: genparse-0.9.1/Makefile.am0000644000076600001440000000014211673365611012312 00000000000000EXTRA_DIST = genparse.gp SUBDIRS = gnulib src doc examples tests ACLOCAL_AMFLAGS = -I gnulib/m4 genparse-0.9.1/gnulib/0000777000076600001440000000000011732700533011615 500000000000000genparse-0.9.1/gnulib/lib/0000777000076600001440000000000011732700534012364 500000000000000genparse-0.9.1/gnulib/lib/unistd.in.h0000644000076600001440000004165411673365613014407 00000000000000/* Substitute for and wrapper around . Copyright (C) 2003-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_UNISTD_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ # @INCLUDE_NEXT@ @NEXT_UNISTD_H@ #endif #ifndef _GL_UNISTD_H #define _GL_UNISTD_H /* mingw doesn't define the SEEK_* macros in . */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include #endif /* mingw fails to declare _exit in . */ #include #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ /* Get ssize_t. */ # include #endif #if @GNULIB_GETHOSTNAME@ /* Get all possible declarations of gethostname(). */ # if @UNISTD_H_HAVE_WINSOCK2_H@ # include # if !defined _GL_SYS_SOCKET_H # undef socket # define socket socket_used_without_including_sys_socket_h # undef connect # define connect connect_used_without_including_sys_socket_h # undef accept # define accept accept_used_without_including_sys_socket_h # undef bind # define bind bind_used_without_including_sys_socket_h # undef getpeername # define getpeername getpeername_used_without_including_sys_socket_h # undef getsockname # define getsockname getsockname_used_without_including_sys_socket_h # undef getsockopt # define getsockopt getsockopt_used_without_including_sys_socket_h # undef listen # define listen listen_used_without_including_sys_socket_h # undef recv # define recv recv_used_without_including_sys_socket_h # undef send # define send send_used_without_including_sys_socket_h # undef recvfrom # define recvfrom recvfrom_used_without_including_sys_socket_h # undef sendto # define sendto sendto_used_without_including_sys_socket_h # undef setsockopt # define setsockopt setsockopt_used_without_including_sys_socket_h # undef shutdown # define shutdown shutdown_used_without_including_sys_socket_h # endif # if !defined _GL_SYS_SELECT_H # undef select # define select select_used_without_including_sys_select_h # endif # endif #endif /* The definition of GL_LINK_WARNING is copied here. */ /* Declare overridden functions. */ #ifdef __cplusplus extern "C" { #endif #if @GNULIB_CHOWN@ # if @REPLACE_CHOWN@ # ifndef REPLACE_CHOWN # define REPLACE_CHOWN 1 # endif # if REPLACE_CHOWN /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE to GID (if GID is not -1). Follow symbolic links. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ # define chown rpl_chown extern int chown (const char *file, uid_t uid, gid_t gid); # endif # endif #elif defined GNULIB_POSIXCHECK # undef chown # define chown(f,u,g) \ (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ "doesn't treat a uid or gid of -1 on some systems - " \ "use gnulib module chown for portability"), \ chown (f, u, g)) #endif #if @GNULIB_CLOSE@ # if @UNISTD_H_HAVE_WINSOCK2_H@ /* Need a gnulib internal function. */ # define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1 # endif # if @REPLACE_CLOSE@ /* Automatically included by modules that need a replacement for close. */ # undef close # define close rpl_close extern int close (int); # endif #elif @UNISTD_H_HAVE_WINSOCK2_H@ # undef close # define close close_used_without_requesting_gnulib_module_close #elif defined GNULIB_POSIXCHECK # undef close # define close(f) \ (GL_LINK_WARNING ("close does not portably work on sockets - " \ "use gnulib module close for portability"), \ close (f)) #endif #if @GNULIB_DUP2@ # if !@HAVE_DUP2@ /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if NEWFD = OLDFD, otherwise close NEWFD first if it is open. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ extern int dup2 (int oldfd, int newfd); # endif #elif defined GNULIB_POSIXCHECK # undef dup2 # define dup2(o,n) \ (GL_LINK_WARNING ("dup2 is unportable - " \ "use gnulib module dup2 for portability"), \ dup2 (o, n)) #endif #if @GNULIB_ENVIRON@ # if !@HAVE_DECL_ENVIRON@ /* Set of environment variables and values. An array of strings of the form "VARIABLE=VALUE", terminated with a NULL. */ # if defined __APPLE__ && defined __MACH__ # include # define environ (*_NSGetEnviron ()) # else extern char **environ; # endif # endif #elif defined GNULIB_POSIXCHECK # undef environ # define environ \ (GL_LINK_WARNING ("environ is unportable - " \ "use gnulib module environ for portability"), \ environ) #endif #if @GNULIB_EUIDACCESS@ # if !@HAVE_EUIDACCESS@ /* Like access(), except that is uses the effective user id and group id of the current process. */ extern int euidaccess (const char *filename, int mode); # endif #elif defined GNULIB_POSIXCHECK # undef euidaccess # define euidaccess(f,m) \ (GL_LINK_WARNING ("euidaccess is unportable - " \ "use gnulib module euidaccess for portability"), \ euidaccess (f, m)) #endif #if @GNULIB_FCHDIR@ # if @REPLACE_FCHDIR@ /* Change the process' current working directory to the directory on which the given file descriptor is open. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ extern int fchdir (int /*fd*/); # define dup rpl_dup extern int dup (int); # define dup2 rpl_dup2 extern int dup2 (int, int); # endif #elif defined GNULIB_POSIXCHECK # undef fchdir # define fchdir(f) \ (GL_LINK_WARNING ("fchdir is unportable - " \ "use gnulib module fchdir for portability"), \ fchdir (f)) #endif #if @GNULIB_FSYNC@ /* Synchronize changes to a file. Return 0 if successful, otherwise -1 and errno set. See POSIX:2001 specification . */ # if !@HAVE_FSYNC@ extern int fsync (int fd); # endif #elif defined GNULIB_POSIXCHECK # undef fsync # define fsync(fd) \ (GL_LINK_WARNING ("fsync is unportable - " \ "use gnulib module fsync for portability"), \ fsync (fd)) #endif #if @GNULIB_FTRUNCATE@ # if !@HAVE_FTRUNCATE@ /* Change the size of the file to which FD is opened to become equal to LENGTH. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ extern int ftruncate (int fd, off_t length); # endif #elif defined GNULIB_POSIXCHECK # undef ftruncate # define ftruncate(f,l) \ (GL_LINK_WARNING ("ftruncate is unportable - " \ "use gnulib module ftruncate for portability"), \ ftruncate (f, l)) #endif #if @GNULIB_GETCWD@ /* Include the headers that might declare getcwd so that they will not cause confusion if included after this file. */ # include # if @REPLACE_GETCWD@ /* Get the name of the current working directory, and put it in SIZE bytes of BUF. Return BUF if successful, or NULL if the directory couldn't be determined or SIZE was too small. See the POSIX:2001 specification . Additionally, the gnulib module 'getcwd' guarantees the following GNU extension: If BUF is NULL, an array is allocated with 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ # define getcwd rpl_getcwd extern char * getcwd (char *buf, size_t size); # endif #elif defined GNULIB_POSIXCHECK # undef getcwd # define getcwd(b,s) \ (GL_LINK_WARNING ("getcwd is unportable - " \ "use gnulib module getcwd for portability"), \ getcwd (b, s)) #endif #if @GNULIB_GETDOMAINNAME@ /* Return the NIS domain name of the machine. WARNING! The NIS domain name is unrelated to the fully qualified host name of the machine. It is also unrelated to email addresses. WARNING! The NIS domain name is usually the empty string or "(none)" when not using NIS. Put up to LEN bytes of the NIS domain name into NAME. Null terminate it if the name is shorter than LEN. If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. Return 0 if successful, otherwise set errno and return -1. */ # if !@HAVE_GETDOMAINNAME@ extern int getdomainname(char *name, size_t len); # endif #elif defined GNULIB_POSIXCHECK # undef getdomainname # define getdomainname(n,l) \ (GL_LINK_WARNING ("getdomainname is unportable - " \ "use gnulib module getdomainname for portability"), \ getdomainname (n, l)) #endif #if @GNULIB_GETDTABLESIZE@ # if !@HAVE_GETDTABLESIZE@ /* Return the maximum number of file descriptors in the current process. */ extern int getdtablesize (void); # endif #elif defined GNULIB_POSIXCHECK # undef getdtablesize # define getdtablesize() \ (GL_LINK_WARNING ("getdtablesize is unportable - " \ "use gnulib module getdtablesize for portability"), \ getdtablesize ()) #endif #if @GNULIB_GETHOSTNAME@ /* Return the standard host name of the machine. WARNING! The host name may or may not be fully qualified. Put up to LEN bytes of the host name into NAME. Null terminate it if the name is shorter than LEN. If the host name is longer than LEN, set errno = EINVAL and return -1. Return 0 if successful, otherwise set errno and return -1. */ # if @UNISTD_H_HAVE_WINSOCK2_H@ # undef gethostname # define gethostname rpl_gethostname # endif # if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@ extern int gethostname(char *name, size_t len); # endif #elif @UNISTD_H_HAVE_WINSOCK2_H@ # undef gethostname # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname #elif defined GNULIB_POSIXCHECK # undef gethostname # define gethostname(n,l) \ (GL_LINK_WARNING ("gethostname is unportable - " \ "use gnulib module gethostname for portability"), \ gethostname (n, l)) #endif #if @GNULIB_GETLOGIN_R@ /* Copies the user's login name to NAME. The array pointed to by NAME has room for SIZE bytes. Returns 0 if successful. Upon error, an error number is returned, or -1 in the case that the login name cannot be found but no specific error is provided (this case is hopefully rare but is left open by the POSIX spec). See . */ # if !@HAVE_DECL_GETLOGIN_R@ # include extern int getlogin_r (char *name, size_t size); # endif #elif defined GNULIB_POSIXCHECK # undef getlogin_r # define getlogin_r(n,s) \ (GL_LINK_WARNING ("getlogin_r is unportable - " \ "use gnulib module getlogin_r for portability"), \ getlogin_r (n, s)) #endif #if @GNULIB_GETPAGESIZE@ # if @REPLACE_GETPAGESIZE@ # define getpagesize rpl_getpagesize extern int getpagesize (void); # elif !@HAVE_GETPAGESIZE@ /* This is for POSIX systems. */ # if !defined getpagesize && defined _SC_PAGESIZE # if ! (defined __VMS && __VMS_VER < 70000000) # define getpagesize() sysconf (_SC_PAGESIZE) # endif # endif /* This is for older VMS. */ # if !defined getpagesize && defined __VMS # ifdef __ALPHA # define getpagesize() 8192 # else # define getpagesize() 512 # endif # endif /* This is for BeOS. */ # if !defined getpagesize && @HAVE_OS_H@ # include # if defined B_PAGE_SIZE # define getpagesize() B_PAGE_SIZE # endif # endif /* This is for AmigaOS4.0. */ # if !defined getpagesize && defined __amigaos4__ # define getpagesize() 2048 # endif /* This is for older Unix systems. */ # if !defined getpagesize && @HAVE_SYS_PARAM_H@ # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else # ifdef NBPG # ifndef CLSIZE # define CLSIZE 1 # endif # define getpagesize() (NBPG * CLSIZE) # else # ifdef NBPC # define getpagesize() NBPC # endif # endif # endif # endif # endif #elif defined GNULIB_POSIXCHECK # undef getpagesize # define getpagesize() \ (GL_LINK_WARNING ("getpagesize is unportable - " \ "use gnulib module getpagesize for portability"), \ getpagesize ()) #endif #if @GNULIB_GETUSERSHELL@ # if !@HAVE_GETUSERSHELL@ /* Return the next valid login shell on the system, or NULL when the end of the list has been reached. */ extern char *getusershell (void); /* Rewind to pointer that is advanced at each getusershell() call. */ extern void setusershell (void); /* Free the pointer that is advanced at each getusershell() call and associated resources. */ extern void endusershell (void); # endif #elif defined GNULIB_POSIXCHECK # undef getusershell # define getusershell() \ (GL_LINK_WARNING ("getusershell is unportable - " \ "use gnulib module getusershell for portability"), \ getusershell ()) # undef setusershell # define setusershell() \ (GL_LINK_WARNING ("setusershell is unportable - " \ "use gnulib module getusershell for portability"), \ setusershell ()) # undef endusershell # define endusershell() \ (GL_LINK_WARNING ("endusershell is unportable - " \ "use gnulib module getusershell for portability"), \ endusershell ()) #endif #if @GNULIB_LCHOWN@ # if @REPLACE_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE to GID (if GID is not -1). Do not follow symbolic links. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ # define lchown rpl_lchown extern int lchown (char const *file, uid_t owner, gid_t group); # endif #elif defined GNULIB_POSIXCHECK # undef lchown # define lchown(f,u,g) \ (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \ "systems - use gnulib module lchown for portability"), \ lchown (f, u, g)) #endif #if @GNULIB_LSEEK@ # if @REPLACE_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. Return the new offset if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ # define lseek rpl_lseek extern off_t lseek (int fd, off_t offset, int whence); # endif #elif defined GNULIB_POSIXCHECK # undef lseek # define lseek(f,o,w) \ (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \ "systems - use gnulib module lseek for portability"), \ lseek (f, o, w)) #endif #if @GNULIB_READLINK@ /* Read the contents of the symbolic link FILE and place the first BUFSIZE bytes of it into BUF. Return the number of bytes placed into BUF if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ # if !@HAVE_READLINK@ # include extern int readlink (const char *file, char *buf, size_t bufsize); # endif #elif defined GNULIB_POSIXCHECK # undef readlink # define readlink(f,b,s) \ (GL_LINK_WARNING ("readlink is unportable - " \ "use gnulib module readlink for portability"), \ readlink (f, b, s)) #endif #if @GNULIB_SLEEP@ /* Pause the execution of the current thread for N seconds. Returns the number of seconds left to sleep. See the POSIX:2001 specification . */ # if !@HAVE_SLEEP@ extern unsigned int sleep (unsigned int n); # endif #elif defined GNULIB_POSIXCHECK # undef sleep # define sleep(n) \ (GL_LINK_WARNING ("sleep is unportable - " \ "use gnulib module sleep for portability"), \ sleep (n)) #endif #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ /* Write up to COUNT bytes starting at BUF to file descriptor FD. See the POSIX:2001 specification . */ # undef write # define write rpl_write extern ssize_t write (int fd, const void *buf, size_t count); #endif #ifdef FCHDIR_REPLACEMENT /* gnulib internal function. */ extern void _gl_unregister_fd (int fd); #endif #ifdef __cplusplus } #endif #endif /* _GL_UNISTD_H */ #endif /* _GL_UNISTD_H */ genparse-0.9.1/gnulib/lib/exitfail.c0000644000076600001440000000153011673365613014261 00000000000000/* Failure exit status Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include "exitfail.h" #include int volatile exit_failure = EXIT_FAILURE; genparse-0.9.1/gnulib/lib/error.c0000644000076600001440000001753511673365613013621 00000000000000/* Error handler for noninteractive utilities Copyright (C) 1990-1998, 2000-2007 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by David MacKenzie . */ #if !_LIBC # include #endif #include "error.h" #include #include #include #include #if !_LIBC && ENABLE_NLS # include "gettext.h" # define _(msgid) gettext (msgid) #endif #ifdef _LIBC # include # include # include # include # define mbsrtowcs __mbsrtowcs #endif #if USE_UNLOCKED_IO # include "unlocked-io.h" #endif #ifndef _ # define _(String) String #endif /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ unsigned int error_message_count; #ifdef _LIBC /* In the GNU C library, there is a predefined variable for this. */ # define program_name program_invocation_name # include # include # include /* In GNU libc we want do not want to use the common name `error' directly. Instead make it a weak alias. */ extern void __error (int status, int errnum, const char *message, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void __error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) __attribute__ ((__format__ (__printf__, 5, 6)));; # define error __error # define error_at_line __error_at_line # include # define fflush(s) INTUSE(_IO_fflush) (s) # undef putc # define putc(c, fp) INTUSE(_IO_putc) (c, fp) # include #else /* not _LIBC */ # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P # ifndef HAVE_DECL_STRERROR_R "this configure-time declaration test was not run" # endif char *strerror_r (); # endif /* The calling program should define program_name and set it to the name of the executing program. */ extern char *program_name; # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r # endif /* HAVE_STRERROR_R || defined strerror_r */ #endif /* not _LIBC */ static void print_errno_message (int errnum) { char const *s; #if defined HAVE_STRERROR_R || _LIBC char errbuf[1024]; # if STRERROR_R_CHAR_P || _LIBC s = __strerror_r (errnum, errbuf, sizeof errbuf); # else if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) s = errbuf; else s = 0; # endif #else s = strerror (errnum); #endif #if !_LIBC if (! s) s = _("Unknown system error"); #endif #if _LIBC __fxprintf (NULL, ": %s", s); #else fprintf (stderr, ": %s", s); #endif } static void error_tail (int status, int errnum, const char *message, va_list args) { #if _LIBC if (_IO_fwide (stderr, 0) > 0) { # define ALLOCA_LIMIT 2000 size_t len = strlen (message) + 1; wchar_t *wmessage = NULL; mbstate_t st; size_t res; const char *tmp; bool use_malloc = false; while (1) { if (__libc_use_alloca (len * sizeof (wchar_t))) wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); else { if (!use_malloc) wmessage = NULL; wchar_t *p = (wchar_t *) realloc (wmessage, len * sizeof (wchar_t)); if (p == NULL) { free (wmessage); fputws_unlocked (L"out of memory\n", stderr); return; } wmessage = p; use_malloc = true; } memset (&st, '\0', sizeof (st)); tmp = message; res = mbsrtowcs (wmessage, &tmp, len, &st); if (res != len) break; if (__builtin_expect (len >= SIZE_MAX / 2, 0)) { /* This really should not happen if everything is fine. */ res = (size_t) -1; break; } len *= 2; } if (res == (size_t) -1) { /* The string cannot be converted. */ if (use_malloc) { free (wmessage); use_malloc = false; } wmessage = (wchar_t *) L"???"; } __vfwprintf (stderr, wmessage, args); if (use_malloc) free (wmessage); } else #endif vfprintf (stderr, message, args); va_end (args); ++error_message_count; if (errnum) print_errno_message (errnum); #if _LIBC __fxprintf (NULL, "\n"); #else putc ('\n', stderr); #endif fflush (stderr); if (status) exit (status); } /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args. If ERRNUM is nonzero, print its corresponding system error message. Exit with status STATUS if it is nonzero. */ void error (int status, int errnum, const char *message, ...) { va_list args; #if defined _LIBC && defined __libc_ptf_call /* We do not want this call to be cut short by a thread cancellation. Therefore disable cancellation for now. */ int state = PTHREAD_CANCEL_ENABLE; __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), 0); #endif fflush (stdout); #ifdef _LIBC _IO_flockfile (stderr); #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC __fxprintf (NULL, "%s: ", program_name); #else fprintf (stderr, "%s: ", program_name); #endif } va_start (args, message); error_tail (status, errnum, message, args); #ifdef _LIBC _IO_funlockfile (stderr); # ifdef __libc_ptf_call __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ int error_one_per_line; void error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) { va_list args; if (error_one_per_line) { static const char *old_file_name; static unsigned int old_line_number; if (old_line_number == line_number && (file_name == old_file_name || strcmp (old_file_name, file_name) == 0)) /* Simply return and print nothing. */ return; old_file_name = file_name; old_line_number = line_number; } #if defined _LIBC && defined __libc_ptf_call /* We do not want this call to be cut short by a thread cancellation. Therefore disable cancellation for now. */ int state = PTHREAD_CANCEL_ENABLE; __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), 0); #endif fflush (stdout); #ifdef _LIBC _IO_flockfile (stderr); #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC __fxprintf (NULL, "%s:", program_name); #else fprintf (stderr, "%s:", program_name); #endif } #if _LIBC __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ", file_name, line_number); #else fprintf (stderr, file_name != NULL ? "%s:%d: " : " ", file_name, line_number); #endif va_start (args, message); error_tail (status, errnum, message, args); #ifdef _LIBC _IO_funlockfile (stderr); # ifdef __libc_ptf_call __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } #ifdef _LIBC /* Make the weak alias. */ # undef error # undef error_at_line weak_alias (__error, error) weak_alias (__error_at_line, error_at_line) #endif genparse-0.9.1/gnulib/lib/stdint.in.h0000644000076600001440000003535411673365613014406 00000000000000/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * ISO C 99 for platforms that lack it. * */ #ifndef _GL_STDINT_H /* When including a system file that in turn includes , use the system , not our substitute. This avoids problems with (for example) VMS, whose includes . */ #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Get those types that are already defined in other system include files, so that we can "#define int8_t signed char" below without worrying about a later system include file containing a "typedef signed char int8_t;" that will get messed up by our macro. Our macros should all be consistent with the system versions, except for the "fast" types and macros, which we recommend against using in public interfaces due to compiler differences. */ #if @HAVE_STDINT_H@ # if defined __sgi && ! defined __c99 /* Bypass IRIX's if in C89 mode, since it merely annoys users with "This header file is to be used only for c99 mode compilations" diagnostics. */ # define __STDINT_H__ # endif /* Other systems may have an incomplete or buggy . Include it before , since any "#include " in would reinclude us, skipping our contents because _GL_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ # if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ # endif # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif #if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H #define _GL_STDINT_H /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. MacOS X 10.4.6 includes (which is us), but relies on the system definitions, so include after @NEXT_STDINT_H@. */ #if @HAVE_SYS_TYPES_H@ && ! defined _AIX # include #endif /* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ #include #if @HAVE_INTTYPES_H@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ # include #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ # include #endif #if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ /* Linux libc4 >= 4.6.7 and libc5 have a that defines int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is included by . */ # include #endif #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS /* Get WCHAR_MIN, WCHAR_MAX. */ # if ! (defined WCHAR_MIN && defined WCHAR_MAX) # include # endif #endif #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for a integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ #define _STDINT_MIN(signed, bits, zero) \ ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) #define _STDINT_MAX(signed, bits, zero) \ ((signed) \ ? ~ _STDINT_MIN (signed, bits, zero) \ : /* The expression for the unsigned case. The subtraction of (signed) \ is a nop in the unsigned case and avoids "signed integer overflow" \ warnings in the signed case. */ \ ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) /* 7.18.1.1. Exact-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ #undef int8_t #undef uint8_t #define int8_t signed char #define uint8_t unsigned char #undef int16_t #undef uint16_t #define int16_t short int #define uint16_t unsigned short int #undef int32_t #undef uint32_t #define int32_t int #define uint32_t unsigned int /* Do not undefine int64_t if gnulib is not being used with 64-bit types, since otherwise it breaks platforms like Tandem/NSK. */ #if LONG_MAX >> 31 >> 31 == 1 # undef int64_t # define int64_t long int # define GL_INT64_T #elif defined _MSC_VER # undef int64_t # define int64_t __int64 # define GL_INT64_T #elif @HAVE_LONG_LONG_INT@ # undef int64_t # define int64_t long long int # define GL_INT64_T #endif #if ULONG_MAX >> 31 >> 31 >> 1 == 1 # undef uint64_t # define uint64_t unsigned long int # define GL_UINT64_T #elif defined _MSC_VER # undef uint64_t # define uint64_t unsigned __int64 # define GL_UINT64_T #elif @HAVE_UNSIGNED_LONG_LONG_INT@ # undef uint64_t # define uint64_t unsigned long long int # define GL_UINT64_T #endif /* Avoid collision with Solaris 2.5.1 etc. */ #define _UINT8_T #define _UINT32_T #define _UINT64_T /* 7.18.1.2. Minimum-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ #undef int_least8_t #undef uint_least8_t #undef int_least16_t #undef uint_least16_t #undef int_least32_t #undef uint_least32_t #undef int_least64_t #undef uint_least64_t #define int_least8_t int8_t #define uint_least8_t uint8_t #define int_least16_t int16_t #define uint_least16_t uint16_t #define int_least32_t int32_t #define uint_least32_t uint32_t #ifdef GL_INT64_T # define int_least64_t int64_t #endif #ifdef GL_UINT64_T # define uint_least64_t uint64_t #endif /* 7.18.1.3. Fastest minimum-width integer types */ /* Note: Other substitutes may define these types differently. It is not recommended to use these types in public header files. */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. Assume that 'long int' is fast enough for all narrower integers. */ #undef int_fast8_t #undef uint_fast8_t #undef int_fast16_t #undef uint_fast16_t #undef int_fast32_t #undef uint_fast32_t #undef int_fast64_t #undef uint_fast64_t #define int_fast8_t long int #define uint_fast8_t unsigned int_fast8_t #define int_fast16_t long int #define uint_fast16_t unsigned int_fast16_t #define int_fast32_t long int #define uint_fast32_t unsigned int_fast32_t #ifdef GL_INT64_T # define int_fast64_t int64_t #endif #ifdef GL_UINT64_T # define uint_fast64_t uint64_t #endif /* 7.18.1.4. Integer types capable of holding object pointers */ #undef intptr_t #undef uintptr_t #define intptr_t long int #define uintptr_t unsigned long int /* 7.18.1.5. Greatest-width integer types */ /* Note: These types are compiler dependent. It may be unwise to use them in public header files. */ #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define intmax_t long long int #elif defined GL_INT64_T # define intmax_t int64_t #else # define intmax_t long int #endif #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define uintmax_t unsigned long long int #elif defined GL_UINT64_T # define uintmax_t uint64_t #else # define uintmax_t unsigned long int #endif /* Verify that intmax_t and uintmax_t have the same size. Too much code breaks if this is not the case. If this check fails, the reason is likely to be found in the autoconf macros. */ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1]; /* 7.18.2. Limits of specified-width integer types */ #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS /* 7.18.2.1. Limits of exact-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ #undef INT8_MIN #undef INT8_MAX #undef UINT8_MAX #define INT8_MIN (~ INT8_MAX) #define INT8_MAX 127 #define UINT8_MAX 255 #undef INT16_MIN #undef INT16_MAX #undef UINT16_MAX #define INT16_MIN (~ INT16_MAX) #define INT16_MAX 32767 #define UINT16_MAX 65535 #undef INT32_MIN #undef INT32_MAX #undef UINT32_MAX #define INT32_MIN (~ INT32_MAX) #define INT32_MAX 2147483647 #define UINT32_MAX 4294967295U #undef INT64_MIN #undef INT64_MAX #ifdef GL_INT64_T /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 evaluates the latter incorrectly in preprocessor expressions. */ # define INT64_MIN (- INTMAX_C (1) << 63) # define INT64_MAX INTMAX_C (9223372036854775807) #endif #undef UINT64_MAX #ifdef GL_UINT64_T # define UINT64_MAX UINTMAX_C (18446744073709551615) #endif /* 7.18.2.2. Limits of minimum-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ #undef INT_LEAST8_MIN #undef INT_LEAST8_MAX #undef UINT_LEAST8_MAX #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define UINT_LEAST8_MAX UINT8_MAX #undef INT_LEAST16_MIN #undef INT_LEAST16_MAX #undef UINT_LEAST16_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define UINT_LEAST16_MAX UINT16_MAX #undef INT_LEAST32_MIN #undef INT_LEAST32_MAX #undef UINT_LEAST32_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define UINT_LEAST32_MAX UINT32_MAX #undef INT_LEAST64_MIN #undef INT_LEAST64_MAX #ifdef GL_INT64_T # define INT_LEAST64_MIN INT64_MIN # define INT_LEAST64_MAX INT64_MAX #endif #undef UINT_LEAST64_MAX #ifdef GL_UINT64_T # define UINT_LEAST64_MAX UINT64_MAX #endif /* 7.18.2.3. Limits of fastest minimum-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. */ #undef INT_FAST8_MIN #undef INT_FAST8_MAX #undef UINT_FAST8_MAX #define INT_FAST8_MIN LONG_MIN #define INT_FAST8_MAX LONG_MAX #define UINT_FAST8_MAX ULONG_MAX #undef INT_FAST16_MIN #undef INT_FAST16_MAX #undef UINT_FAST16_MAX #define INT_FAST16_MIN LONG_MIN #define INT_FAST16_MAX LONG_MAX #define UINT_FAST16_MAX ULONG_MAX #undef INT_FAST32_MIN #undef INT_FAST32_MAX #undef UINT_FAST32_MAX #define INT_FAST32_MIN LONG_MIN #define INT_FAST32_MAX LONG_MAX #define UINT_FAST32_MAX ULONG_MAX #undef INT_FAST64_MIN #undef INT_FAST64_MAX #ifdef GL_INT64_T # define INT_FAST64_MIN INT64_MIN # define INT_FAST64_MAX INT64_MAX #endif #undef UINT_FAST64_MAX #ifdef GL_UINT64_T # define UINT_FAST64_MAX UINT64_MAX #endif /* 7.18.2.4. Limits of integer types capable of holding object pointers */ #undef INTPTR_MIN #undef INTPTR_MAX #undef UINTPTR_MAX #define INTPTR_MIN LONG_MIN #define INTPTR_MAX LONG_MAX #define UINTPTR_MAX ULONG_MAX /* 7.18.2.5. Limits of greatest-width integer types */ #undef INTMAX_MIN #undef INTMAX_MAX #ifdef INT64_MAX # define INTMAX_MIN INT64_MIN # define INTMAX_MAX INT64_MAX #else # define INTMAX_MIN INT32_MIN # define INTMAX_MAX INT32_MAX #endif #undef UINTMAX_MAX #ifdef UINT64_MAX # define UINTMAX_MAX UINT64_MAX #else # define UINTMAX_MAX UINT32_MAX #endif /* 7.18.3. Limits of other integer types */ /* ptrdiff_t limits */ #undef PTRDIFF_MIN #undef PTRDIFF_MAX #define PTRDIFF_MIN \ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) #define PTRDIFF_MAX \ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) /* sig_atomic_t limits */ #undef SIG_ATOMIC_MIN #undef SIG_ATOMIC_MAX #define SIG_ATOMIC_MIN \ _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) #define SIG_ATOMIC_MAX \ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) /* size_t limit */ #undef SIZE_MAX #define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) /* wchar_t limits */ #undef WCHAR_MIN #undef WCHAR_MAX #define WCHAR_MIN \ _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) #define WCHAR_MAX \ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) /* wint_t limits */ #undef WINT_MIN #undef WINT_MAX #define WINT_MIN \ _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) #define WINT_MAX \ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) #endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ /* 7.18.4. Macros for integer constants */ #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS /* 7.18.4.1. Macros for minimum-width integer constants */ /* According to ISO C 99 Technical Corrigendum 1 */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ #undef INT8_C #undef UINT8_C #define INT8_C(x) x #define UINT8_C(x) x #undef INT16_C #undef UINT16_C #define INT16_C(x) x #define UINT16_C(x) x #undef INT32_C #undef UINT32_C #define INT32_C(x) x #define UINT32_C(x) x ## U #undef INT64_C #undef UINT64_C #if LONG_MAX >> 31 >> 31 == 1 # define INT64_C(x) x##L #elif defined _MSC_VER # define INT64_C(x) x##i64 #elif @HAVE_LONG_LONG_INT@ # define INT64_C(x) x##LL #endif #if ULONG_MAX >> 31 >> 31 >> 1 == 1 # define UINT64_C(x) x##UL #elif defined _MSC_VER # define UINT64_C(x) x##ui64 #elif @HAVE_UNSIGNED_LONG_LONG_INT@ # define UINT64_C(x) x##ULL #endif /* 7.18.4.2. Macros for greatest-width integer constants */ #undef INTMAX_C #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL #elif defined GL_INT64_T # define INTMAX_C(x) INT64_C(x) #else # define INTMAX_C(x) x##L #endif #undef UINTMAX_C #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define UINTMAX_C(x) x##ULL #elif defined GL_UINT64_T # define UINTMAX_C(x) UINT64_C(x) #else # define UINTMAX_C(x) x##UL #endif #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ #endif /* _GL_STDINT_H */ #endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ genparse-0.9.1/gnulib/lib/c-strtod.h0000644000076600001440000000013011673365613014213 00000000000000double c_strtod (char const *, char **); long double c_strtold (char const *, char **); genparse-0.9.1/gnulib/lib/getopt1.c0000644000076600001440000000753211673365613014047 00000000000000/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef _LIBC # include #else # include # include "getopt.h" #endif #include "getopt_int.h" #include /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, (char **) argv, options, long_options, opt_index, 0, 0); } int _getopt_long_r (int argc, char **argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 0, 0, d); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *__getopt_argv_const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, (char **) argv, options, long_options, opt_index, 1, 0); } int _getopt_long_only_r (int argc, char **argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, 0, d); } #ifdef TEST #include int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ genparse-0.9.1/gnulib/lib/xstrtoumax.c0000644000076600001440000000025210701224326014674 00000000000000#define __strtol strtoumax #define __strtol_t uintmax_t #define __xstrtol xstrtoumax #define STRTOL_T_MINIMUM 0 #define STRTOL_T_MAXIMUM UINTMAX_MAX #include "xstrtol.c" genparse-0.9.1/gnulib/lib/xstrtol.h0000644000076600001440000000477511673365613014216 00000000000000/* A more useful interface to strtol. Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef XSTRTOL_H_ # define XSTRTOL_H_ 1 # include # include # ifndef _STRTOL_ERROR enum strtol_error { LONGINT_OK = 0, /* These two values can be ORed together, to indicate that both errors occurred. */ LONGINT_OVERFLOW = 1, LONGINT_INVALID_SUFFIX_CHAR = 2, LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW = (LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW), LONGINT_INVALID = 4 }; typedef enum strtol_error strtol_error; # endif # define _DECLARE_XSTRTOL(name, type) \ strtol_error name (const char *, char **, int, type *, const char *); _DECLARE_XSTRTOL (xstrtol, long int) _DECLARE_XSTRTOL (xstrtoul, unsigned long int) _DECLARE_XSTRTOL (xstrtoimax, intmax_t) _DECLARE_XSTRTOL (xstrtoumax, uintmax_t) #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) # endif #endif #ifndef ATTRIBUTE_NORETURN # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) #endif /* Report an error for an invalid integer in an option argument. ERR is the error code returned by one of the xstrto* functions. Use OPT_IDX to decide whether to print the short option string "C" or "-C" or a long option string derived from LONG_OPTION. OPT_IDX is -2 if the short option "C" was used, without any leading "-"; it is -1 if the short option "-C" was used; otherwise it is an index into LONG_OPTIONS, which should have a name preceded by two '-' characters. ARG is the option-argument containing the integer. After reporting an error, exit with a failure status. */ void xstrtol_fatal (enum strtol_error, int, char, struct option const *, char const *) ATTRIBUTE_NORETURN; #endif /* not XSTRTOL_H_ */ genparse-0.9.1/gnulib/lib/intprops.h0000644000076600001440000000605011673365613014341 00000000000000/* intprops.h -- properties of integer types Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Paul Eggert. */ #include /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if the arithmetic type T is an integer type. bool counts as an integer. */ #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ #define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) #define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) #define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) /* True if the arithmetic type T is signed. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The maximum and minimum values for the integer type T. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ #define TYPE_MINIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) #define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) /* Return zero if T can be determined to be an unsigned type. Otherwise, return 1. When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a tighter bound. Otherwise, it overestimates the true bound by one byte when applied to unsigned types of size 2, 4, 16, ... bytes. The symbol signed_type_or_expr__ is private to this header file. */ #if __GNUC__ >= 2 # define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t)) #else # define signed_type_or_expr__(t) 1 #endif /* Bound on length of the string representing an integer type or expression T. Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485; add 1 for integer division truncation; add 1 more for a minus sign if needed. */ #define INT_STRLEN_BOUND(t) \ ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \ + signed_type_or_expr__ (t) + 1) /* Bound on buffer size needed to represent an integer type or expression T, including the terminating null. */ #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) genparse-0.9.1/gnulib/lib/strtoul.c0000644000076600001440000000142611673365613014174 00000000000000/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #define UNSIGNED 1 #include "strtol.c" genparse-0.9.1/gnulib/lib/xstrtol.c0000644000076600001440000001217211673365613014177 00000000000000/* A more useful interface to strtol. Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Jim Meyering. */ #ifndef __strtol # define __strtol strtol # define __strtol_t long int # define __xstrtol xstrtol # define STRTOL_T_MINIMUM LONG_MIN # define STRTOL_T_MAXIMUM LONG_MAX #endif #include #include "xstrtol.h" /* Some pre-ANSI implementations (e.g. SunOS 4) need stderr defined if assertion checking is enabled. */ #include #include #include #include #include #include #include #include "intprops.h" static strtol_error bkm_scale (__strtol_t *x, int scale_factor) { if (TYPE_SIGNED (__strtol_t) && *x < STRTOL_T_MINIMUM / scale_factor) { *x = STRTOL_T_MINIMUM; return LONGINT_OVERFLOW; } if (STRTOL_T_MAXIMUM / scale_factor < *x) { *x = STRTOL_T_MAXIMUM; return LONGINT_OVERFLOW; } *x *= scale_factor; return LONGINT_OK; } static strtol_error bkm_scale_by_power (__strtol_t *x, int base, int power) { strtol_error err = LONGINT_OK; while (power--) err |= bkm_scale (x, base); return err; } /* FIXME: comment. */ strtol_error __xstrtol (const char *s, char **ptr, int strtol_base, __strtol_t *val, const char *valid_suffixes) { char *t_ptr; char **p; __strtol_t tmp; strtol_error err = LONGINT_OK; assert (0 <= strtol_base && strtol_base <= 36); p = (ptr ? ptr : &t_ptr); if (! TYPE_SIGNED (__strtol_t)) { const char *q = s; unsigned char ch = *q; while (isspace (ch)) ch = *++q; if (ch == '-') return LONGINT_INVALID; } errno = 0; tmp = __strtol (s, p, strtol_base); if (*p == s) { /* If there is no number but there is a valid suffix, assume the number is 1. The string is invalid otherwise. */ if (valid_suffixes && **p && strchr (valid_suffixes, **p)) tmp = 1; else return LONGINT_INVALID; } else if (errno != 0) { if (errno != ERANGE) return LONGINT_INVALID; err = LONGINT_OVERFLOW; } /* Let valid_suffixes == NULL mean `allow any suffix'. */ /* FIXME: update all callers except the ones that allow suffixes after the number, changing last parameter NULL to `""'. */ if (!valid_suffixes) { *val = tmp; return err; } if (**p != '\0') { int base = 1024; int suffixes = 1; strtol_error overflow; if (!strchr (valid_suffixes, **p)) { *val = tmp; return err | LONGINT_INVALID_SUFFIX_CHAR; } if (strchr (valid_suffixes, '0')) { /* The ``valid suffix'' '0' is a special flag meaning that an optional second suffix is allowed, which can change the base. A suffix "B" (e.g. "100MB") stands for a power of 1000, whereas a suffix "iB" (e.g. "100MiB") stands for a power of 1024. If no suffix (e.g. "100M"), assume power-of-1024. */ switch (p[0][1]) { case 'i': if (p[0][2] == 'B') suffixes += 2; break; case 'B': case 'D': /* 'D' is obsolescent */ base = 1000; suffixes++; break; } } switch (**p) { case 'b': overflow = bkm_scale (&tmp, 512); break; case 'B': overflow = bkm_scale (&tmp, 1024); break; case 'c': overflow = 0; break; case 'E': /* exa or exbi */ overflow = bkm_scale_by_power (&tmp, base, 6); break; case 'G': /* giga or gibi */ case 'g': /* 'g' is undocumented; for compatibility only */ overflow = bkm_scale_by_power (&tmp, base, 3); break; case 'k': /* kilo */ case 'K': /* kibi */ overflow = bkm_scale_by_power (&tmp, base, 1); break; case 'M': /* mega or mebi */ case 'm': /* 'm' is undocumented; for compatibility only */ overflow = bkm_scale_by_power (&tmp, base, 2); break; case 'P': /* peta or pebi */ overflow = bkm_scale_by_power (&tmp, base, 5); break; case 'T': /* tera or tebi */ case 't': /* 't' is undocumented; for compatibility only */ overflow = bkm_scale_by_power (&tmp, base, 4); break; case 'w': overflow = bkm_scale (&tmp, 2); break; case 'Y': /* yotta or 2**80 */ overflow = bkm_scale_by_power (&tmp, base, 8); break; case 'Z': /* zetta or 2**70 */ overflow = bkm_scale_by_power (&tmp, base, 7); break; default: *val = tmp; return err | LONGINT_INVALID_SUFFIX_CHAR; } err |= overflow; *p += suffixes; if (**p) err |= LONGINT_INVALID_SUFFIX_CHAR; } *val = tmp; return err; } genparse-0.9.1/gnulib/lib/c-strtod.c0000644000076600001440000000337111673365613014220 00000000000000/* Convert string to double, using the C locale. Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Paul Eggert. */ #include #include "c-strtod.h" #include #include #include "xalloc.h" #if LONG # define C_STRTOD c_strtold # define DOUBLE long double # define STRTOD_L strtold_l #else # define C_STRTOD c_strtod # define DOUBLE double # define STRTOD_L strtod_l #endif /* c_strtold falls back on strtod if strtold doesn't conform to C99. */ #if LONG && HAVE_C99_STRTOLD # define STRTOD strtold #else # define STRTOD strtod #endif DOUBLE C_STRTOD (char const *nptr, char **endptr) { DOUBLE r; #ifdef LC_ALL_MASK locale_t c_locale = newlocale (LC_ALL_MASK, "C", 0); r = STRTOD_L (nptr, endptr, c_locale); freelocale (c_locale); #else char *saved_locale = setlocale (LC_NUMERIC, NULL); if (saved_locale) { saved_locale = xstrdup (saved_locale); setlocale (LC_NUMERIC, "C"); } r = STRTOD (nptr, endptr); if (saved_locale) { setlocale (LC_NUMERIC, saved_locale); free (saved_locale); } #endif return r; } genparse-0.9.1/gnulib/lib/exitfail.h0000644000076600001440000000136711673365613014276 00000000000000/* Failure exit status Copyright (C) 2002 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ extern int volatile exit_failure; genparse-0.9.1/gnulib/lib/errno.in.h0000644000076600001440000001066511667215657014231 00000000000000/* A POSIX-like . Copyright (C) 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_ERRNO_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_ERRNO_H@ #ifndef _GL_ERRNO_H #define _GL_ERRNO_H /* On native Windows platforms, many macros are not defined. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */ # define EWOULDBLOCK EAGAIN /* Values >= 100 seem safe to use. */ # define ETXTBSY 100 # define GNULIB_defined_ETXTBSY 1 /* These are intentionally the same values as the WSA* error numbers, defined in . */ # define EINPROGRESS 10036 # define EALREADY 10037 # define ENOTSOCK 10038 # define EDESTADDRREQ 10039 # define EMSGSIZE 10040 # define EPROTOTYPE 10041 # define ENOPROTOOPT 10042 # define EPROTONOSUPPORT 10043 # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ # define EOPNOTSUPP 10045 # define EPFNOSUPPORT 10046 /* not required by POSIX */ # define EAFNOSUPPORT 10047 # define EADDRINUSE 10048 # define EADDRNOTAVAIL 10049 # define ENETDOWN 10050 # define ENETUNREACH 10051 # define ENETRESET 10052 # define ECONNABORTED 10053 # define ECONNRESET 10054 # define ENOBUFS 10055 # define EISCONN 10056 # define ENOTCONN 10057 # define ESHUTDOWN 10058 /* not required by POSIX */ # define ETOOMANYREFS 10059 /* not required by POSIX */ # define ETIMEDOUT 10060 # define ECONNREFUSED 10061 # define ELOOP 10062 # define EHOSTDOWN 10064 /* not required by POSIX */ # define EHOSTUNREACH 10065 # define EPROCLIM 10067 /* not required by POSIX */ # define EUSERS 10068 /* not required by POSIX */ # define EDQUOT 10069 # define ESTALE 10070 # define EREMOTE 10071 /* not required by POSIX */ # define GNULIB_defined_ESOCK 1 # endif /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */ # if @EMULTIHOP_HIDDEN@ # define EMULTIHOP @EMULTIHOP_VALUE@ # define GNULIB_defined_EMULTIHOP 1 # endif # if @ENOLINK_HIDDEN@ # define ENOLINK @ENOLINK_VALUE@ # define GNULIB_defined_ENOLINK 1 # endif # if @EOVERFLOW_HIDDEN@ # define EOVERFLOW @EOVERFLOW_VALUE@ # define GNULIB_defined_EOVERFLOW 1 # endif /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK, EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined. Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151, HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133. Note: When one of these systems defines some of these macros some day, binaries will have to be recompiled so that they recognizes the new errno values from the system. */ # ifndef ENOMSG # define ENOMSG 2000 # define GNULIB_defined_ENOMSG 1 # endif # ifndef EIDRM # define EIDRM 2001 # define GNULIB_defined_EIDRM 1 # endif # ifndef ENOLINK # define ENOLINK 2002 # define GNULIB_defined_ENOLINK 1 # endif # ifndef EPROTO # define EPROTO 2003 # define GNULIB_defined_EPROTO 1 # endif # ifndef EMULTIHOP # define EMULTIHOP 2004 # define GNULIB_defined_EMULTIHOP 1 # endif # ifndef EBADMSG # define EBADMSG 2005 # define GNULIB_defined_EBADMSG 1 # endif # ifndef EOVERFLOW # define EOVERFLOW 2006 # define GNULIB_defined_EOVERFLOW 1 # endif # ifndef ENOTSUP # define ENOTSUP 2007 # define GNULIB_defined_ENOTSUP 1 # endif # ifndef ECANCELED # define ECANCELED 2008 # define GNULIB_defined_ECANCELED 1 # endif #endif /* _GL_ERRNO_H */ #endif /* _GL_ERRNO_H */ genparse-0.9.1/gnulib/lib/xstrtoimax.c0000644000076600001440000000026110701224326014660 00000000000000#define __strtol strtoimax #define __strtol_t intmax_t #define __xstrtol xstrtoimax #define STRTOL_T_MINIMUM INTMAX_MIN #define STRTOL_T_MAXIMUM INTMAX_MAX #include "xstrtol.c" genparse-0.9.1/gnulib/lib/strtol.c0000644000076600001440000002530411673365613014010 00000000000000/* Convert string representation of a number into an integer value. Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifdef _LIBC # define USE_NUMBER_GROUPING #else # include #endif #include #include #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif #include #include #include #include #ifdef USE_NUMBER_GROUPING # include "../locale/localeinfo.h" #endif /* Nonzero if we are defining `strtoul' or `strtoull', operating on unsigned integers. */ #ifndef UNSIGNED # define UNSIGNED 0 # define INT LONG int #else # define INT unsigned LONG int #endif /* Determine the name. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL # if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol __wcstoull_l # else # define strtol __wcstoul_l # endif # else # ifdef QUAD # define strtol __strtoull_l # else # define strtol __strtoul_l # endif # endif # else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol __wcstoll_l # else # define strtol __wcstol_l # endif # else # ifdef QUAD # define strtol __strtoll_l # else # define strtol __strtol_l # endif # endif # endif #else # if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoull # else # define strtol wcstoul # endif # else # ifdef QUAD # define strtol strtoull # else # define strtol strtoul # endif # endif # else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoll # else # define strtol wcstol # endif # else # ifdef QUAD # define strtol strtoll # endif # endif # endif #endif /* If QUAD is defined, we are defining `strtoll' or `strtoull', operating on `long long int's. */ #ifdef QUAD # define LONG long long # define STRTOL_LONG_MIN LONG_LONG_MIN # define STRTOL_LONG_MAX LONG_LONG_MAX # define STRTOL_ULONG_MAX ULONG_LONG_MAX /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ # define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) # define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) # define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) /* True if the arithmetic type T is signed. */ # define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The maximum and minimum values for the integer type T. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ # define TYPE_MINIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) # define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) # ifndef ULONG_LONG_MAX # define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long) # endif # ifndef LONG_LONG_MAX # define LONG_LONG_MAX TYPE_MAXIMUM (long long int) # endif # ifndef LONG_LONG_MIN # define LONG_LONG_MIN TYPE_MINIMUM (long long int) # endif # if __GNUC__ == 2 && __GNUC_MINOR__ < 7 /* Work around gcc bug with using this constant. */ static const unsigned long long int maxquad = ULONG_LONG_MAX; # undef STRTOL_ULONG_MAX # define STRTOL_ULONG_MAX maxquad # endif #else # define LONG long # define STRTOL_LONG_MIN LONG_MIN # define STRTOL_LONG_MAX LONG_MAX # define STRTOL_ULONG_MAX ULONG_MAX #endif /* We use this code also for the extended locale handling where the function gets as an additional argument the locale which has to be used. To access the values we have to redefine the _NL_CURRENT macro. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) # define LOCALE_PARAM , loc # define LOCALE_PARAM_PROTO , __locale_t loc #else # define LOCALE_PARAM # define LOCALE_PARAM_PROTO #endif #include #ifdef USE_WIDE_CHAR # include # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t # define STRING_TYPE wchar_t # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define ISSPACE(Ch) __iswspace_l ((Ch), loc) # define ISALPHA(Ch) __iswalpha_l ((Ch), loc) # define TOUPPER(Ch) __towupper_l ((Ch), loc) # else # define ISSPACE(Ch) iswspace (Ch) # define ISALPHA(Ch) iswalpha (Ch) # define TOUPPER(Ch) towupper (Ch) # endif #else # define L_(Ch) Ch # define UCHAR_TYPE unsigned char # define STRING_TYPE char # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define ISSPACE(Ch) __isspace_l ((Ch), loc) # define ISALPHA(Ch) __isalpha_l ((Ch), loc) # define TOUPPER(Ch) __toupper_l ((Ch), loc) # else # define ISSPACE(Ch) isspace (Ch) # define ISALPHA(Ch) isalpha (Ch) # define TOUPPER(Ch) toupper (Ch) # endif #endif #define INTERNAL(X) INTERNAL1(X) #define INTERNAL1(X) __##X##_internal #define WEAKNAME(X) WEAKNAME1(X) #ifdef USE_NUMBER_GROUPING /* This file defines a function to check for correct grouping. */ # include "grouping.h" #endif /* Convert NPTR to an `unsigned long int' or `long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. If ENDPTR is not NULL, a pointer to the character after the last one converted is stored in *ENDPTR. */ INT INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr, int base, int group LOCALE_PARAM_PROTO) { int negative; register unsigned LONG int cutoff; register unsigned int cutlim; register unsigned LONG int i; register const STRING_TYPE *s; register UCHAR_TYPE c; const STRING_TYPE *save, *end; int overflow; #ifdef USE_NUMBER_GROUPING # ifdef USE_IN_EXTENDED_LOCALE_MODEL struct locale_data *current = loc->__locales[LC_NUMERIC]; # endif /* The thousands character of the current locale. */ wchar_t thousands = L'\0'; /* The numeric grouping specification of the current locale, in the format described in . */ const char *grouping; if (group) { grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); if (*grouping <= 0 || *grouping == CHAR_MAX) grouping = NULL; else { /* Figure out the thousands separator character. */ # if defined _LIBC || defined _HAVE_BTOWC thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); if (thousands == WEOF) thousands = L'\0'; # endif if (thousands == L'\0') grouping = NULL; } } else grouping = NULL; #endif if (base < 0 || base == 1 || base > 36) { __set_errno (EINVAL); return 0; } save = s = nptr; /* Skip white space. */ while (ISSPACE (*s)) ++s; if (*s == L_('\0')) goto noconv; /* Check for a sign. */ if (*s == L_('-')) { negative = 1; ++s; } else if (*s == L_('+')) { negative = 0; ++s; } else negative = 0; /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ if (*s == L_('0')) { if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X')) { s += 2; base = 16; } else if (base == 0) base = 8; } else if (base == 0) base = 10; /* Save the pointer so we can check later if anything happened. */ save = s; #ifdef USE_NUMBER_GROUPING if (group) { /* Find the end of the digit string and check its grouping. */ end = s; for (c = *end; c != L_('\0'); c = *++end) if ((wchar_t) c != thousands && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) break; if (*s == thousands) end = s; else end = correctly_grouped_prefix (s, end, thousands, grouping); } else #endif end = NULL; cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; overflow = 0; i = 0; for (c = *s; c != L_('\0'); c = *++s) { if (s == end) break; if (c >= L_('0') && c <= L_('9')) c -= L_('0'); else if (ISALPHA (c)) c = TOUPPER (c) - L_('A') + 10; else break; if ((int) c >= base) break; /* Check for overflow. */ if (i > cutoff || (i == cutoff && c > cutlim)) overflow = 1; else { i *= (unsigned LONG int) base; i += c; } } /* Check if anything actually happened. */ if (s == save) goto noconv; /* Store in ENDPTR the address of one character past the last character we converted. */ if (endptr != NULL) *endptr = (STRING_TYPE *) s; #if !UNSIGNED /* Check for a value that is within the range of `unsigned LONG int', but outside the range of `LONG int'. */ if (overflow == 0 && i > (negative ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 : (unsigned LONG int) STRTOL_LONG_MAX)) overflow = 1; #endif if (overflow) { __set_errno (ERANGE); #if UNSIGNED return STRTOL_ULONG_MAX; #else return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; #endif } /* Return the result of the appropriate sign. */ return negative ? -i : i; noconv: /* We must handle a special case here: the base is 0 or 16 and the first two characters are '0' and 'x', but the rest are no hexadecimal digits. This is no error case. We return 0 and ENDPTR points to the `x`. */ if (endptr != NULL) { if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') && save[-2] == L_('0')) *endptr = (STRING_TYPE *) &save[-1]; else /* There was no number to convert. */ *endptr = (STRING_TYPE *) nptr; } return 0L; } /* External user entry point. */ INT #ifdef weak_function weak_function #endif strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr, int base LOCALE_PARAM_PROTO) { return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM); } genparse-0.9.1/gnulib/lib/strtoull.c0000644000076600001440000000201211673365613014340 00000000000000/* Function to parse an `unsigned long long int' from text. Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #define QUAD 1 #include "strtoul.c" #ifdef _LIBC strong_alias (__strtoull_internal, __strtouq_internal) weak_alias (strtoull, strtouq) #endif genparse-0.9.1/gnulib/lib/xstrtol-error.c0000644000076600001440000000532711673365613015332 00000000000000/* A more useful interface to strtol. Copyright (C) 1995, 1996, 1998, 1999, 2001-2004, 2006-2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include "xstrtol.h" #include #include "error.h" #include "exitfail.h" #include "gettext.h" #define N_(msgid) msgid /* Report an error for an invalid integer in an option argument. ERR is the error code returned by one of the xstrto* functions. Use OPT_IDX to decide whether to print the short option string "C" or "-C" or a long option string derived from LONG_OPTION. OPT_IDX is -2 if the short option "C" was used, without any leading "-"; it is -1 if the short option "-C" was used; otherwise it is an index into LONG_OPTIONS, which should have a name preceded by two '-' characters. ARG is the option-argument containing the integer. After reporting an error, exit with status EXIT_STATUS if it is nonzero. */ static void xstrtol_error (enum strtol_error err, int opt_idx, char c, struct option const *long_options, char const *arg, int exit_status) { char const *hyphens = "--"; char const *msgid; char const *option; char option_buffer[2]; switch (err) { default: abort (); case LONGINT_INVALID: msgid = N_("invalid %s%s argument `%s'"); break; case LONGINT_INVALID_SUFFIX_CHAR: case LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW: msgid = N_("invalid suffix in %s%s argument `%s'"); break; case LONGINT_OVERFLOW: msgid = N_("%s%s argument `%s' too large"); break; } if (opt_idx < 0) { hyphens -= opt_idx; option_buffer[0] = c; option_buffer[1] = '\0'; option = option_buffer; } else option = long_options[opt_idx].name; error (exit_status, 0, gettext (msgid), hyphens, option, arg); } /* Like xstrtol_error, except exit with a failure status. */ void xstrtol_fatal (enum strtol_error err, int opt_idx, char c, struct option const *long_options, char const *arg) { xstrtol_error (err, opt_idx, c, long_options, arg, exit_failure); abort (); } genparse-0.9.1/gnulib/lib/xstrtod.c0000644000076600001440000000377011673365613014173 00000000000000/* error-checking interface to strtod-like functions Copyright (C) 1996, 1999, 2000, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Jim Meyering. */ #include #include "xstrtod.h" #include #include #include #if LONG # define XSTRTOD xstrtold # define DOUBLE long double #else # define XSTRTOD xstrtod # define DOUBLE double #endif /* An interface to a string-to-floating-point conversion function that encapsulates all the error checking one should usually perform. Like strtod/strtold, but upon successful conversion put the result in *RESULT and return true. Return false and don't modify *RESULT upon any failure. CONVERT specifies the conversion function, e.g., strtod itself. */ bool XSTRTOD (char const *str, char const **ptr, DOUBLE *result, DOUBLE (*convert) (char const *, char **)) { DOUBLE val; char *terminator; bool ok = true; errno = 0; val = convert (str, &terminator); /* Having a non-zero terminator is an error only when PTR is NULL. */ if (terminator == str || (ptr == NULL && *terminator != '\0')) ok = false; else { /* Allow underflow (in which case CONVERT returns zero), but flag overflow as an error. */ if (val != 0 && errno == ERANGE) ok = false; } if (ptr != NULL) *ptr = terminator; *result = val; return ok; } genparse-0.9.1/gnulib/lib/xmalloc.c0000644000076600001440000000637711673365613014131 00000000000000/* xmalloc.c -- malloc with out of memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #if ! HAVE_INLINE # define static_inline #endif #include "xalloc.h" #undef static_inline #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif /* 1 if calloc is known to be compatible with GNU calloc. This matters if we are not also using the calloc module, which defines HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ #if defined HAVE_CALLOC || defined __GLIBC__ enum { HAVE_GNU_CALLOC = 1 }; #else enum { HAVE_GNU_CALLOC = 0 }; #endif /* Allocate N bytes of memory dynamically, with error checking. */ void * xmalloc (size_t n) { void *p = malloc (n); if (!p && n != 0) xalloc_die (); return p; } /* Change the size of an allocated block of memory P to N bytes, with error checking. */ void * xrealloc (void *p, size_t n) { p = realloc (p, n); if (!p && n != 0) xalloc_die (); return p; } /* If P is null, allocate a block of at least *PN bytes; otherwise, reallocate P so that it contains more than *PN bytes. *PN must be nonzero unless P is null. Set *PN to the new block's size, and return the pointer to the new block. *PN is never set to zero, and the returned pointer is never null. */ void * x2realloc (void *p, size_t *pn) { return x2nrealloc (p, pn, 1); } /* Allocate S bytes of zeroed memory dynamically, with error checking. There's no need for xnzalloc (N, S), since it would be equivalent to xcalloc (N, S). */ void * xzalloc (size_t s) { return memset (xmalloc (s), 0, s); } /* Allocate zeroed memory for N elements of S bytes, with error checking. S must be nonzero. */ void * xcalloc (size_t n, size_t s) { void *p; /* Test for overflow, since some calloc implementations don't have proper overflow checks. But omit overflow and size-zero tests if HAVE_GNU_CALLOC, since GNU calloc catches overflow and never returns NULL if successful. */ if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s)) || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0))) xalloc_die (); return p; } /* Clone an object P of size S, with error checking. There's no need for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any need for an arithmetic overflow check. */ void * xmemdup (void const *p, size_t s) { return memcpy (xmalloc (s), p, s); } /* Clone STRING. */ char * xstrdup (char const *string) { return xmemdup (string, strlen (string) + 1); } genparse-0.9.1/gnulib/lib/verify.h0000644000076600001440000001271711673365613013776 00000000000000/* Compile-time assert-like macros. Copyright (C) 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ #ifndef VERIFY_H # define VERIFY_H 1 /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike assert (R), there is no run-time overhead. There are two macros, since no single macro can be used in all contexts in C. verify_true (R) is for scalar contexts, including integer constant expression contexts. verify (R) is for declaration contexts, e.g., the top level. Symbols ending in "__" are private to this header. The code below uses several ideas. * The first step is ((R) ? 1 : -1). Given an expression R, of integral or boolean or floating-point type, this yields an expression of integral type, whose value is later verified to be constant and nonnegative. * Next this expression W is wrapped in a type struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }. If W is negative, this yields a compile-time error. No compiler can deal with a bit-field of negative size. One might think that an array size check would have the same effect, that is, that the type struct { unsigned int dummy[W]; } would work as well. However, inside a function, some compilers (such as C++ compilers and GNU C) allow local parameters and variables inside array size expressions. With these compilers, an array size check would not properly diagnose this misuse of the verify macro: void function (int n) { verify (n < 0); } * For the verify macro, the struct verify_type__ will need to somehow be embedded into a declaration. To be portable, this declaration must declare an object, a constant, a function, or a typedef name. If the declared entity uses the type directly, such as in struct dummy {...}; typedef struct {...} dummy; extern struct {...} *dummy; extern void dummy (struct {...} *); extern struct {...} *dummy (void); two uses of the verify macro would yield colliding declarations if the entity names are not disambiguated. A workaround is to attach the current line number to the entity name: #define GL_CONCAT0(x, y) x##y #define GL_CONCAT(x, y) GL_CONCAT0 (x, y) extern struct {...} * GL_CONCAT(dummy,__LINE__); But this has the problem that two invocations of verify from within the same macro would collide, since the __LINE__ value would be the same for both invocations. A solution is to use the sizeof operator. It yields a number, getting rid of the identity of the type. Declarations like extern int dummy [sizeof (struct {...})]; extern void dummy (int [sizeof (struct {...})]); extern int (*dummy (void)) [sizeof (struct {...})]; can be repeated. * Should the implementation use a named struct or an unnamed struct? Which of the following alternatives can be used? extern int dummy [sizeof (struct {...})]; extern int dummy [sizeof (struct verify_type__ {...})]; extern void dummy (int [sizeof (struct {...})]); extern void dummy (int [sizeof (struct verify_type__ {...})]); extern int (*dummy (void)) [sizeof (struct {...})]; extern int (*dummy (void)) [sizeof (struct verify_type__ {...})]; In the second and sixth case, the struct type is exported to the outer scope; two such declarations therefore collide. GCC warns about the first, third, and fourth cases. So the only remaining possibility is the fifth case: extern int (*dummy (void)) [sizeof (struct {...})]; * This implementation exploits the fact that GCC does not warn about the last declaration mentioned above. If a future version of GCC introduces a warning for this, the problem could be worked around by using code specialized to GCC, e.g.,: #if 4 <= __GNUC__ # define verify(R) \ extern int (* verify_function__ (void)) \ [__builtin_constant_p (R) && (R) ? 1 : -1] #endif * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */ /* Verify requirement R at compile-time, as an integer constant expression. Return 1. */ # ifdef __cplusplus template struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; # define verify_true(R) \ (!!sizeof (verify_type__<(R) ? 1 : -1>)) # else # define verify_true(R) \ (!!sizeof \ (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) # endif /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ # define verify(R) extern int (* verify_function__ (void)) [verify_true (R)] #endif genparse-0.9.1/gnulib/lib/xstrtod.h0000644000076600001440000000217411673365613014175 00000000000000/* Error-checking interface to strtod-like functions. Copyright (C) 1996, 1998, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Jim Meyering. */ #ifndef XSTRTOD_H # define XSTRTOD_H 1 # include bool xstrtod (const char *str, const char **ptr, double *result, double (*convert) (char const *, char **)); bool xstrtold (const char *str, const char **ptr, long double *result, long double (*convert) (char const *, char **)); #endif /* not XSTRTOD_H */ genparse-0.9.1/gnulib/lib/xstrtoul.c0000644000076600001440000000025410701224326014344 00000000000000#define __strtol strtoul #define __strtol_t unsigned long int #define __xstrtol xstrtoul #define STRTOL_T_MINIMUM 0 #define STRTOL_T_MAXIMUM ULONG_MAX #include "xstrtol.c" genparse-0.9.1/gnulib/lib/xalloc.h0000644000076600001440000001773011673365613013754 00000000000000/* xalloc.h -- malloc with out-of-memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef XALLOC_H_ # define XALLOC_H_ # include # ifdef __cplusplus extern "C" { # endif # ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) # endif # endif # ifndef ATTRIBUTE_NORETURN # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # endif # ifndef ATTRIBUTE_MALLOC # if __GNUC__ >= 3 # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) # else # define ATTRIBUTE_MALLOC # endif # endif /* This function is always triggered when memory is exhausted. It must be defined by the application, either explicitly or by using gnulib's xalloc-die module. This is the function to call when one wants the program to die because of a memory allocation failure. */ extern void xalloc_die (void) ATTRIBUTE_NORETURN; void *xmalloc (size_t s) ATTRIBUTE_MALLOC; void *xzalloc (size_t s) ATTRIBUTE_MALLOC; void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; void *xrealloc (void *p, size_t s); void *x2realloc (void *p, size_t *pn); void *xmemdup (void const *p, size_t s) ATTRIBUTE_MALLOC; char *xstrdup (char const *str) ATTRIBUTE_MALLOC; /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be nonnegative. This is a macro, not an inline function, so that it works correctly even when SIZE_MAX < N. By gnulib convention, SIZE_MAX represents overflow in size calculations, so the conservative dividend to use here is SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. However, malloc (SIZE_MAX) fails on all known hosts where sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for exactly-SIZE_MAX allocations on such hosts; this avoids a test and branch when S is known to be 1. */ # define xalloc_oversized(n, s) \ ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) /* In the following macros, T must be an elementary or structure/union or typedef'ed type, or a pointer to such a type. To apply one of the following macros to a function pointer or array type, you need to typedef it first and use the typedef name. */ /* Allocate an object of type T dynamically, with error checking. */ /* extern t *XMALLOC (typename t); */ # define XMALLOC(t) ((t *) xmalloc (sizeof (t))) /* Allocate memory for N elements of type T, with error checking. */ /* extern t *XNMALLOC (size_t n, typename t); */ # define XNMALLOC(n, t) \ ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t)))) /* Allocate an object of type T dynamically, with error checking, and zero it. */ /* extern t *XZALLOC (typename t); */ # define XZALLOC(t) ((t *) xzalloc (sizeof (t))) /* Allocate memory for N elements of type T, with error checking, and zero it. */ /* extern t *XCALLOC (size_t n, typename t); */ # define XCALLOC(n, t) \ ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t)))) # if HAVE_INLINE # define static_inline static inline # else void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; void *xnrealloc (void *p, size_t n, size_t s); void *x2nrealloc (void *p, size_t *pn, size_t s); char *xcharalloc (size_t n) ATTRIBUTE_MALLOC; # endif # ifdef static_inline /* Allocate an array of N objects, each with S bytes of memory, dynamically, with error checking. S must be nonzero. */ static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC; static_inline void * xnmalloc (size_t n, size_t s) { if (xalloc_oversized (n, s)) xalloc_die (); return xmalloc (n * s); } /* Change the size of an allocated block of memory P to an array of N objects each of S bytes, with error checking. S must be nonzero. */ static_inline void * xnrealloc (void *p, size_t n, size_t s) { if (xalloc_oversized (n, s)) xalloc_die (); return xrealloc (p, n * s); } /* If P is null, allocate a block of at least *PN such objects; otherwise, reallocate P so that it contains more than *PN objects each of S bytes. *PN must be nonzero unless P is null, and S must be nonzero. Set *PN to the new number of objects, and return the pointer to the new block. *PN is never set to zero, and the returned pointer is never null. Repeated reallocations are guaranteed to make progress, either by allocating an initial block with a nonzero size, or by allocating a larger block. In the following implementation, nonzero sizes are increased by a factor of approximately 1.5 so that repeated reallocations have O(N) overall cost rather than O(N**2) cost, but the specification for this function does not guarantee that rate. Here is an example of use: int *p = NULL; size_t used = 0; size_t allocated = 0; void append_int (int value) { if (used == allocated) p = x2nrealloc (p, &allocated, sizeof *p); p[used++] = value; } This causes x2nrealloc to allocate a block of some nonzero size the first time it is called. To have finer-grained control over the initial size, set *PN to a nonzero value before calling this function with P == NULL. For example: int *p = NULL; size_t used = 0; size_t allocated = 0; size_t allocated1 = 1000; void append_int (int value) { if (used == allocated) { p = x2nrealloc (p, &allocated1, sizeof *p); allocated = allocated1; } p[used++] = value; } */ static_inline void * x2nrealloc (void *p, size_t *pn, size_t s) { size_t n = *pn; if (! p) { if (! n) { /* The approximate size to use for initial small allocation requests, when the invoking code specifies an old size of zero. 64 bytes is the largest "small" request for the GNU C library malloc. */ enum { DEFAULT_MXFAST = 64 }; n = DEFAULT_MXFAST / s; n += !n; } } else { /* Set N = ceil (1.5 * N) so that progress is made if N == 1. Check for overflow, so that N * S stays in size_t range. The check is slightly conservative, but an exact check isn't worth the trouble. */ if ((size_t) -1 / 3 * 2 / s <= n) xalloc_die (); n += (n + 1) / 2; } *pn = n; return xrealloc (p, n * s); } /* Return a pointer to a new buffer of N bytes. This is like xmalloc, except it returns char *. */ static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC; static_inline char * xcharalloc (size_t n) { return XNMALLOC (n, char); } # endif # ifdef __cplusplus } /* C++ does not allow conversions from void * to other pointer types without a cast. Use templates to work around the problem when possible. */ template inline T * xrealloc (T *p, size_t s) { return (T *) xrealloc ((void *) p, s); } template inline T * xnrealloc (T *p, size_t n, size_t s) { return (T *) xnrealloc ((void *) p, n, s); } template inline T * x2realloc (T *p, size_t *pn) { return (T *) x2realloc ((void *) p, pn); } template inline T * x2nrealloc (T *p, size_t *pn, size_t s) { return (T *) x2nrealloc ((void *) p, pn, s); } template inline T * xmemdup (T const *p, size_t s) { return (T *) xmemdup ((void const *) p, s); } # endif #endif /* !XALLOC_H_ */ genparse-0.9.1/gnulib/lib/getopt_int.h0000644000076600001440000001120311673365613014633 00000000000000/* Internal declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _GETOPT_INT_H #define _GETOPT_INT_H 1 extern int _getopt_internal (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct); /* Reentrant versions which can handle parsing multiple argument vectors at the same time. */ /* Data type for reentrant functions. */ struct _getopt_data { /* These have exactly the same meaning as the corresponding global variables, except that they are used for the reentrant versions of getopt. */ int optind; int opterr; int optopt; char *optarg; /* Internal members. */ /* True if the internal members have been initialized. */ int __initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ char *__nextchar; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters, or by calling getopt. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } __ordering; /* If the POSIXLY_CORRECT environment variable is set or getopt was called. */ int __posixly_correct; /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ int __first_nonopt; int __last_nonopt; #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; # endif }; /* The initializer is necessary to set OPTIND and OPTERR to their default values and to clear the initialization flag. */ #define _GETOPT_DATA_INITIALIZER { 1, 1 } extern int _getopt_internal_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct, struct _getopt_data *__data); extern int _getopt_long_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); extern int _getopt_long_only_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); #endif /* getopt_int.h */ genparse-0.9.1/gnulib/lib/gettext.h0000644000076600001440000002240611673365613014152 00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ genparse-0.9.1/gnulib/lib/string.in.h0000644000076600001440000005253311673365613014405 00000000000000/* A GNU-like . Copyright (C) 1995-1996, 2001-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_STRING_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STRING_H@ #ifndef _GL_STRING_H #define _GL_STRING_H #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The attribute __pure__ was added in gcc 2.96. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) # define __pure__ /* empty */ # endif #endif /* The definition of GL_LINK_WARNING is copied here. */ #ifdef __cplusplus extern "C" { #endif /* Return the first occurrence of NEEDLE in HAYSTACK. */ #if @GNULIB_MEMMEM@ # if @REPLACE_MEMMEM@ # define memmem rpl_memmem # endif # if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@ extern void *memmem (void const *__haystack, size_t __haystack_len, void const *__needle, size_t __needle_len) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef memmem # define memmem(a,al,b,bl) \ (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \ "use gnulib module memmem-simple for portability, " \ "and module memmem for speed" ), \ memmem (a, al, b, bl)) #endif /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ #if @GNULIB_MEMPCPY@ # if ! @HAVE_MEMPCPY@ extern void *mempcpy (void *restrict __dest, void const *restrict __src, size_t __n); # endif #elif defined GNULIB_POSIXCHECK # undef mempcpy # define mempcpy(a,b,n) \ (GL_LINK_WARNING ("mempcpy is unportable - " \ "use gnulib module mempcpy for portability"), \ mempcpy (a, b, n)) #endif /* Search backwards through a block for a byte (specified as an int). */ #if @GNULIB_MEMRCHR@ # if ! @HAVE_DECL_MEMRCHR@ extern void *memrchr (void const *, int, size_t) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef memrchr # define memrchr(a,b,c) \ (GL_LINK_WARNING ("memrchr is unportable - " \ "use gnulib module memrchr for portability"), \ memrchr (a, b, c)) #endif /* Find the first occurrence of C in S. More efficient than memchr(S,C,N), at the expense of undefined behavior if C does not occur within N bytes. */ #if @GNULIB_RAWMEMCHR@ # if ! @HAVE_RAWMEMCHR@ extern void *rawmemchr (void const *__s, int __c_in) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef rawmemchr # define rawmemchr(a,b) \ (GL_LINK_WARNING ("rawmemchr is unportable - " \ "use gnulib module rawmemchr for portability"), \ rawmemchr (a, b)) #endif /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ #if @GNULIB_STPCPY@ # if ! @HAVE_STPCPY@ extern char *stpcpy (char *restrict __dst, char const *restrict __src); # endif #elif defined GNULIB_POSIXCHECK # undef stpcpy # define stpcpy(a,b) \ (GL_LINK_WARNING ("stpcpy is unportable - " \ "use gnulib module stpcpy for portability"), \ stpcpy (a, b)) #endif /* Copy no more than N bytes of SRC to DST, returning a pointer past the last non-NUL byte written into DST. */ #if @GNULIB_STPNCPY@ # if ! @HAVE_STPNCPY@ # define stpncpy gnu_stpncpy extern char *stpncpy (char *restrict __dst, char const *restrict __src, size_t __n); # endif #elif defined GNULIB_POSIXCHECK # undef stpncpy # define stpncpy(a,b,n) \ (GL_LINK_WARNING ("stpncpy is unportable - " \ "use gnulib module stpncpy for portability"), \ stpncpy (a, b, n)) #endif #if defined GNULIB_POSIXCHECK /* strchr() does not work with multibyte strings if the locale encoding is GB18030 and the character to be searched is a digit. */ # undef strchr # define strchr(s,c) \ (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \ "in some multibyte locales - " \ "use mbschr if you care about internationalization"), \ strchr (s, c)) #endif /* Find the first occurrence of C in S or the final NUL byte. */ #if @GNULIB_STRCHRNUL@ # if ! @HAVE_STRCHRNUL@ extern char *strchrnul (char const *__s, int __c_in) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef strchrnul # define strchrnul(a,b) \ (GL_LINK_WARNING ("strchrnul is unportable - " \ "use gnulib module strchrnul for portability"), \ strchrnul (a, b)) #endif /* Duplicate S, returning an identical malloc'd string. */ #if @GNULIB_STRDUP@ # if @REPLACE_STRDUP@ # undef strdup # define strdup rpl_strdup # endif # if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@ extern char *strdup (char const *__s); # endif #elif defined GNULIB_POSIXCHECK # undef strdup # define strdup(a) \ (GL_LINK_WARNING ("strdup is unportable - " \ "use gnulib module strdup for portability"), \ strdup (a)) #endif /* Return a newly allocated copy of at most N bytes of STRING. */ #if @GNULIB_STRNDUP@ # if ! @HAVE_STRNDUP@ # undef strndup # define strndup rpl_strndup # endif # if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@ extern char *strndup (char const *__string, size_t __n); # endif #elif defined GNULIB_POSIXCHECK # undef strndup # define strndup(a,n) \ (GL_LINK_WARNING ("strndup is unportable - " \ "use gnulib module strndup for portability"), \ strndup (a, n)) #endif /* Find the length (number of bytes) of STRING, but scan at most MAXLEN bytes. If no '\0' terminator is found in that many bytes, return MAXLEN. */ #if @GNULIB_STRNLEN@ # if ! @HAVE_DECL_STRNLEN@ extern size_t strnlen (char const *__string, size_t __maxlen) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK # undef strnlen # define strnlen(a,n) \ (GL_LINK_WARNING ("strnlen is unportable - " \ "use gnulib module strnlen for portability"), \ strnlen (a, n)) #endif #if defined GNULIB_POSIXCHECK /* strcspn() assumes the second argument is a list of single-byte characters. Even in this simple case, it does not work with multibyte strings if the locale encoding is GB18030 and one of the characters to be searched is a digit. */ # undef strcspn # define strcspn(s,a) \ (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \ "in multibyte locales - " \ "use mbscspn if you care about internationalization"), \ strcspn (s, a)) #endif /* Find the first occurrence in S of any character in ACCEPT. */ #if @GNULIB_STRPBRK@ # if ! @HAVE_STRPBRK@ extern char *strpbrk (char const *__s, char const *__accept) __attribute__ ((__pure__)); # endif # if defined GNULIB_POSIXCHECK /* strpbrk() assumes the second argument is a list of single-byte characters. Even in this simple case, it does not work with multibyte strings if the locale encoding is GB18030 and one of the characters to be searched is a digit. */ # undef strpbrk # define strpbrk(s,a) \ (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \ "in multibyte locales - " \ "use mbspbrk if you care about internationalization"), \ strpbrk (s, a)) # endif #elif defined GNULIB_POSIXCHECK # undef strpbrk # define strpbrk(s,a) \ (GL_LINK_WARNING ("strpbrk is unportable - " \ "use gnulib module strpbrk for portability"), \ strpbrk (s, a)) #endif #if defined GNULIB_POSIXCHECK /* strspn() assumes the second argument is a list of single-byte characters. Even in this simple case, it cannot work with multibyte strings. */ # undef strspn # define strspn(s,a) \ (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \ "in multibyte locales - " \ "use mbsspn if you care about internationalization"), \ strspn (s, a)) #endif #if defined GNULIB_POSIXCHECK /* strrchr() does not work with multibyte strings if the locale encoding is GB18030 and the character to be searched is a digit. */ # undef strrchr # define strrchr(s,c) \ (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \ "in some multibyte locales - " \ "use mbsrchr if you care about internationalization"), \ strrchr (s, c)) #endif /* Search the next delimiter (char listed in DELIM) starting at *STRINGP. If one is found, overwrite it with a NUL, and advance *STRINGP to point to the next char after it. Otherwise, set *STRINGP to NULL. If *STRINGP was already NULL, nothing happens. Return the old value of *STRINGP. This is a variant of strtok() that is multithread-safe and supports empty fields. Caveat: It modifies the original string. Caveat: These functions cannot be used on constant strings. Caveat: The identity of the delimiting character is lost. Caveat: It doesn't work with multibyte strings unless all of the delimiter characters are ASCII characters < 0x30. See also strtok_r(). */ #if @GNULIB_STRSEP@ # if ! @HAVE_STRSEP@ extern char *strsep (char **restrict __stringp, char const *restrict __delim); # endif # if defined GNULIB_POSIXCHECK # undef strsep # define strsep(s,d) \ (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \ "in multibyte locales - " \ "use mbssep if you care about internationalization"), \ strsep (s, d)) # endif #elif defined GNULIB_POSIXCHECK # undef strsep # define strsep(s,d) \ (GL_LINK_WARNING ("strsep is unportable - " \ "use gnulib module strsep for portability"), \ strsep (s, d)) #endif #if @GNULIB_STRSTR@ # if @REPLACE_STRSTR@ # define strstr rpl_strstr char *strstr (const char *haystack, const char *needle) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK /* strstr() does not work with multibyte strings if the locale encoding is different from UTF-8: POSIX says that it operates on "strings", and "string" in POSIX is defined as a sequence of bytes, not of characters. */ # undef strstr # define strstr(a,b) \ (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \ "work correctly on character strings in most " \ "multibyte locales - " \ "use mbsstr if you care about internationalization, " \ "or use strstr if you care about speed"), \ strstr (a, b)) #endif /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive comparison. */ #if @GNULIB_STRCASESTR@ # if @REPLACE_STRCASESTR@ # define strcasestr rpl_strcasestr # endif # if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@ extern char *strcasestr (const char *haystack, const char *needle) __attribute__ ((__pure__)); # endif #elif defined GNULIB_POSIXCHECK /* strcasestr() does not work with multibyte strings: It is a glibc extension, and glibc implements it only for unibyte locales. */ # undef strcasestr # define strcasestr(a,b) \ (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \ "in multibyte locales - " \ "use mbscasestr if you care about " \ "internationalization, or use c-strcasestr if you want " \ "a locale independent function"), \ strcasestr (a, b)) #endif /* Parse S into tokens separated by characters in DELIM. If S is NULL, the saved pointer in SAVE_PTR is used as the next starting point. For example: char s[] = "-abc-=-def"; char *sp; x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL x = strtok_r(NULL, "=", &sp); // x = NULL // s = "abc\0-def\0" This is a variant of strtok() that is multithread-safe. For the POSIX documentation for this function, see: http://www.opengroup.org/susv3xsh/strtok.html Caveat: It modifies the original string. Caveat: These functions cannot be used on constant strings. Caveat: The identity of the delimiting character is lost. Caveat: It doesn't work with multibyte strings unless all of the delimiter characters are ASCII characters < 0x30. See also strsep(). */ #if @GNULIB_STRTOK_R@ # if ! @HAVE_DECL_STRTOK_R@ extern char *strtok_r (char *restrict s, char const *restrict delim, char **restrict save_ptr); # endif # if defined GNULIB_POSIXCHECK # undef strtok_r # define strtok_r(s,d,p) \ (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \ "in multibyte locales - " \ "use mbstok_r if you care about internationalization"), \ strtok_r (s, d, p)) # endif #elif defined GNULIB_POSIXCHECK # undef strtok_r # define strtok_r(s,d,p) \ (GL_LINK_WARNING ("strtok_r is unportable - " \ "use gnulib module strtok_r for portability"), \ strtok_r (s, d, p)) #endif /* The following functions are not specified by POSIX. They are gnulib extensions. */ #if @GNULIB_MBSLEN@ /* Return the number of multibyte characters in the character string STRING. This considers multibyte characters, unlike strlen, which counts bytes. */ extern size_t mbslen (const char *string); #endif #if @GNULIB_MBSNLEN@ /* Return the number of multibyte characters in the character string starting at STRING and ending at STRING + LEN. */ extern size_t mbsnlen (const char *string, size_t len); #endif #if @GNULIB_MBSCHR@ /* Locate the first single-byte character C in the character string STRING, and return a pointer to it. Return NULL if C is not found in STRING. Unlike strchr(), this function works correctly in multibyte locales with encodings such as GB18030. */ # define mbschr rpl_mbschr /* avoid collision with HP-UX function */ extern char * mbschr (const char *string, int c); #endif #if @GNULIB_MBSRCHR@ /* Locate the last single-byte character C in the character string STRING, and return a pointer to it. Return NULL if C is not found in STRING. Unlike strrchr(), this function works correctly in multibyte locales with encodings such as GB18030. */ # define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ extern char * mbsrchr (const char *string, int c); #endif #if @GNULIB_MBSSTR@ /* Find the first occurrence of the character string NEEDLE in the character string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. Unlike strstr(), this function works correctly in multibyte locales with encodings different from UTF-8. */ extern char * mbsstr (const char *haystack, const char *needle); #endif #if @GNULIB_MBSCASECMP@ /* Compare the character strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. Note: This function may, in multibyte locales, return 0 for strings of different lengths! Unlike strcasecmp(), this function works correctly in multibyte locales. */ extern int mbscasecmp (const char *s1, const char *s2); #endif #if @GNULIB_MBSNCASECMP@ /* Compare the initial segment of the character string S1 consisting of at most N characters with the initial segment of the character string S2 consisting of at most N characters, ignoring case, returning less than, equal to or greater than zero if the initial segment of S1 is lexicographically less than, equal to or greater than the initial segment of S2. Note: This function may, in multibyte locales, return 0 for initial segments of different lengths! Unlike strncasecmp(), this function works correctly in multibyte locales. But beware that N is not a byte count but a character count! */ extern int mbsncasecmp (const char *s1, const char *s2, size_t n); #endif #if @GNULIB_MBSPCASECMP@ /* Compare the initial segment of the character string STRING consisting of at most mbslen (PREFIX) characters with the character string PREFIX, ignoring case, returning less than, equal to or greater than zero if this initial segment is lexicographically less than, equal to or greater than PREFIX. Note: This function may, in multibyte locales, return 0 if STRING is of smaller length than PREFIX! Unlike strncasecmp(), this function works correctly in multibyte locales. */ extern char * mbspcasecmp (const char *string, const char *prefix); #endif #if @GNULIB_MBSCASESTR@ /* Find the first occurrence of the character string NEEDLE in the character string HAYSTACK, using case-insensitive comparison. Note: This function may, in multibyte locales, return success even if strlen (haystack) < strlen (needle) ! Unlike strcasestr(), this function works correctly in multibyte locales. */ extern char * mbscasestr (const char *haystack, const char *needle); #endif #if @GNULIB_MBSCSPN@ /* Find the first occurrence in the character string STRING of any character in the character string ACCEPT. Return the number of bytes from the beginning of the string to this occurrence, or to the end of the string if none exists. Unlike strcspn(), this function works correctly in multibyte locales. */ extern size_t mbscspn (const char *string, const char *accept); #endif #if @GNULIB_MBSPBRK@ /* Find the first occurrence in the character string STRING of any character in the character string ACCEPT. Return the pointer to it, or NULL if none exists. Unlike strpbrk(), this function works correctly in multibyte locales. */ # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ extern char * mbspbrk (const char *string, const char *accept); #endif #if @GNULIB_MBSSPN@ /* Find the first occurrence in the character string STRING of any character not in the character string REJECT. Return the number of bytes from the beginning of the string to this occurrence, or to the end of the string if none exists. Unlike strspn(), this function works correctly in multibyte locales. */ extern size_t mbsspn (const char *string, const char *reject); #endif #if @GNULIB_MBSSEP@ /* Search the next delimiter (multibyte character listed in the character string DELIM) starting at the character string *STRINGP. If one is found, overwrite it with a NUL, and advance *STRINGP to point to the next multibyte character after it. Otherwise, set *STRINGP to NULL. If *STRINGP was already NULL, nothing happens. Return the old value of *STRINGP. This is a variant of mbstok_r() that supports empty fields. Caveat: It modifies the original string. Caveat: These functions cannot be used on constant strings. Caveat: The identity of the delimiting character is lost. See also mbstok_r(). */ extern char * mbssep (char **stringp, const char *delim); #endif #if @GNULIB_MBSTOK_R@ /* Parse the character string STRING into tokens separated by characters in the character string DELIM. If STRING is NULL, the saved pointer in SAVE_PTR is used as the next starting point. For example: char s[] = "-abc-=-def"; char *sp; x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL x = mbstok_r(NULL, "=", &sp); // x = NULL // s = "abc\0-def\0" Caveat: It modifies the original string. Caveat: These functions cannot be used on constant strings. Caveat: The identity of the delimiting character is lost. See also mbssep(). */ extern char * mbstok_r (char *string, const char *delim, char **save_ptr); #endif /* Map any int, typically from errno, into an error message. */ #if @GNULIB_STRERROR@ # if @REPLACE_STRERROR@ # undef strerror # define strerror rpl_strerror extern char *strerror (int); # endif #elif defined GNULIB_POSIXCHECK # undef strerror # define strerror(e) \ (GL_LINK_WARNING ("strerror is unportable - " \ "use gnulib module strerror to guarantee non-NULL result"), \ strerror (e)) #endif #if @GNULIB_STRSIGNAL@ # if @REPLACE_STRSIGNAL@ # define strsignal rpl_strsignal # endif # if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@ extern char *strsignal (int __sig); # endif #elif defined GNULIB_POSIXCHECK # undef strsignal # define strsignal(a) \ (GL_LINK_WARNING ("strsignal is unportable - " \ "use gnulib module strsignal for portability"), \ strsignal (a)) #endif #if @GNULIB_STRVERSCMP@ # if !@HAVE_STRVERSCMP@ extern int strverscmp (const char *, const char *); # endif #elif defined GNULIB_POSIXCHECK # undef strverscmp # define strverscmp(a, b) \ (GL_LINK_WARNING ("strverscmp is unportable - " \ "use gnulib module strverscmp for portability"), \ strverscmp (a, b)) #endif #ifdef __cplusplus } #endif #endif /* _GL_STRING_H */ #endif /* _GL_STRING_H */ genparse-0.9.1/gnulib/lib/strtoumax.c0000644000076600001440000000005210701224326014502 00000000000000#define UNSIGNED 1 #include "strtoimax.c" genparse-0.9.1/gnulib/lib/strerror.c0000644000076600001440000001741111673365613014343 00000000000000/* strerror.c --- POSIX compatible system error routine Copyright (C) 2007-2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include #if REPLACE_STRERROR # include # include # if GNULIB_defined_ESOCK /* native Windows platforms */ # if HAVE_WINSOCK2_H # include # endif # endif # include "intprops.h" # undef strerror # if ! HAVE_DECL_STRERROR # define strerror(n) NULL # endif char * rpl_strerror (int n) { /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ switch (n) { # if GNULIB_defined_ETXTBSY case ETXTBSY: return "Text file busy"; # endif # if GNULIB_defined_ESOCK /* native Windows platforms */ /* EWOULDBLOCK is the same as EAGAIN. */ case EINPROGRESS: return "Operation now in progress"; case EALREADY: return "Operation already in progress"; case ENOTSOCK: return "Socket operation on non-socket"; case EDESTADDRREQ: return "Destination address required"; case EMSGSIZE: return "Message too long"; case EPROTOTYPE: return "Protocol wrong type for socket"; case ENOPROTOOPT: return "Protocol not available"; case EPROTONOSUPPORT: return "Protocol not supported"; case ESOCKTNOSUPPORT: return "Socket type not supported"; case EOPNOTSUPP: return "Operation not supported"; case EPFNOSUPPORT: return "Protocol family not supported"; case EAFNOSUPPORT: return "Address family not supported by protocol"; case EADDRINUSE: return "Address already in use"; case EADDRNOTAVAIL: return "Cannot assign requested address"; case ENETDOWN: return "Network is down"; case ENETUNREACH: return "Network is unreachable"; case ENETRESET: return "Network dropped connection on reset"; case ECONNABORTED: return "Software caused connection abort"; case ECONNRESET: return "Connection reset by peer"; case ENOBUFS: return "No buffer space available"; case EISCONN: return "Transport endpoint is already connected"; case ENOTCONN: return "Transport endpoint is not connected"; case ESHUTDOWN: return "Cannot send after transport endpoint shutdown"; case ETOOMANYREFS: return "Too many references: cannot splice"; case ETIMEDOUT: return "Connection timed out"; case ECONNREFUSED: return "Connection refused"; case ELOOP: return "Too many levels of symbolic links"; case EHOSTDOWN: return "Host is down"; case EHOSTUNREACH: return "No route to host"; case EPROCLIM: return "Too many processes"; case EUSERS: return "Too many users"; case EDQUOT: return "Disk quota exceeded"; case ESTALE: return "Stale NFS file handle"; case EREMOTE: return "Object is remote"; # if HAVE_WINSOCK2_H /* WSA_INVALID_HANDLE maps to EBADF */ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */ /* WSA_INVALID_PARAMETER maps to EINVAL */ case WSA_OPERATION_ABORTED: return "Overlapped operation aborted"; case WSA_IO_INCOMPLETE: return "Overlapped I/O event object not in signaled state"; case WSA_IO_PENDING: return "Overlapped operations will complete later"; /* WSAEINTR maps to EINTR */ /* WSAEBADF maps to EBADF */ /* WSAEACCES maps to EACCES */ /* WSAEFAULT maps to EFAULT */ /* WSAEINVAL maps to EINVAL */ /* WSAEMFILE maps to EMFILE */ /* WSAEWOULDBLOCK maps to EWOULDBLOCK */ /* WSAEINPROGRESS is EINPROGRESS */ /* WSAEALREADY is EALREADY */ /* WSAENOTSOCK is ENOTSOCK */ /* WSAEDESTADDRREQ is EDESTADDRREQ */ /* WSAEMSGSIZE is EMSGSIZE */ /* WSAEPROTOTYPE is EPROTOTYPE */ /* WSAENOPROTOOPT is ENOPROTOOPT */ /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */ /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */ /* WSAEOPNOTSUPP is EOPNOTSUPP */ /* WSAEPFNOSUPPORT is EPFNOSUPPORT */ /* WSAEAFNOSUPPORT is EAFNOSUPPORT */ /* WSAEADDRINUSE is EADDRINUSE */ /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */ /* WSAENETDOWN is ENETDOWN */ /* WSAENETUNREACH is ENETUNREACH */ /* WSAENETRESET is ENETRESET */ /* WSAECONNABORTED is ECONNABORTED */ /* WSAECONNRESET is ECONNRESET */ /* WSAENOBUFS is ENOBUFS */ /* WSAEISCONN is EISCONN */ /* WSAENOTCONN is ENOTCONN */ /* WSAESHUTDOWN is ESHUTDOWN */ /* WSAETOOMANYREFS is ETOOMANYREFS */ /* WSAETIMEDOUT is ETIMEDOUT */ /* WSAECONNREFUSED is ECONNREFUSED */ /* WSAELOOP is ELOOP */ /* WSAENAMETOOLONG maps to ENAMETOOLONG */ /* WSAEHOSTDOWN is EHOSTDOWN */ /* WSAEHOSTUNREACH is EHOSTUNREACH */ /* WSAENOTEMPTY maps to ENOTEMPTY */ /* WSAEPROCLIM is EPROCLIM */ /* WSAEUSERS is EUSERS */ /* WSAEDQUOT is EDQUOT */ /* WSAESTALE is ESTALE */ /* WSAEREMOTE is EREMOTE */ case WSASYSNOTREADY: return "Network subsystem is unavailable"; case WSAVERNOTSUPPORTED: return "Winsock.dll version out of range"; case WSANOTINITIALISED: return "Successful WSAStartup not yet performed"; case WSAEDISCON: return "Graceful shutdown in progress"; case WSAENOMORE: case WSA_E_NO_MORE: return "No more results"; case WSAECANCELLED: case WSA_E_CANCELLED: return "Call was canceled"; case WSAEINVALIDPROCTABLE: return "Procedure call table is invalid"; case WSAEINVALIDPROVIDER: return "Service provider is invalid"; case WSAEPROVIDERFAILEDINIT: return "Service provider failed to initialize"; case WSASYSCALLFAILURE: return "System call failure"; case WSASERVICE_NOT_FOUND: return "Service not found"; case WSATYPE_NOT_FOUND: return "Class type not found"; case WSAEREFUSED: return "Database query was refused"; case WSAHOST_NOT_FOUND: return "Host not found"; case WSATRY_AGAIN: return "Nonauthoritative host not found"; case WSANO_RECOVERY: return "Nonrecoverable error"; case WSANO_DATA: return "Valid name, no data record of requested type"; /* WSA_QOS_* omitted */ # endif # endif # if GNULIB_defined_ENOMSG case ENOMSG: return "No message of desired type"; # endif # if GNULIB_defined_EIDRM case EIDRM: return "Identifier removed"; # endif # if GNULIB_defined_ENOLINK case ENOLINK: return "Link has been severed"; # endif # if GNULIB_defined_EPROTO case EPROTO: return "Protocol error"; # endif # if GNULIB_defined_EMULTIHOP case EMULTIHOP: return "Multihop attempted"; # endif # if GNULIB_defined_EBADMSG case EBADMSG: return "Bad message"; # endif # if GNULIB_defined_EOVERFLOW case EOVERFLOW: return "Value too large for defined data type"; # endif # if GNULIB_defined_ENOTSUP case ENOTSUP: return "Not supported"; # endif # if GNULIB_defined_ case ECANCELED: return "Operation canceled"; # endif } { char *result = strerror (n); if (result == NULL || result[0] == '\0') { static char const fmt[] = "Unknown error (%d)"; static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)]; sprintf (mesg, fmt, n); return mesg; } return result; } } #endif genparse-0.9.1/gnulib/lib/Makefile.am0000644000076600001440000005010311673365613014344 00000000000000## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. # Copyright (C) 2002-2008 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-libtool --macro-prefix=gl c-strtod getopt xstrtod xstrtoimax xstrtol xstrtoumax AUTOMAKE_OPTIONS = 1.5 gnits SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = EXTRA_DIST = BUILT_SOURCES = SUFFIXES = MOSTLYCLEANFILES = core *.stackdump MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = noinst_LIBRARIES += libgnu.a libgnu_a_SOURCES = libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libgnu_a_SOURCES = ## begin gnulib module c-strtod EXTRA_DIST += c-strtod.c c-strtod.h EXTRA_libgnu_a_SOURCES += c-strtod.c ## end gnulib module c-strtod ## begin gnulib module errno BUILT_SOURCES += $(ERRNO_H) # We need the following in order to create when the system # doesn't have one that is POSIX compliant. errno.h: errno.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ < $(srcdir)/errno.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += errno.h errno.h-t EXTRA_DIST += errno.in.h ## end gnulib module errno ## begin gnulib module error EXTRA_DIST += error.c error.h EXTRA_libgnu_a_SOURCES += error.c ## end gnulib module error ## begin gnulib module exitfail EXTRA_DIST += exitfail.c exitfail.h EXTRA_libgnu_a_SOURCES += exitfail.c ## end gnulib module exitfail ## begin gnulib module getopt BUILT_SOURCES += $(GETOPT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/getopt.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += getopt.h getopt.h-t EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c ## end gnulib module getopt ## begin gnulib module gettext-h libgnu_a_SOURCES += gettext.h ## end gnulib module gettext-h ## begin gnulib module intprops EXTRA_DIST += intprops.h ## end gnulib module intprops ## begin gnulib module inttypes BUILT_SOURCES += $(INTTYPES_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. inttypes.h: inttypes.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/inttypes.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += inttypes.h inttypes.h-t EXTRA_DIST += inttypes.in.h ## end gnulib module inttypes ## begin gnulib module link-warning LINK_WARNING_H=$(top_srcdir)/./link-warning.h EXTRA_DIST += $(top_srcdir)/./link-warning.h ## end gnulib module link-warning ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdbool.h stdbool.h-t EXTRA_DIST += stdbool.in.h ## end gnulib module stdbool ## begin gnulib module stdint BUILT_SOURCES += $(STDINT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ < $(srcdir)/stdint.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdint.h stdint.h-t EXTRA_DIST += stdint.in.h ## end gnulib module stdint ## begin gnulib module stdlib BUILT_SOURCES += stdlib.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/stdlib.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdlib.h stdlib.h-t EXTRA_DIST += stdlib.in.h ## end gnulib module stdlib ## begin gnulib module strerror EXTRA_DIST += strerror.c EXTRA_libgnu_a_SOURCES += strerror.c ## end gnulib module strerror ## begin gnulib module string BUILT_SOURCES += string.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \ -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \ -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \ -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \ -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \ -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \ -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \ -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \ -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \ -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \ -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \ -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \ -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \ -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \ -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \ -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/string.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += string.h string.h-t EXTRA_DIST += string.in.h ## end gnulib module string ## begin gnulib module strtoimax EXTRA_DIST += strtoimax.c EXTRA_libgnu_a_SOURCES += strtoimax.c ## end gnulib module strtoimax ## begin gnulib module strtol EXTRA_DIST += strtol.c EXTRA_libgnu_a_SOURCES += strtol.c ## end gnulib module strtol ## begin gnulib module strtoll EXTRA_DIST += strtoll.c EXTRA_libgnu_a_SOURCES += strtoll.c ## end gnulib module strtoll ## begin gnulib module strtoul EXTRA_DIST += strtoul.c EXTRA_libgnu_a_SOURCES += strtoul.c ## end gnulib module strtoul ## begin gnulib module strtoull EXTRA_DIST += strtoull.c EXTRA_libgnu_a_SOURCES += strtoull.c ## end gnulib module strtoull ## begin gnulib module strtoumax EXTRA_DIST += strtoumax.c EXTRA_libgnu_a_SOURCES += strtoumax.c ## end gnulib module strtoumax ## begin gnulib module unistd BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for # when the system doesn't have one. unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += unistd.h unistd.h-t EXTRA_DIST += unistd.in.h ## end gnulib module unistd ## begin gnulib module verify libgnu_a_SOURCES += verify.h ## end gnulib module verify ## begin gnulib module wchar BUILT_SOURCES += $(WCHAR_H) # We need the following in order to create when the system # version does not work standalone. wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += wchar.h wchar.h-t EXTRA_DIST += wchar.in.h ## end gnulib module wchar ## begin gnulib module xalloc EXTRA_DIST += xalloc.h xmalloc.c EXTRA_libgnu_a_SOURCES += xmalloc.c ## end gnulib module xalloc ## begin gnulib module xalloc-die libgnu_a_SOURCES += xalloc-die.c ## end gnulib module xalloc-die ## begin gnulib module xstrtod EXTRA_DIST += xstrtod.c xstrtod.h EXTRA_libgnu_a_SOURCES += xstrtod.c ## end gnulib module xstrtod ## begin gnulib module xstrtoimax libgnu_a_SOURCES += xstrtoimax.c ## end gnulib module xstrtoimax ## begin gnulib module xstrtol EXTRA_DIST += xstrtol-error.c xstrtol.c xstrtol.h xstrtoul.c EXTRA_libgnu_a_SOURCES += xstrtol-error.c xstrtol.c xstrtoul.c ## end gnulib module xstrtol ## begin gnulib module xstrtoumax libgnu_a_SOURCES += xstrtoumax.c ## end gnulib module xstrtoumax mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ if test -n "$$dir" && test -d $$dir; then \ echo "rmdir $$dir"; rmdir $$dir; \ fi; \ done; \ : genparse-0.9.1/gnulib/lib/strtoimax.c0000644000076600001440000000401711673365613014511 00000000000000/* Convert string representation of a number into an intmax_t value. Copyright (C) 1999, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Paul Eggert. */ #include /* Verify interface. */ #include #include #include "verify.h" #ifdef UNSIGNED # ifndef HAVE_DECL_STRTOULL "this configure-time declaration test was not run" # endif # if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG_INT unsigned long long int strtoull (char const *, char **, int); # endif #else # ifndef HAVE_DECL_STRTOLL "this configure-time declaration test was not run" # endif # if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG_INT long long int strtoll (char const *, char **, int); # endif #endif #ifdef UNSIGNED # define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT # define Int uintmax_t # define Unsigned unsigned # define strtoimax strtoumax # define strtol strtoul # define strtoll strtoull #else # define Have_long_long HAVE_LONG_LONG_INT # define Int intmax_t # define Unsigned #endif Int strtoimax (char const *ptr, char **endptr, int base) { #if Have_long_long verify (sizeof (Int) == sizeof (Unsigned long int) || sizeof (Int) == sizeof (Unsigned long long int)); if (sizeof (Int) != sizeof (Unsigned long int)) return strtoll (ptr, endptr, base); #else verify (sizeof (Int) == sizeof (Unsigned long int)); #endif return strtol (ptr, endptr, base); } genparse-0.9.1/gnulib/lib/strtoll.c0000644000076600001440000000207611673365613014165 00000000000000/* Function to parse a `long long int' from text. Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #define QUAD 1 #include #ifdef _LIBC # ifdef SHARED # include # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) compat_symbol (libc, __strtoll_internal, __strtoq_internal, GLIBC_2_0); # endif # endif weak_alias (strtoll, strtoq) #endif genparse-0.9.1/gnulib/lib/wchar.in.h0000644000076600001440000000520111673365613014171 00000000000000/* A substitute for ISO C99 , for platforms that have issues. Copyright (C) 2007-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Eric Blake. */ /* * ISO C 99 for platforms that have issues. * * * For now, this just ensures proper prerequisite inclusion order and * the declaration of wcwidth(). */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif #ifdef __need_mbstate_t /* Special invocation convention inside uClibc header files. */ #@INCLUDE_NEXT@ @NEXT_WCHAR_H@ #else /* Normal invocation convention. */ #ifndef _GL_WCHAR_H /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include /* Include the original if it exists. Some builds of uClibc lack it. */ /* The include_next requires a split double-inclusion guard. */ #if @HAVE_WCHAR_H@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif #ifndef _GL_WCHAR_H #define _GL_WCHAR_H /* The definition of GL_LINK_WARNING is copied here. */ #ifdef __cplusplus extern "C" { #endif /* Define wint_t. (Also done in wctype.in.h.) */ #if !@HAVE_WINT_T@ && !defined wint_t # define wint_t int #endif /* Return the number of screen columns needed for WC. */ #if @GNULIB_WCWIDTH@ # if @REPLACE_WCWIDTH@ # undef wcwidth # define wcwidth rpl_wcwidth extern int wcwidth (wchar_t); # else # if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ /* wcwidth exists but is not declared. */ extern int wcwidth (int /* actually wchar_t */); # endif # endif #elif defined GNULIB_POSIXCHECK # undef wcwidth # define wcwidth(w) \ (GL_LINK_WARNING ("wcwidth is unportable - " \ "use gnulib module wcwidth for portability"), \ wcwidth (w)) #endif #ifdef __cplusplus } #endif #endif /* _GL_WCHAR_H */ #endif /* _GL_WCHAR_H */ #endif genparse-0.9.1/gnulib/lib/inttypes.in.h0000644000076600001440000006340411673365613014755 00000000000000/* Copyright (C) 2006-2008 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* * ISO C 99 for platforms that lack it. * */ /* Include the original if it exists, and if this file has not been included yet or if this file includes gnulib stdint.h which in turn includes this file. The include_next requires a split double-inclusion guard. */ #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H # if @HAVE_INTTYPES_H@ # if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ # endif # @INCLUDE_NEXT@ @NEXT_INTTYPES_H@ # endif #endif #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H #define INTTYPES_H /* Include or the gnulib replacement. */ #include /* Get CHAR_BIT. */ #include #if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to ." #endif /* The definition of GL_LINK_WARNING is copied here. */ /* 7.8.1 Macros for format specifiers */ #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS # if defined _TNS_R_TARGET /* Tandem NonStop R series and compatible platforms released before July 2005 support %Ld but not %lld. */ # define _LONG_LONG_FORMAT_PREFIX "L" # else # define _LONG_LONG_FORMAT_PREFIX "ll" # endif # if !defined PRId8 || @PRI_MACROS_BROKEN@ # undef PRId8 # ifdef INT8_MAX # define PRId8 "d" # endif # endif # if !defined PRIi8 || @PRI_MACROS_BROKEN@ # undef PRIi8 # ifdef INT8_MAX # define PRIi8 "i" # endif # endif # if !defined PRIo8 || @PRI_MACROS_BROKEN@ # undef PRIo8 # ifdef UINT8_MAX # define PRIo8 "o" # endif # endif # if !defined PRIu8 || @PRI_MACROS_BROKEN@ # undef PRIu8 # ifdef UINT8_MAX # define PRIu8 "u" # endif # endif # if !defined PRIx8 || @PRI_MACROS_BROKEN@ # undef PRIx8 # ifdef UINT8_MAX # define PRIx8 "x" # endif # endif # if !defined PRIX8 || @PRI_MACROS_BROKEN@ # undef PRIX8 # ifdef UINT8_MAX # define PRIX8 "X" # endif # endif # if !defined PRId16 || @PRI_MACROS_BROKEN@ # undef PRId16 # ifdef INT16_MAX # define PRId16 "d" # endif # endif # if !defined PRIi16 || @PRI_MACROS_BROKEN@ # undef PRIi16 # ifdef INT16_MAX # define PRIi16 "i" # endif # endif # if !defined PRIo16 || @PRI_MACROS_BROKEN@ # undef PRIo16 # ifdef UINT16_MAX # define PRIo16 "o" # endif # endif # if !defined PRIu16 || @PRI_MACROS_BROKEN@ # undef PRIu16 # ifdef UINT16_MAX # define PRIu16 "u" # endif # endif # if !defined PRIx16 || @PRI_MACROS_BROKEN@ # undef PRIx16 # ifdef UINT16_MAX # define PRIx16 "x" # endif # endif # if !defined PRIX16 || @PRI_MACROS_BROKEN@ # undef PRIX16 # ifdef UINT16_MAX # define PRIX16 "X" # endif # endif # if !defined PRId32 || @PRI_MACROS_BROKEN@ # undef PRId32 # ifdef INT32_MAX # define PRId32 "d" # endif # endif # if !defined PRIi32 || @PRI_MACROS_BROKEN@ # undef PRIi32 # ifdef INT32_MAX # define PRIi32 "i" # endif # endif # if !defined PRIo32 || @PRI_MACROS_BROKEN@ # undef PRIo32 # ifdef UINT32_MAX # define PRIo32 "o" # endif # endif # if !defined PRIu32 || @PRI_MACROS_BROKEN@ # undef PRIu32 # ifdef UINT32_MAX # define PRIu32 "u" # endif # endif # if !defined PRIx32 || @PRI_MACROS_BROKEN@ # undef PRIx32 # ifdef UINT32_MAX # define PRIx32 "x" # endif # endif # if !defined PRIX32 || @PRI_MACROS_BROKEN@ # undef PRIX32 # ifdef UINT32_MAX # define PRIX32 "X" # endif # endif # ifdef INT64_MAX # if @INT64_MAX_EQ_LONG_MAX@ # define _PRI64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRI64_PREFIX "I64" # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined PRId64 || @PRI_MACROS_BROKEN@ # undef PRId64 # define PRId64 _PRI64_PREFIX "d" # endif # if !defined PRIi64 || @PRI_MACROS_BROKEN@ # undef PRIi64 # define PRIi64 _PRI64_PREFIX "i" # endif # endif # ifdef UINT64_MAX # if @UINT64_MAX_EQ_ULONG_MAX@ # define _PRIu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRIu64_PREFIX "I64" # elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined PRIo64 || @PRI_MACROS_BROKEN@ # undef PRIo64 # define PRIo64 _PRIu64_PREFIX "o" # endif # if !defined PRIu64 || @PRI_MACROS_BROKEN@ # undef PRIu64 # define PRIu64 _PRIu64_PREFIX "u" # endif # if !defined PRIx64 || @PRI_MACROS_BROKEN@ # undef PRIx64 # define PRIx64 _PRIu64_PREFIX "x" # endif # if !defined PRIX64 || @PRI_MACROS_BROKEN@ # undef PRIX64 # define PRIX64 _PRIu64_PREFIX "X" # endif # endif # if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@ # undef PRIdLEAST8 # define PRIdLEAST8 "d" # endif # if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@ # undef PRIiLEAST8 # define PRIiLEAST8 "i" # endif # if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@ # undef PRIoLEAST8 # define PRIoLEAST8 "o" # endif # if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@ # undef PRIuLEAST8 # define PRIuLEAST8 "u" # endif # if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@ # undef PRIxLEAST8 # define PRIxLEAST8 "x" # endif # if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@ # undef PRIXLEAST8 # define PRIXLEAST8 "X" # endif # if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@ # undef PRIdLEAST16 # define PRIdLEAST16 "d" # endif # if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@ # undef PRIiLEAST16 # define PRIiLEAST16 "i" # endif # if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@ # undef PRIoLEAST16 # define PRIoLEAST16 "o" # endif # if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@ # undef PRIuLEAST16 # define PRIuLEAST16 "u" # endif # if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@ # undef PRIxLEAST16 # define PRIxLEAST16 "x" # endif # if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@ # undef PRIXLEAST16 # define PRIXLEAST16 "X" # endif # if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@ # undef PRIdLEAST32 # define PRIdLEAST32 "d" # endif # if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@ # undef PRIiLEAST32 # define PRIiLEAST32 "i" # endif # if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@ # undef PRIoLEAST32 # define PRIoLEAST32 "o" # endif # if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@ # undef PRIuLEAST32 # define PRIuLEAST32 "u" # endif # if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@ # undef PRIxLEAST32 # define PRIxLEAST32 "x" # endif # if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@ # undef PRIXLEAST32 # define PRIXLEAST32 "X" # endif # ifdef INT64_MAX # if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@ # undef PRIdLEAST64 # define PRIdLEAST64 PRId64 # endif # if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@ # undef PRIiLEAST64 # define PRIiLEAST64 PRIi64 # endif # endif # ifdef UINT64_MAX # if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@ # undef PRIoLEAST64 # define PRIoLEAST64 PRIo64 # endif # if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@ # undef PRIuLEAST64 # define PRIuLEAST64 PRIu64 # endif # if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@ # undef PRIxLEAST64 # define PRIxLEAST64 PRIx64 # endif # if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@ # undef PRIXLEAST64 # define PRIXLEAST64 PRIX64 # endif # endif # if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@ # undef PRIdFAST8 # if INT_FAST8_MAX > INT32_MAX # define PRIdFAST8 PRId64 # else # define PRIdFAST8 "d" # endif # endif # if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@ # undef PRIiFAST8 # if INT_FAST8_MAX > INT32_MAX # define PRIiFAST8 PRIi64 # else # define PRIiFAST8 "i" # endif # endif # if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@ # undef PRIoFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIoFAST8 PRIo64 # else # define PRIoFAST8 "o" # endif # endif # if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@ # undef PRIuFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIuFAST8 PRIu64 # else # define PRIuFAST8 "u" # endif # endif # if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@ # undef PRIxFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIxFAST8 PRIx64 # else # define PRIxFAST8 "x" # endif # endif # if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@ # undef PRIXFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIXFAST8 PRIX64 # else # define PRIXFAST8 "X" # endif # endif # if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@ # undef PRIdFAST16 # if INT_FAST16_MAX > INT32_MAX # define PRIdFAST16 PRId64 # else # define PRIdFAST16 "d" # endif # endif # if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@ # undef PRIiFAST16 # if INT_FAST16_MAX > INT32_MAX # define PRIiFAST16 PRIi64 # else # define PRIiFAST16 "i" # endif # endif # if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@ # undef PRIoFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIoFAST16 PRIo64 # else # define PRIoFAST16 "o" # endif # endif # if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@ # undef PRIuFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIuFAST16 PRIu64 # else # define PRIuFAST16 "u" # endif # endif # if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@ # undef PRIxFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIxFAST16 PRIx64 # else # define PRIxFAST16 "x" # endif # endif # if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@ # undef PRIXFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIXFAST16 PRIX64 # else # define PRIXFAST16 "X" # endif # endif # if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@ # undef PRIdFAST32 # if INT_FAST32_MAX > INT32_MAX # define PRIdFAST32 PRId64 # else # define PRIdFAST32 "d" # endif # endif # if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@ # undef PRIiFAST32 # if INT_FAST32_MAX > INT32_MAX # define PRIiFAST32 PRIi64 # else # define PRIiFAST32 "i" # endif # endif # if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@ # undef PRIoFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIoFAST32 PRIo64 # else # define PRIoFAST32 "o" # endif # endif # if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@ # undef PRIuFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIuFAST32 PRIu64 # else # define PRIuFAST32 "u" # endif # endif # if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@ # undef PRIxFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIxFAST32 PRIx64 # else # define PRIxFAST32 "x" # endif # endif # if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@ # undef PRIXFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIXFAST32 PRIX64 # else # define PRIXFAST32 "X" # endif # endif # ifdef INT64_MAX # if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@ # undef PRIdFAST64 # define PRIdFAST64 PRId64 # endif # if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@ # undef PRIiFAST64 # define PRIiFAST64 PRIi64 # endif # endif # ifdef UINT64_MAX # if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@ # undef PRIoFAST64 # define PRIoFAST64 PRIo64 # endif # if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@ # undef PRIuFAST64 # define PRIuFAST64 PRIu64 # endif # if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@ # undef PRIxFAST64 # define PRIxFAST64 PRIx64 # endif # if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@ # undef PRIXFAST64 # define PRIXFAST64 PRIX64 # endif # endif # if !defined PRIdMAX || @PRI_MACROS_BROKEN@ # undef PRIdMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define PRIdMAX PRId64 # else # define PRIdMAX "ld" # endif # endif # if !defined PRIiMAX || @PRI_MACROS_BROKEN@ # undef PRIiMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define PRIiMAX PRIi64 # else # define PRIiMAX "li" # endif # endif # if !defined PRIoMAX || @PRI_MACROS_BROKEN@ # undef PRIoMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIoMAX PRIo64 # else # define PRIoMAX "lo" # endif # endif # if !defined PRIuMAX || @PRI_MACROS_BROKEN@ # undef PRIuMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIuMAX PRIu64 # else # define PRIuMAX "lu" # endif # endif # if !defined PRIxMAX || @PRI_MACROS_BROKEN@ # undef PRIxMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIxMAX PRIx64 # else # define PRIxMAX "lx" # endif # endif # if !defined PRIXMAX || @PRI_MACROS_BROKEN@ # undef PRIXMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIXMAX PRIX64 # else # define PRIXMAX "lX" # endif # endif # if !defined PRIdPTR || @PRI_MACROS_BROKEN@ # undef PRIdPTR # ifdef INTPTR_MAX # define PRIdPTR @PRIPTR_PREFIX@ "d" # endif # endif # if !defined PRIiPTR || @PRI_MACROS_BROKEN@ # undef PRIiPTR # ifdef INTPTR_MAX # define PRIiPTR @PRIPTR_PREFIX@ "i" # endif # endif # if !defined PRIoPTR || @PRI_MACROS_BROKEN@ # undef PRIoPTR # ifdef UINTPTR_MAX # define PRIoPTR @PRIPTR_PREFIX@ "o" # endif # endif # if !defined PRIuPTR || @PRI_MACROS_BROKEN@ # undef PRIuPTR # ifdef UINTPTR_MAX # define PRIuPTR @PRIPTR_PREFIX@ "u" # endif # endif # if !defined PRIxPTR || @PRI_MACROS_BROKEN@ # undef PRIxPTR # ifdef UINTPTR_MAX # define PRIxPTR @PRIPTR_PREFIX@ "x" # endif # endif # if !defined PRIXPTR || @PRI_MACROS_BROKEN@ # undef PRIXPTR # ifdef UINTPTR_MAX # define PRIXPTR @PRIPTR_PREFIX@ "X" # endif # endif # if !defined SCNd8 || @PRI_MACROS_BROKEN@ # undef SCNd8 # ifdef INT8_MAX # define SCNd8 "hhd" # endif # endif # if !defined SCNi8 || @PRI_MACROS_BROKEN@ # undef SCNi8 # ifdef INT8_MAX # define SCNi8 "hhi" # endif # endif # if !defined SCNo8 || @PRI_MACROS_BROKEN@ # undef SCNo8 # ifdef UINT8_MAX # define SCNo8 "hho" # endif # endif # if !defined SCNu8 || @PRI_MACROS_BROKEN@ # undef SCNu8 # ifdef UINT8_MAX # define SCNu8 "hhu" # endif # endif # if !defined SCNx8 || @PRI_MACROS_BROKEN@ # undef SCNx8 # ifdef UINT8_MAX # define SCNx8 "hhx" # endif # endif # if !defined SCNd16 || @PRI_MACROS_BROKEN@ # undef SCNd16 # ifdef INT16_MAX # define SCNd16 "hd" # endif # endif # if !defined SCNi16 || @PRI_MACROS_BROKEN@ # undef SCNi16 # ifdef INT16_MAX # define SCNi16 "hi" # endif # endif # if !defined SCNo16 || @PRI_MACROS_BROKEN@ # undef SCNo16 # ifdef UINT16_MAX # define SCNo16 "ho" # endif # endif # if !defined SCNu16 || @PRI_MACROS_BROKEN@ # undef SCNu16 # ifdef UINT16_MAX # define SCNu16 "hu" # endif # endif # if !defined SCNx16 || @PRI_MACROS_BROKEN@ # undef SCNx16 # ifdef UINT16_MAX # define SCNx16 "hx" # endif # endif # if !defined SCNd32 || @PRI_MACROS_BROKEN@ # undef SCNd32 # ifdef INT32_MAX # define SCNd32 "d" # endif # endif # if !defined SCNi32 || @PRI_MACROS_BROKEN@ # undef SCNi32 # ifdef INT32_MAX # define SCNi32 "i" # endif # endif # if !defined SCNo32 || @PRI_MACROS_BROKEN@ # undef SCNo32 # ifdef UINT32_MAX # define SCNo32 "o" # endif # endif # if !defined SCNu32 || @PRI_MACROS_BROKEN@ # undef SCNu32 # ifdef UINT32_MAX # define SCNu32 "u" # endif # endif # if !defined SCNx32 || @PRI_MACROS_BROKEN@ # undef SCNx32 # ifdef UINT32_MAX # define SCNx32 "x" # endif # endif # ifdef INT64_MAX # if @INT64_MAX_EQ_LONG_MAX@ # define _SCN64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCN64_PREFIX "I64" # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined SCNd64 || @PRI_MACROS_BROKEN@ # undef SCNd64 # define SCNd64 _SCN64_PREFIX "d" # endif # if !defined SCNi64 || @PRI_MACROS_BROKEN@ # undef SCNi64 # define SCNi64 _SCN64_PREFIX "i" # endif # endif # ifdef UINT64_MAX # if @UINT64_MAX_EQ_ULONG_MAX@ # define _SCNu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCNu64_PREFIX "I64" # elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined SCNo64 || @PRI_MACROS_BROKEN@ # undef SCNo64 # define SCNo64 _SCNu64_PREFIX "o" # endif # if !defined SCNu64 || @PRI_MACROS_BROKEN@ # undef SCNu64 # define SCNu64 _SCNu64_PREFIX "u" # endif # if !defined SCNx64 || @PRI_MACROS_BROKEN@ # undef SCNx64 # define SCNx64 _SCNu64_PREFIX "x" # endif # endif # if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@ # undef SCNdLEAST8 # define SCNdLEAST8 "hhd" # endif # if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@ # undef SCNiLEAST8 # define SCNiLEAST8 "hhi" # endif # if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@ # undef SCNoLEAST8 # define SCNoLEAST8 "hho" # endif # if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@ # undef SCNuLEAST8 # define SCNuLEAST8 "hhu" # endif # if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@ # undef SCNxLEAST8 # define SCNxLEAST8 "hhx" # endif # if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@ # undef SCNdLEAST16 # define SCNdLEAST16 "hd" # endif # if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@ # undef SCNiLEAST16 # define SCNiLEAST16 "hi" # endif # if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@ # undef SCNoLEAST16 # define SCNoLEAST16 "ho" # endif # if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@ # undef SCNuLEAST16 # define SCNuLEAST16 "hu" # endif # if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@ # undef SCNxLEAST16 # define SCNxLEAST16 "hx" # endif # if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@ # undef SCNdLEAST32 # define SCNdLEAST32 "d" # endif # if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@ # undef SCNiLEAST32 # define SCNiLEAST32 "i" # endif # if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@ # undef SCNoLEAST32 # define SCNoLEAST32 "o" # endif # if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@ # undef SCNuLEAST32 # define SCNuLEAST32 "u" # endif # if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@ # undef SCNxLEAST32 # define SCNxLEAST32 "x" # endif # ifdef INT64_MAX # if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@ # undef SCNdLEAST64 # define SCNdLEAST64 SCNd64 # endif # if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@ # undef SCNiLEAST64 # define SCNiLEAST64 SCNi64 # endif # endif # ifdef UINT64_MAX # if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@ # undef SCNoLEAST64 # define SCNoLEAST64 SCNo64 # endif # if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@ # undef SCNuLEAST64 # define SCNuLEAST64 SCNu64 # endif # if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@ # undef SCNxLEAST64 # define SCNxLEAST64 SCNx64 # endif # endif # if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@ # undef SCNdFAST8 # if INT_FAST8_MAX > INT32_MAX # define SCNdFAST8 SCNd64 # elif INT_FAST8_MAX == 0x7fff # define SCNdFAST8 "hd" # elif INT_FAST8_MAX == 0x7f # define SCNdFAST8 "hhd" # else # define SCNdFAST8 "d" # endif # endif # if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@ # undef SCNiFAST8 # if INT_FAST8_MAX > INT32_MAX # define SCNiFAST8 SCNi64 # elif INT_FAST8_MAX == 0x7fff # define SCNiFAST8 "hi" # elif INT_FAST8_MAX == 0x7f # define SCNiFAST8 "hhi" # else # define SCNiFAST8 "i" # endif # endif # if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@ # undef SCNoFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNoFAST8 SCNo64 # elif UINT_FAST8_MAX == 0xffff # define SCNoFAST8 "ho" # elif UINT_FAST8_MAX == 0xff # define SCNoFAST8 "hho" # else # define SCNoFAST8 "o" # endif # endif # if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@ # undef SCNuFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNuFAST8 SCNu64 # elif UINT_FAST8_MAX == 0xffff # define SCNuFAST8 "hu" # elif UINT_FAST8_MAX == 0xff # define SCNuFAST8 "hhu" # else # define SCNuFAST8 "u" # endif # endif # if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@ # undef SCNxFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNxFAST8 SCNx64 # elif UINT_FAST8_MAX == 0xffff # define SCNxFAST8 "hx" # elif UINT_FAST8_MAX == 0xff # define SCNxFAST8 "hhx" # else # define SCNxFAST8 "x" # endif # endif # if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@ # undef SCNdFAST16 # if INT_FAST16_MAX > INT32_MAX # define SCNdFAST16 SCNd64 # elif INT_FAST16_MAX == 0x7fff # define SCNdFAST16 "hd" # else # define SCNdFAST16 "d" # endif # endif # if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@ # undef SCNiFAST16 # if INT_FAST16_MAX > INT32_MAX # define SCNiFAST16 SCNi64 # elif INT_FAST16_MAX == 0x7fff # define SCNiFAST16 "hi" # else # define SCNiFAST16 "i" # endif # endif # if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@ # undef SCNoFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNoFAST16 SCNo64 # elif UINT_FAST16_MAX == 0xffff # define SCNoFAST16 "ho" # else # define SCNoFAST16 "o" # endif # endif # if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@ # undef SCNuFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNuFAST16 SCNu64 # elif UINT_FAST16_MAX == 0xffff # define SCNuFAST16 "hu" # else # define SCNuFAST16 "u" # endif # endif # if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@ # undef SCNxFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNxFAST16 SCNx64 # elif UINT_FAST16_MAX == 0xffff # define SCNxFAST16 "hx" # else # define SCNxFAST16 "x" # endif # endif # if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@ # undef SCNdFAST32 # if INT_FAST32_MAX > INT32_MAX # define SCNdFAST32 SCNd64 # else # define SCNdFAST32 "d" # endif # endif # if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@ # undef SCNiFAST32 # if INT_FAST32_MAX > INT32_MAX # define SCNiFAST32 SCNi64 # else # define SCNiFAST32 "i" # endif # endif # if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@ # undef SCNoFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNoFAST32 SCNo64 # else # define SCNoFAST32 "o" # endif # endif # if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@ # undef SCNuFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNuFAST32 SCNu64 # else # define SCNuFAST32 "u" # endif # endif # if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@ # undef SCNxFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNxFAST32 SCNx64 # else # define SCNxFAST32 "x" # endif # endif # ifdef INT64_MAX # if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@ # undef SCNdFAST64 # define SCNdFAST64 SCNd64 # endif # if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@ # undef SCNiFAST64 # define SCNiFAST64 SCNi64 # endif # endif # ifdef UINT64_MAX # if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@ # undef SCNoFAST64 # define SCNoFAST64 SCNo64 # endif # if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@ # undef SCNuFAST64 # define SCNuFAST64 SCNu64 # endif # if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@ # undef SCNxFAST64 # define SCNxFAST64 SCNx64 # endif # endif # if !defined SCNdMAX || @PRI_MACROS_BROKEN@ # undef SCNdMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define SCNdMAX SCNd64 # else # define SCNdMAX "ld" # endif # endif # if !defined SCNiMAX || @PRI_MACROS_BROKEN@ # undef SCNiMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define SCNiMAX SCNi64 # else # define SCNiMAX "li" # endif # endif # if !defined SCNoMAX || @PRI_MACROS_BROKEN@ # undef SCNoMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNoMAX SCNo64 # else # define SCNoMAX "lo" # endif # endif # if !defined SCNuMAX || @PRI_MACROS_BROKEN@ # undef SCNuMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNuMAX SCNu64 # else # define SCNuMAX "lu" # endif # endif # if !defined SCNxMAX || @PRI_MACROS_BROKEN@ # undef SCNxMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNxMAX SCNx64 # else # define SCNxMAX "lx" # endif # endif # if !defined SCNdPTR || @PRI_MACROS_BROKEN@ # undef SCNdPTR # ifdef INTPTR_MAX # define SCNdPTR @PRIPTR_PREFIX@ "d" # endif # endif # if !defined SCNiPTR || @PRI_MACROS_BROKEN@ # undef SCNiPTR # ifdef INTPTR_MAX # define SCNiPTR @PRIPTR_PREFIX@ "i" # endif # endif # if !defined SCNoPTR || @PRI_MACROS_BROKEN@ # undef SCNoPTR # ifdef UINTPTR_MAX # define SCNoPTR @PRIPTR_PREFIX@ "o" # endif # endif # if !defined SCNuPTR || @PRI_MACROS_BROKEN@ # undef SCNuPTR # ifdef UINTPTR_MAX # define SCNuPTR @PRIPTR_PREFIX@ "u" # endif # endif # if !defined SCNxPTR || @PRI_MACROS_BROKEN@ # undef SCNxPTR # ifdef UINTPTR_MAX # define SCNxPTR @PRIPTR_PREFIX@ "x" # endif # endif #endif /* 7.8.2 Functions for greatest-width integer types */ #ifdef __cplusplus extern "C" { #endif #if @GNULIB_IMAXABS@ # if !@HAVE_DECL_IMAXABS@ extern intmax_t imaxabs (intmax_t); # endif #elif defined GNULIB_POSIXCHECK # undef imaxabs # define imaxabs(a) \ (GL_LINK_WARNING ("imaxabs is unportable - " \ "use gnulib module imaxabs for portability"), \ imaxabs (a)) #endif #if @GNULIB_IMAXDIV@ # if !@HAVE_DECL_IMAXDIV@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; extern imaxdiv_t imaxdiv (intmax_t, intmax_t); # endif #elif defined GNULIB_POSIXCHECK # undef imaxdiv # define imaxdiv(a,b) \ (GL_LINK_WARNING ("imaxdiv is unportable - " \ "use gnulib module imaxdiv for portability"), \ imaxdiv (a, b)) #endif #if @GNULIB_STRTOIMAX@ # if !@HAVE_DECL_STRTOIMAX@ extern intmax_t strtoimax (const char *, char **, int); # endif #elif defined GNULIB_POSIXCHECK # undef strtoimax # define strtoimax(p,e,b) \ (GL_LINK_WARNING ("strtoimax is unportable - " \ "use gnulib module strtoimax for portability"), \ strtoimax (p, e, b)) #endif #if @GNULIB_STRTOUMAX@ # if !@HAVE_DECL_STRTOUMAX@ extern uintmax_t strtoumax (const char *, char **, int); # endif #elif defined GNULIB_POSIXCHECK # undef strtoumax # define strtoumax(p,e,b) \ (GL_LINK_WARNING ("strtoumax is unportable - " \ "use gnulib module strtoumax for portability"), \ strtoumax (p, e, b)) #endif /* Don't bother defining or declaring wcstoimax and wcstoumax, since wide-character functions like this are hardly ever useful. */ #ifdef __cplusplus } #endif #endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */ genparse-0.9.1/gnulib/lib/xalloc-die.c0000644000076600001440000000245211673365613014501 00000000000000/* Report a memory allocation failure and exit. Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include "xalloc.h" #include #include "error.h" #include "exitfail.h" #include "gettext.h" #define _(msgid) gettext (msgid) void xalloc_die (void) { error (exit_failure, 0, "%s", _("memory exhausted")); /* The `noreturn' cannot be given to error, since it may return if its first argument is 0. To help compilers understand the xalloc_die does not return, call abort. Also, the abort is a safety feature if exit_failure is 0 (which shouldn't happen). */ abort (); } genparse-0.9.1/gnulib/lib/stdlib.in.h0000644000076600001440000002650411673365613014357 00000000000000/* A GNU-like . Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif #if defined __need_malloc_and_calloc /* Special invocation convention inside glibc header files. */ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ #else /* Normal invocation convention. */ #ifndef _GL_STDLIB_H /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ #ifndef _GL_STDLIB_H #define _GL_STDLIB_H /* Solaris declares getloadavg() in . */ #if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@ # include #endif #if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ # include #endif #if !@HAVE_STRUCT_RANDOM_DATA@ struct random_data { int32_t *fptr; /* Front pointer. */ int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ int rand_deg; /* Degree of random number generator. */ int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; #endif /* The definition of GL_LINK_WARNING is copied here. */ /* Some systems do not define EXIT_*, despite otherwise supporting C89. */ #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere with proper operation of xargs. */ #ifndef EXIT_FAILURE # define EXIT_FAILURE 1 #elif EXIT_FAILURE != 1 # undef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #ifdef __cplusplus extern "C" { #endif #if @GNULIB_MALLOC_POSIX@ # if !@HAVE_MALLOC_POSIX@ # undef malloc # define malloc rpl_malloc extern void * malloc (size_t size); # endif #elif defined GNULIB_POSIXCHECK # undef malloc # define malloc(s) \ (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ "use gnulib module malloc-posix for portability"), \ malloc (s)) #endif #if @GNULIB_REALLOC_POSIX@ # if !@HAVE_REALLOC_POSIX@ # undef realloc # define realloc rpl_realloc extern void * realloc (void *ptr, size_t size); # endif #elif defined GNULIB_POSIXCHECK # undef realloc # define realloc(p,s) \ (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ "use gnulib module realloc-posix for portability"), \ realloc (p, s)) #endif #if @GNULIB_CALLOC_POSIX@ # if !@HAVE_CALLOC_POSIX@ # undef calloc # define calloc rpl_calloc extern void * calloc (size_t nmemb, size_t size); # endif #elif defined GNULIB_POSIXCHECK # undef calloc # define calloc(n,s) \ (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \ "use gnulib module calloc-posix for portability"), \ calloc (n, s)) #endif #if @GNULIB_ATOLL@ # if !@HAVE_ATOLL@ /* Parse a signed decimal integer. Returns the value of the integer. Errors are not detected. */ extern long long atoll (const char *string); # endif #elif defined GNULIB_POSIXCHECK # undef atoll # define atoll(s) \ (GL_LINK_WARNING ("atoll is unportable - " \ "use gnulib module atoll for portability"), \ atoll (s)) #endif #if @GNULIB_GETLOADAVG@ # if !@HAVE_DECL_GETLOADAVG@ /* Store max(NELEM,3) load average numbers in LOADAVG[]. The three numbers are the load average of the last 1 minute, the last 5 minutes, and the last 15 minutes, respectively. LOADAVG is an array of NELEM numbers. */ extern int getloadavg (double loadavg[], int nelem); # endif #elif defined GNULIB_POSIXCHECK # undef getloadavg # define getloadavg(l,n) \ (GL_LINK_WARNING ("getloadavg is not portable - " \ "use gnulib module getloadavg for portability"), \ getloadavg (l, n)) #endif #if @GNULIB_GETSUBOPT@ /* Assuming *OPTIONP is a comma separated list of elements of the form "token" or "token=value", getsubopt parses the first of these elements. If the first element refers to a "token" that is member of the given NULL-terminated array of tokens: - It replaces the comma with a NUL byte, updates *OPTIONP to point past the first option and the comma, sets *VALUEP to the value of the element (or NULL if it doesn't contain an "=" sign), - It returns the index of the "token" in the given array of tokens. Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. For more details see the POSIX:2001 specification. http://www.opengroup.org/susv3xsh/getsubopt.html */ # if !@HAVE_GETSUBOPT@ extern int getsubopt (char **optionp, char *const *tokens, char **valuep); # endif #elif defined GNULIB_POSIXCHECK # undef getsubopt # define getsubopt(o,t,v) \ (GL_LINK_WARNING ("getsubopt is unportable - " \ "use gnulib module getsubopt for portability"), \ getsubopt (o, t, v)) #endif #if @GNULIB_MKDTEMP@ # if !@HAVE_MKDTEMP@ /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the directory name unique. Returns TEMPLATE, or a null pointer if it cannot get a unique name. The directory is created mode 700. */ extern char * mkdtemp (char * /*template*/); # endif #elif defined GNULIB_POSIXCHECK # undef mkdtemp # define mkdtemp(t) \ (GL_LINK_WARNING ("mkdtemp is unportable - " \ "use gnulib module mkdtemp for portability"), \ mkdtemp (t)) #endif #if @GNULIB_MKSTEMP@ # if @REPLACE_MKSTEMP@ /* Create a unique temporary file from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the file name unique. The file is then created, ensuring it didn't exist before. The file is created read-write (mask at least 0600 & ~umask), but it may be world-readable and world-writable (mask 0666 & ~umask), depending on the implementation. Returns the open file descriptor if successful, otherwise -1 and errno set. */ # define mkstemp rpl_mkstemp extern int mkstemp (char * /*template*/); # else /* On MacOS X 10.3, only declares mkstemp. */ # include # endif #elif defined GNULIB_POSIXCHECK # undef mkstemp # define mkstemp(t) \ (GL_LINK_WARNING ("mkstemp is unportable - " \ "use gnulib module mkstemp for portability"), \ mkstemp (t)) #endif #if @GNULIB_PUTENV@ # if @REPLACE_PUTENV@ # undef putenv # define putenv rpl_putenv extern int putenv (char *string); # endif #endif #if @GNULIB_RANDOM_R@ # if !@HAVE_RANDOM_R@ # ifndef RAND_MAX # define RAND_MAX 2147483647 # endif int srandom_r (unsigned int seed, struct random_data *rand_state); int initstate_r (unsigned int seed, char *buf, size_t buf_size, struct random_data *rand_state); int setstate_r (char *arg_state, struct random_data *rand_state); int random_r (struct random_data *buf, int32_t *result); # endif #elif defined GNULIB_POSIXCHECK # undef random_r # define random_r(b,r) \ (GL_LINK_WARNING ("random_r is unportable - " \ "use gnulib module random_r for portability"), \ random_r (b,r)) # undef initstate_r # define initstate_r(s,b,sz,r) \ (GL_LINK_WARNING ("initstate_r is unportable - " \ "use gnulib module random_r for portability"), \ initstate_r (s,b,sz,r)) # undef srandom_r # define srandom_r(s,r) \ (GL_LINK_WARNING ("srandom_r is unportable - " \ "use gnulib module random_r for portability"), \ srandom_r (s,r)) # undef setstate_r # define setstate_r(a,r) \ (GL_LINK_WARNING ("setstate_r is unportable - " \ "use gnulib module random_r for portability"), \ setstate_r (a,r)) #endif #if @GNULIB_RPMATCH@ # if !@HAVE_RPMATCH@ /* Test a user response to a question. Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ extern int rpmatch (const char *response); # endif #elif defined GNULIB_POSIXCHECK # undef rpmatch # define rpmatch(r) \ (GL_LINK_WARNING ("rpmatch is unportable - " \ "use gnulib module rpmatch for portability"), \ rpmatch (r)) #endif #if @GNULIB_SETENV@ # if !@HAVE_SETENV@ /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ extern int setenv (const char *name, const char *value, int replace); # endif #endif #if @GNULIB_UNSETENV@ # if @HAVE_UNSETENV@ # if @VOID_UNSETENV@ /* On some systems, unsetenv() returns void. This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ # define unsetenv(name) ((unsetenv)(name), 0) # endif # else /* Remove the variable NAME from the environment. */ extern int unsetenv (const char *name); # endif #endif #if @GNULIB_STRTOD@ # if @REPLACE_STRTOD@ # define strtod rpl_strtod # endif # if !@HAVE_STRTOD@ || @REPLACE_STRTOD@ /* Parse a double from STRING, updating ENDP if appropriate. */ extern double strtod (const char *str, char **endp); # endif #elif defined GNULIB_POSIXCHECK # undef strtod # define strtod(s, e) \ (GL_LINK_WARNING ("strtod is unportable - " \ "use gnulib module strtod for portability"), \ strtod (s, e)) #endif #if @GNULIB_STRTOLL@ # if !@HAVE_STRTOLL@ /* Parse a signed integer whose textual representation starts at STRING. The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, it may be decimal or octal (with prefix "0") or hexadecimal (with prefix "0x"). If ENDPTR is not NULL, the address of the first byte after the integer is stored in *ENDPTR. Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set to ERANGE. */ extern long long strtoll (const char *string, char **endptr, int base); # endif #elif defined GNULIB_POSIXCHECK # undef strtoll # define strtoll(s,e,b) \ (GL_LINK_WARNING ("strtoll is unportable - " \ "use gnulib module strtoll for portability"), \ strtoll (s, e, b)) #endif #if @GNULIB_STRTOULL@ # if !@HAVE_STRTOULL@ /* Parse an unsigned integer whose textual representation starts at STRING. The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, it may be decimal or octal (with prefix "0") or hexadecimal (with prefix "0x"). If ENDPTR is not NULL, the address of the first byte after the integer is stored in *ENDPTR. Upon overflow, the return value is ULLONG_MAX, and errno is set to ERANGE. */ extern unsigned long long strtoull (const char *string, char **endptr, int base); # endif #elif defined GNULIB_POSIXCHECK # undef strtoull # define strtoull(s,e,b) \ (GL_LINK_WARNING ("strtoull is unportable - " \ "use gnulib module strtoull for portability"), \ strtoull (s, e, b)) #endif #ifdef __cplusplus } #endif #endif /* _GL_STDLIB_H */ #endif /* _GL_STDLIB_H */ #endif genparse-0.9.1/gnulib/lib/error.h0000644000076600001440000000455111673365613013620 00000000000000/* Declaration for error-reporting function Copyright (C) 1995, 1996, 1997, 2003, 2006, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _ERROR_H #define _ERROR_H 1 #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ extern void error (int __status, int __errnum, const char *__format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __lineno, const char *__format, ...) __attribute__ ((__format__ (__printf__, 5, 6))); /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ extern void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ extern unsigned int error_message_count; /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ extern int error_one_per_line; #ifdef __cplusplus } #endif #endif /* error.h */ genparse-0.9.1/gnulib/lib/getopt.c0000644000076600001440000007642611673365613013776 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _LIBC # include #endif #include "getopt.h" #include #include #include #include #ifdef _LIBC # include #else # include "gettext.h" # define _(msgid) gettext (msgid) #endif #if defined _LIBC && defined USE_IN_LIBIO # include #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Unlike standard Unix `getopt', functions like `getopt_long' let the user intersperse the options with the other arguments. As `getopt_long' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Using `getopt' or setting the environment variable POSIXLY_CORRECT disables permutation. Then the application's behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt_int.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Keep a global copy of all internal members of getopt_data. */ static struct _getopt_data getopt_data; #if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV extern char *getenv (); #endif #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (d->__nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv, struct _getopt_data *d) { int bottom = d->__first_nonopt; int middle = d->__last_nonopt; int top = d->optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, d->__nonoption_flags_max_len), '\0', top + 1 - d->__nonoption_flags_max_len); d->__nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ d->__first_nonopt += (d->optind - d->__last_nonopt); d->__last_nonopt = d->optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (int argc, char **argv, const char *optstring, int posixly_correct, struct _getopt_data *d) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ d->__first_nonopt = d->__last_nonopt = d->optind; d->__nextchar = NULL; d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { d->__ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { d->__ordering = REQUIRE_ORDER; ++optstring; } else if (d->__posixly_correct) d->__ordering = REQUIRE_ORDER; else d->__ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (!d->__posixly_correct && argc == __libc_argc && argv == __libc_argv) { if (d->__nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') d->__nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = d->__nonoption_flags_max_len = strlen (orig_str); if (d->__nonoption_flags_max_len < argc) d->__nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (d->__nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) d->__nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', d->__nonoption_flags_max_len - len); } } d->__nonoption_flags_len = d->__nonoption_flags_max_len; } else d->__nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT environment variable were set. */ int _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct, struct _getopt_data *d) { int print_errors = d->opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; d->optarg = NULL; if (d->optind == 0 || !d->__initialized) { if (d->optind == 0) d->optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring, posixly_correct, d); d->__initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ || (d->optind < d->__nonoption_flags_len \ && __getopt_nonoption_flags[d->optind] == '1')) #else # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') #endif if (d->__nextchar == NULL || *d->__nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (d->__last_nonopt > d->optind) d->__last_nonopt = d->optind; if (d->__first_nonopt > d->optind) d->__first_nonopt = d->optind; if (d->__ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__last_nonopt != d->optind) d->__first_nonopt = d->optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (d->optind < argc && NONOPTION_P) d->optind++; d->__last_nonopt = d->optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (d->optind != argc && !strcmp (argv[d->optind], "--")) { d->optind++; if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__first_nonopt == d->__last_nonopt) d->__first_nonopt = d->optind; d->__last_nonopt = argc; d->optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (d->optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (d->__first_nonopt != d->__last_nonopt) d->optind = d->__first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (d->__ordering == REQUIRE_ORDER) return -1; d->optarg = argv[d->optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ d->__nextchar = (argv[d->optind] + 1 + (longopts != NULL && argv[d->optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[d->optind][1] == '-' || (long_only && (argv[d->optind][2] || !strchr (optstring, argv[d->optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; d->optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; d->optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[d->optind][1] == '-' || strchr (optstring, *d->__nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar = (char *) ""; d->optind++; d->optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *d->__nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*d->__nextchar == '\0') ++d->optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (d->__posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `d->optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } d->__nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; d->optind++; } else d->optarg = NULL; d->__nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; d->__nextchar = NULL; } } return c; } } int _getopt_internal (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct) { int result; getopt_data.optind = optind; getopt_data.opterr = opterr; result = _getopt_internal_r (argc, argv, optstring, longopts, longind, long_only, posixly_correct, &getopt_data); optind = getopt_data.optind; optarg = getopt_data.optarg; optopt = getopt_data.optopt; return result; } /* glibc gets a LSB-compliant getopt. Standalone applications get a POSIX-compliant getopt. */ #if _LIBC enum { POSIXLY_CORRECT = 0 }; #else enum { POSIXLY_CORRECT = 1 }; #endif int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, POSIXLY_CORRECT); } #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ genparse-0.9.1/gnulib/lib/getopt.in.h0000644000076600001440000001751611673365613014403 00000000000000/* Declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an identifier that prefixes the external functions and variables defined in this header. When this happens, include the headers that might declare getopt so that they will not cause confusion if included after this file. Then systematically rename identifiers so that they do not collide with the system functions and variables. Renaming avoids problems with some compilers and linkers. */ #if defined __GETOPT_PREFIX && !defined __need_getopt # include # include # include # undef __need_getopt # undef getopt # undef getopt_long # undef getopt_long_only # undef optarg # undef opterr # undef optind # undef optopt # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) # define getopt __GETOPT_ID (getopt) # define getopt_long __GETOPT_ID (getopt_long) # define getopt_long_only __GETOPT_ID (getopt_long_only) # define optarg __GETOPT_ID (optarg) # define opterr __GETOPT_ID (opterr) # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) #endif /* Standalone applications get correct prototypes for getopt_long and getopt_long_only; they declare "char **argv". libc uses prototypes with "char *const *argv" that are incorrect because getopt_long and getopt_long_only can permute argv; this is required for backward compatibility (e.g., for LSB 2.0.1). This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', but it caused redefinition warnings if both unistd.h and getopt.h were included, since unistd.h includes getopt.h having previously defined __need_getopt. The only place where __getopt_argv_const is used is in definitions of getopt_long and getopt_long_only below, but these are visible only if __need_getopt is not defined, so it is quite safe to rewrite the conditional as follows: */ #if !defined __need_getopt # if defined __GETOPT_PREFIX # define __getopt_argv_const /* empty */ # else # define __getopt_argv_const const # endif #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `-', then non-option arguments are treated as arguments to the option '\1'. This behavior is specific to the GNU `getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in the environment, then do not permute arguments. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; #ifndef __need_getopt extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ genparse-0.9.1/gnulib/lib/Makefile.in0000644000076600001440000013171111732677151014361 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002-2008 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-libtool --macro-prefix=gl c-strtod getopt xstrtod xstrtoimax xstrtol xstrtoumax VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = gnulib/lib DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libgnu_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = am_libgnu_a_OBJECTS = xalloc-die.$(OBJEXT) xstrtoimax.$(OBJEXT) \ xstrtoumax.$(OBJEXT) libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ AUTOMAKE_OPTIONS = 1.5 gnits SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = libgnu.a noinst_LTLIBRARIES = EXTRA_DIST = c-strtod.c c-strtod.h errno.in.h error.c error.h \ exitfail.c exitfail.h getopt.c getopt.in.h getopt1.c \ getopt_int.h intprops.h inttypes.in.h \ $(top_srcdir)/./link-warning.h stdbool.in.h stdint.in.h \ stdlib.in.h strerror.c string.in.h strtoimax.c strtol.c \ strtoll.c strtoul.c strtoull.c strtoumax.c unistd.in.h \ wchar.in.h xalloc.h xmalloc.c xstrtod.c xstrtod.h \ xstrtol-error.c xstrtol.c xstrtol.h xstrtoul.c BUILT_SOURCES = $(ERRNO_H) $(GETOPT_H) $(INTTYPES_H) $(STDBOOL_H) \ $(STDINT_H) stdlib.h string.h unistd.h $(WCHAR_H) SUFFIXES = MOSTLYCLEANFILES = core *.stackdump errno.h errno.h-t getopt.h \ getopt.h-t inttypes.h inttypes.h-t stdbool.h stdbool.h-t \ stdint.h stdint.h-t stdlib.h stdlib.h-t string.h string.h-t \ unistd.h unistd.h-t wchar.h wchar.h-t MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = libgnu_a_SOURCES = gettext.h verify.h xalloc-die.c xstrtoimax.c \ xstrtoumax.c libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libgnu_a_SOURCES = c-strtod.c error.c exitfail.c getopt.c \ getopt1.c strerror.c strtoimax.c strtol.c strtoll.c strtoul.c \ strtoull.c strtoumax.c xmalloc.c xstrtod.c xstrtol-error.c \ xstrtol.c xstrtoul.c LINK_WARNING_H = $(top_srcdir)/./link-warning.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits gnulib/lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnits gnulib/lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libgnu.a: $(libgnu_a_OBJECTS) $(libgnu_a_DEPENDENCIES) -rm -f libgnu.a $(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD) $(RANLIB) libgnu.a clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strtod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoull.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoumax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoimax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoul.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrtoumax.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-local pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES clean-noinstLTLIBRARIES ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-local pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # We need the following in order to create when the system # doesn't have one that is POSIX compliant. errno.h: errno.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ < $(srcdir)/errno.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/getopt.in.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. inttypes.h: inttypes.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/inttypes.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ < $(srcdir)/stdint.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \ -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \ -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \ -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \ -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/stdlib.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \ -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \ -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \ -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \ -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \ -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \ -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \ -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \ -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \ -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \ -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \ -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \ -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \ -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \ -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \ -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \ -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \ -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \ -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/string.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # version does not work standalone. wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ if test -n "$$dir" && test -d $$dir; then \ echo "rmdir $$dir"; rmdir $$dir; \ fi; \ done; \ : # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/gnulib/lib/stdbool.in.h0000644000076600001440000001145211673365613014540 00000000000000/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_STDBOOL_H #define _GL_STDBOOL_H /* ISO C 99 for platforms that lack it. */ /* Usage suggestions: Programs that use should be aware of some limitations and standards compliance issues. Standards compliance: - must be #included before 'bool', 'false', 'true' can be used. - You cannot assume that sizeof (bool) == 1. - Programs should not undefine the macros bool, true, and false, as C99 lists that as an "obsolescent feature". Limitations of this substitute, when used in a C89 environment: - must be #included before the '_Bool' type can be used. - You cannot assume that _Bool is a typedef; it might be a macro. - Bit-fields of type 'bool' are not supported. Portable code should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. - In C99, casts and automatic conversions to '_Bool' or 'bool' are performed in such a way that every nonzero value gets converted to 'true', and zero gets converted to 'false'. This doesn't work with this substitute. With this substitute, only the values 0 and 1 give the expected result when converted to _Bool' or 'bool'. Also, it is suggested that programs use 'bool' rather than '_Bool'; this isn't required, but 'bool' is more common. */ /* 7.16. Boolean type and values */ /* BeOS already #defines false 0, true 1. We use the same definitions below, but temporarily we have to #undef them. */ #if defined __BEOS__ && !defined __HAIKU__ # include /* defines bool but not _Bool */ # undef false # undef true #endif /* For the sake of symbolic names in gdb, we define true and false as enum constants, not only as macros. It is tempting to write typedef enum { false = 0, true = 1 } _Bool; so that gdb prints values of type 'bool' symbolically. But if we do this, values of type '_Bool' may promote to 'int' or 'unsigned int' (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the enum; this ensures that '_Bool' promotes to 'int'. */ #if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__) /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ # if !@HAVE__BOOL@ typedef bool _Bool; # endif #else # if !defined __GNUC__ /* If @HAVE__BOOL@: Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when the built-in _Bool type is used. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html Similar bugs are likely with other compilers as well; this file wouldn't be used if was working. So we override the _Bool type. If !@HAVE__BOOL@: Need to define _Bool ourselves. As 'signed char' or as an enum type? Use of a typedef, with SunPRO C, leads to a stupid "warning: _Bool is a keyword in ISO C99". Use of an enum type, with IRIX cc, leads to a stupid "warning(1185): enumerated type mixed with another type". Even the existence of an enum type, without a typedef, "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. The only benefit of the enum, debuggability, is not important with these compilers. So use 'signed char' and no enum. */ # define _Bool signed char # else /* With this compiler, trust the _Bool type if the compiler has it. */ # if !@HAVE__BOOL@ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; # endif # endif #endif #define bool _Bool /* The other macros must be usable in preprocessor directives. */ #define false 0 #define true 1 #define __bool_true_false_are_defined 1 #endif /* _GL_STDBOOL_H */ genparse-0.9.1/gnulib/m4/0000777000076600001440000000000011732700533012135 500000000000000genparse-0.9.1/gnulib/m4/stdbool.m40000644000076600001440000000722211673365613013776 00000000000000# Check for stdbool.h that conforms to C99. dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Prepare for substituting if it is not supported. AC_DEFUN([AM_STDBOOL_H], [ AC_REQUIRE([AC_HEADER_STDBOOL]) # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi AC_SUBST([HAVE__BOOL]) ]) # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) # This macro is only needed in autoconf <= 2.59. Newer versions of autoconf # have this macro built-in. AC_DEFUN([AC_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], [AC_TRY_COMPILE( [ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; #if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a run-time test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); #endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; ], [ *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) fi]) genparse-0.9.1/gnulib/m4/errno_h.m40000644000076600001440000000546611667215657014001 00000000000000# errno_h.m4 serial 1 dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_HEADER_ERRNO_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_HEADER_ERRNO_H_BODY]) ]) AC_DEFUN([gl_HEADER_ERRNO_H_BODY], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [ AC_EGREP_CPP(booboo,[ #include #if !defined ENOMSG booboo #endif #if !defined EIDRM booboo #endif #if !defined ENOLINK booboo #endif #if !defined EPROTO booboo #endif #if !defined EMULTIHOP booboo #endif #if !defined EBADMSG booboo #endif #if !defined EOVERFLOW booboo #endif #if !defined ENOTSUP booboo #endif #if !defined ECANCELED booboo #endif ], [gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=yes]) ]) if test $gl_cv_header_errno_h_complete = yes; then ERRNO_H='' else gl_CHECK_NEXT_HEADERS([errno.h]) ERRNO_H='errno.h' fi AC_SUBST([ERRNO_H]) gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) gl_REPLACE_ERRNO_VALUE([ENOLINK]) gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) ]) # Assuming $1 = EOVERFLOW. # The EOVERFLOW errno value ought to be defined in , according to # POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and # some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. # Check for the value of EOVERFLOW. # Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE. AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ if test -n "$ERRNO_H"; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ AC_EGREP_CPP(yes,[ #include #ifdef ]$1[ yes #endif ], [gl_cv_header_errno_h_]$1[=yes], [gl_cv_header_errno_h_]$1[=no]) if test $gl_cv_header_errno_h_]$1[ = no; then AC_EGREP_CPP(yes,[ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef ]$1[ yes #endif ], [gl_cv_header_errno_h_]$1[=hidden]) if test $gl_cv_header_errno_h_]$1[ = hidden; then dnl The macro exists but is hidden. dnl Define it to the same value. AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include ]) fi fi ]) case $gl_cv_header_errno_h_]$1[ in yes | no) ]$1[_HIDDEN=0; ]$1[_VALUE= ;; *) ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1[" ;; esac AC_SUBST($1[_HIDDEN]) AC_SUBST($1[_VALUE]) fi ]) genparse-0.9.1/gnulib/m4/gnulib-common.m40000644000076600001440000000747111667215657015111 00000000000000# gnulib-common.m4 serial 6 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # gl_COMMON # is expanded unconditionally through gnulib-tool magic. AC_DEFUN([gl_COMMON], [ dnl Use AC_REQUIRE here, so that the code is expanded once only. AC_REQUIRE([gl_COMMON_BODY]) ]) AC_DEFUN([gl_COMMON_BODY], [ AH_VERBATIM([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. __APPLE__ && __MACH__ test for MacOS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) AH_VERBATIM([unused_parameter], [/* Define as a marker that can be attached to function parameter declarations for parameters that are not used. This helps to reduce warnings, such as from GCC -Wunused-parameter. */ #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) # define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) #else # define _UNUSED_PARAMETER_ #endif ]) ]) # gl_MODULE_INDICATOR([modulename]) # defines a C macro indicating the presence of the given module. AC_DEFUN([gl_MODULE_INDICATOR], [ AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], [Define to 1 when using the gnulib module ]$1[.]) ]) # m4_foreach_w # is a backport of autoconf-2.59c's m4_foreach_w. # Remove this macro when we can assume autoconf >= 2.60. m4_ifndef([m4_foreach_w], [m4_define([m4_foreach_w], [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) # AC_PROG_MKDIR_P # is a backport of autoconf-2.60's AC_PROG_MKDIR_P. # Remove this macro when we can assume autoconf >= 2.60. m4_ifdef([AC_PROG_MKDIR_P], [], [ AC_DEFUN([AC_PROG_MKDIR_P], [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake MKDIR_P='$(mkdir_p)' AC_SUBST([MKDIR_P])])]) # AC_C_RESTRICT # This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61, # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[typedef int * int_ptr; int foo (int_ptr $ac_kw ip) { return ip[0]; }]], [[int s[1]; int * $ac_kw t = s; t[0] = 0; return foo(t)]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done ]) AH_VERBATIM([restrict], [/* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Work around a bug in Sun C++: it does not support _Restrict, even though the corresponding Sun C compiler does, which causes "#define restrict _Restrict" in the previous line. Perhaps some future version of Sun C++ will work with _Restrict; if so, it'll probably define __RESTRICT, just as Sun C does. */ #if defined __SUNPRO_CC && !defined __RESTRICT # define _Restrict #endif]) case $ac_cv_c_restrict in restrict) ;; no) AC_DEFINE([restrict], []) ;; *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) genparse-0.9.1/gnulib/m4/getopt.m40000644000076600001440000000470311673365613013633 00000000000000# getopt.m4 serial 14 dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # The getopt module assume you want GNU getopt, with getopt_long etc, # rather than vanilla POSIX getopt. This means your code should # always include for the getopt prototypes. AC_DEFUN([gl_GETOPT_SUBSTITUTE], [ AC_LIBOBJ([getopt]) AC_LIBOBJ([getopt1]) gl_GETOPT_SUBSTITUTE_HEADER gl_PREREQ_GETOPT ]) AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ GETOPT_H=getopt.h AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement functions and variables should be used.]) AC_SUBST([GETOPT_H]) ]) AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ if test -z "$GETOPT_H"; then AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) fi if test -z "$GETOPT_H"; then AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) fi dnl BSD getopt_long uses an incompatible method to reset option processing, dnl and (as of 2004-10-15) mishandles optional option-arguments. if test -z "$GETOPT_H"; then AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) fi dnl Solaris 10 getopt doesn't handle `+' as a leading character in an dnl option string (as of 2005-05-05). if test -z "$GETOPT_H"; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[ char *myargv[3]; myargv[0] = "conftest"; myargv[1] = "-+"; myargv[2] = 0; return getopt (2, myargv, "+a") != '?'; ]])], [gl_cv_func_gnu_getopt=yes], [gl_cv_func_gnu_getopt=no], [dnl cross compiling - pessimistically guess based on decls dnl Solaris 10 getopt doesn't handle `+' as a leading character in an dnl option string (as of 2005-05-05). AC_CHECK_DECL([getopt_clip], [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], [#include ])])]) if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi ]) AC_DEFUN([gl_GETOPT_IFELSE], [ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) AS_IF([test -n "$GETOPT_H"], [$1], [$2]) ]) AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) # Prerequisites of lib/getopt*. AC_DEFUN([gl_PREREQ_GETOPT], [ AC_CHECK_DECLS_ONCE([getenv]) ]) genparse-0.9.1/gnulib/m4/inline.m40000644000076600001440000000313711673365613013607 00000000000000# inline.m4 serial 3 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Test for the 'inline' keyword or equivalent. dnl Define 'inline' to a supported equivalent, or to nothing if not supported, dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an dnl equivalent is effectively supported, i.e. if the compiler is likely to dnl drop unused 'static inline' functions. AC_DEFUN([gl_INLINE], [ AC_REQUIRE([AC_C_INLINE]) AC_CACHE_CHECK([whether the compiler generally respects inline], [gl_cv_c_inline_effective], [if test $ac_cv_c_inline = no; then gl_cv_c_inline_effective=no else dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is dnl specified. dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result dnl depends on optimization flags, which can be in CFLAGS. dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[#ifdef __NO_INLINE__ #error "inline is not effective" #endif]])], [gl_cv_c_inline_effective=yes], [gl_cv_c_inline_effective=no]) fi ]) if test $gl_cv_c_inline_effective = yes; then AC_DEFINE([HAVE_INLINE], 1, [Define to 1 if the compiler supports one of the keywords 'inline', '__inline__', '__inline' and effectively inlines functions marked as such.]) fi ]) genparse-0.9.1/gnulib/m4/inttypes.m40000644000076600001440000002204211673365613014204 00000000000000# inttypes.m4 serial 12 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Derek Price, Bruno Haible. dnl Test whether is supported or must be substituted. AC_DEFUN([gl_INTTYPES_H], [ AC_REQUIRE([gl_STDINT_H]) AC_REQUIRE([gt_INTTYPES_PRI]) AC_CHECK_DECLS_ONCE([imaxabs]) AC_CHECK_DECLS_ONCE([imaxdiv]) AC_CHECK_DECLS_ONCE([strtoimax]) AC_CHECK_DECLS_ONCE([strtoumax]) dnl Now see if we need a substitute . dnl A complete requires dnl - a complete , dnl - the existence of an , dnl - that imaxabs, imaxdiv, strtoimax, strtoumax are declared, dnl - some additional tests. AC_CACHE_CHECK([whether inttypes.h conforms to C99], [gl_cv_header_working_inttypes_h], [gl_cv_header_working_inttypes_h=no if test "$gl_cv_header_working_stdint_h" = yes \ && test $ac_cv_header_inttypes_h = yes \ && test "$ac_cv_have_decl_imaxabs" = yes \ && test "$ac_cv_have_decl_imaxdiv" = yes \ && test "$ac_cv_have_decl_strtoimax" = yes \ && test "$ac_cv_have_decl_strtoumax" = yes; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* work if build isn't clean */ #include /* No need to duplicate the tests of stdint.m4; they are subsumed by $gl_cv_header_working_stdint_h = yes. */ /* Tests for macros supposed to be defined in inttypes.h. */ const char *k = /* implicit string concatenation */ #ifdef INT8_MAX PRId8 PRIi8 #endif #ifdef UINT8_MAX PRIo8 PRIu8 PRIx8 PRIX8 #endif #ifdef INT16_MAX PRId16 PRIi16 #endif #ifdef UINT16_MAX PRIo16 PRIu16 PRIx16 PRIX16 #endif #ifdef INT32_MAX PRId32 PRIi32 #endif #ifdef UINT32_MAX PRIo32 PRIu32 PRIx32 PRIX32 #endif #ifdef INT64_MAX PRId64 PRIi64 #endif #ifdef UINT64_MAX PRIo64 PRIu64 PRIx64 PRIX64 #endif PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 PRIdLEAST64 PRIiLEAST64 PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 PRIdFAST64 PRIiFAST64 PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX #ifdef INTPTR_MAX PRIdPTR PRIiPTR #endif #ifdef UINTPTR_MAX PRIoPTR PRIuPTR PRIxPTR PRIXPTR #endif ; const char *l = /* implicit string concatenation */ #ifdef INT8_MAX SCNd8 SCNi8 #endif #ifdef UINT8_MAX SCNo8 SCNu8 SCNx8 #endif #ifdef INT16_MAX SCNd16 SCNi16 #endif #ifdef UINT16_MAX SCNo16 SCNu16 SCNx16 #endif #ifdef INT32_MAX SCNd32 SCNi32 #endif #ifdef UINT32_MAX SCNo32 SCNu32 SCNx32 #endif #ifdef INT64_MAX SCNd64 SCNi64 #endif #ifdef UINT64_MAX SCNo64 SCNu64 SCNx64 #endif SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 SCNdLEAST64 SCNiLEAST64 SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 SCNdFAST64 SCNiFAST64 SCNoFAST64 SCNuFAST64 SCNxFAST64 SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX #ifdef INTPTR_MAX SCNdPTR SCNiPTR #endif #ifdef UINTPTR_MAX SCNoPTR SCNuPTR SCNxPTR #endif ; ]])], [gl_cv_header_working_inttypes_h=yes]) fi]) dnl Override always, so that the portability warnings work. if false && test $gl_cv_header_working_inttypes_h = yes; then dnl Use the existing . INTTYPES_H='' else AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([inttypes.h]) dnl Ensure that defines the limit macros, since gnulib's dnl relies on them. This macro is only needed when a dnl C++ compiler is in use; it has no effect for a C compiler. dnl Also be careful to define __STDC_LIMIT_MACROS only when gnulib's dnl is going to be created, and to avoid redefinition warnings dnl if the __STDC_LIMIT_MACROS is already defined through the CPPFLAGS. AC_DEFINE([GL_TRIGGER_STDC_LIMIT_MACROS], 1, [Define to make the limit macros in visible.]) AH_VERBATIM([__STDC_LIMIT_MACROS_ZZZ], [/* Ensure that defines the limit macros, since gnulib's relies on them. */ #if defined __cplusplus && !defined __STDC_LIMIT_MACROS && GL_TRIGGER_STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS 1 #endif ]) PRIPTR_PREFIX= if test -n "$STDINT_H"; then dnl Using the gnulib . It always defines intptr_t to 'long'. PRIPTR_PREFIX='"l"' else dnl Using the system's . for glpfx in '' l ll I64; do case $glpfx in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; I64) gltype1='__int64';; esac AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include extern intptr_t foo; extern $gltype1 foo;]])], [PRIPTR_PREFIX='"'$glpfx'"']) test -n "$PRIPTR_PREFIX" && break done fi AC_SUBST([PRIPTR_PREFIX]) if test "$ac_cv_have_decl_imaxabs" = yes; then HAVE_DECL_IMAXABS=1 else HAVE_DECL_IMAXABS=0 fi if test "$ac_cv_have_decl_imaxdiv" = yes; then HAVE_DECL_IMAXDIV=1 else HAVE_DECL_IMAXDIV=0 fi if test "$ac_cv_have_decl_strtoimax" = yes; then HAVE_DECL_STRTOIMAX=1 else HAVE_DECL_STRTOIMAX=0 fi if test "$ac_cv_have_decl_strtoumax" = yes; then HAVE_DECL_STRTOUMAX=1 else HAVE_DECL_STRTOUMAX=0 fi gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [INT32_MAX_LT_INTMAX_MAX], [defined INT32_MAX && defined INTMAX_MAX], [INT32_MAX < INTMAX_MAX], [sizeof (int) < sizeof (long long int)]) gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [INT64_MAX_EQ_LONG_MAX], [defined INT64_MAX], [INT64_MAX == LONG_MAX], [sizeof (long long int) == sizeof (long int)]) gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [UINT32_MAX_LT_UINTMAX_MAX], [defined UINT32_MAX && defined UINTMAX_MAX], [UINT32_MAX < UINTMAX_MAX], [sizeof (unsigned int) < sizeof (unsigned long long int)]) gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [UINT64_MAX_EQ_ULONG_MAX], [defined UINT64_MAX], [UINT64_MAX == ULONG_MAX], [sizeof (unsigned long long int) == sizeof (unsigned long int)]) INTTYPES_H='inttypes.h' fi AC_SUBST(INTTYPES_H) ]) # Define the symbol $1 to be 1 if the condition is true, 0 otherwise. # If $2 is true, the condition is $3; otherwise if long long int is supported # approximate the condition with $4; otherwise, assume the condition is false. # The condition should work on all C99 platforms; the approximations should be # good enough to work on all practical pre-C99 platforms. # $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants. AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], [ AC_CACHE_CHECK([whether $3], [gl_cv_test_$1], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[/* Work also in C++ mode. */ #define __STDC_LIMIT_MACROS 1 /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H #include #if HAVE_STDINT_H #include #endif #if $2 #define CONDITION ($3) #elif HAVE_LONG_LONG_INT #define CONDITION ($4) #else #define CONDITION 0 #endif int test[CONDITION ? 1 : -1];]])], [gl_cv_test_$1=yes], [gl_cv_test_$1=no])]) if test $gl_cv_test_$1 = yes; then $1=1; else $1=0; fi AC_SUBST([$1]) ]) AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) AC_DEFUN([gl_INTTYPES_H_DEFAULTS], [ GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS]) GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV]) GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX]) GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS]) HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) ]) genparse-0.9.1/gnulib/m4/strtoll.m40000644000076600001440000000137111673365613014032 00000000000000# strtoll.m4 serial 5 dnl Copyright (C) 2002, 2004, 2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOLL], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) dnl We don't need (and can't compile) the replacement strtoll dnl unless the type 'long long int' exists. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test "$ac_cv_type_long_long_int" = yes; then AC_REPLACE_FUNCS(strtoll) if test $ac_cv_func_strtoll = no; then HAVE_STRTOLL=0 gl_PREREQ_STRTOLL fi fi ]) # Prerequisites of lib/strtoll.c. AC_DEFUN([gl_PREREQ_STRTOLL], [ : ]) genparse-0.9.1/gnulib/m4/xstrtod.m40000644000076600001440000000070311673365613014034 00000000000000#serial 6 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Prerequisites of lib/xstrtod.c. AC_DEFUN([gl_XSTRTOD], [ AC_LIBOBJ([xstrtod]) ]) # Prerequisites of lib/xstrtold.c. AC_DEFUN([gl_XSTRTOLD], [ AC_LIBOBJ([xstrtold]) ]) genparse-0.9.1/gnulib/m4/wint_t.m40000644000076600001440000000170711667215657013643 00000000000000# wint_t.m4 serial 2 (gettext-0.17) dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #include #include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) genparse-0.9.1/gnulib/m4/longlong.m40000644000076600001440000001010111673365613014135 00000000000000# longlong.m4 serial 13 dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. # This fixes a bug in Autoconf 2.61, but can be removed once we # assume 2.62 everywhere. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be # defined. In this case you can treat 'long long int' like 'long int'. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. dnl If cross compiling, assume the bug isn't important, since dnl nobody cross compiles for this platform as far as we know. AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[@%:@include @%:@ifndef LLONG_MAX @%:@ define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) @%:@ define LLONG_MAX (HALF - 1 + HALF) @%:@endif]], [[long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0;]])], [ac_cv_type_long_long_int=yes], [ac_cv_type_long_long_int=no], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], 1, [Define to 1 if the system has the type `long long int'.]) fi ]) # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # This fixes a bug in Autoconf 2.61, but can be removed once we # assume 2.62 everywhere. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # will not be defined. In this case you can treat 'unsigned long long int' # like 'unsigned long int'. AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) # Expands to a C program that can be used to test for simultaneous support # of 'long long' and 'unsigned long long'. We don't want to say that # 'long long' is available if 'unsigned long long' is not, or vice versa, # because too many programs rely on the symmetry between signed and unsigned # integer types (excluding 'bool'). AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], [ AC_LANG_PROGRAM( [[/* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63;]], [[/* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull));]]) ]) genparse-0.9.1/gnulib/m4/extensions.m40000644000076600001440000000561111673365613014527 00000000000000# serial 5 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS # Autoconf. Perhaps we can remove this once we can assume Autoconf # 2.62 or later everywhere, but since CVS Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. # Remember that #undef in AH_VERBATIM gets replaced with #define by # AC_DEFINE. The goal here is to define all known feature-enabling # macros, then, if reports of conflicts are made, disable macros that # cause problems on some platforms (such as __EXTENSIONS__). AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) if test "$MINIX" = yes; then AC_DEFINE([_POSIX_SOURCE], [1], [Define to 1 if you need to in order for `stat' and other things to work.]) AC_DEFINE([_POSIX_1_SOURCE], [2], [Define to 2 if the system does not provide POSIX.1 features except with this defined.]) AC_DEFINE([_MINIX], [1], [Define to 1 if on MINIX.]) fi AH_VERBATIM([__EXTENSIONS__], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif ]) AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ # define __EXTENSIONS__ 1 ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([_TANDEM_SOURCE]) ])# AC_USE_SYSTEM_EXTENSIONS # gl_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) genparse-0.9.1/gnulib/m4/strtoul.m40000644000076600001440000000052211673365613014040 00000000000000# strtoul.m4 serial 3 dnl Copyright (C) 2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOUL], [ AC_REPLACE_FUNCS(strtoul) ]) genparse-0.9.1/gnulib/m4/exitfail.m40000644000076600001440000000060611673365613014134 00000000000000# exitfail.m4 serial 6 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EXITFAIL], [ AC_LIBOBJ([exitfail]) dnl No prerequisites of lib/exitfail.c. : ]) genparse-0.9.1/gnulib/m4/gnulib-comp.m40000644000076600001440000002046611673365613014551 00000000000000# DO NOT EDIT! GENERATED AUTOMATICALLY! # Copyright (C) 2002-2008 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the compiled summary of the specification in # gnulib-cache.m4. It lists the computed macro invocations that need # to be invoked from configure.ac. # In projects using CVS, this file can be treated like other built files. # This macro should be invoked from ./configure.ac, in the section # "Checks for programs", right after AC_PROG_CC, and certainly before # any checks for libraries, header files, types and library functions. AC_DEFUN([gl_EARLY], [ m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable AC_REQUIRE([AC_PROG_RANLIB]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) ]) # This macro should be invoked from ./configure.ac, in the section # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) gl_cond_libtool=false gl_libdeps= gl_ltlibdeps= m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) m4_pushdef([gl_LIBSOURCES_LIST], []) m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gnulib/lib' gl_C_STRTOD gl_HEADER_ERRNO_H gl_ERROR m4_ifdef([AM_XGETTEXT_OPTION], [AM_XGETTEXT_OPTION([--flag=error:3:c-format]) AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) gl_EXITFAIL gl_GETOPT AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_INLINE gl_INTTYPES_H AM_STDBOOL_H gl_STDINT_H gl_STDLIB_H gl_FUNC_STRERROR gl_STRING_MODULE_INDICATOR([strerror]) gl_HEADER_STRING_H gl_FUNC_STRTOIMAX gl_INTTYPES_MODULE_INDICATOR([strtoimax]) gl_FUNC_STRTOL gl_FUNC_STRTOLL gl_STDLIB_MODULE_INDICATOR([strtoll]) gl_FUNC_STRTOUL gl_FUNC_STRTOULL gl_STDLIB_MODULE_INDICATOR([strtoull]) gl_FUNC_STRTOUMAX gl_INTTYPES_MODULE_INDICATOR([strtoumax]) gl_UNISTD_H gl_WCHAR_H gl_XALLOC gl_XSTRTOD gl_XSTRTOL m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || for gl_file in ]gl_LIBSOURCES_LIST[ ; do if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2 exit 1 fi done])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) m4_popdef([gl_LIBSOURCES_DIR]) m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gl_libobjs= gl_ltlibobjs= if test -n "$gl_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" done fi AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) ]) gltests_libdeps= gltests_ltlibdeps= m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) m4_pushdef([gltests_LIBSOURCES_LIST], []) m4_pushdef([gltests_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='tests' m4_ifval(gltests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || for gl_file in ]gltests_LIBSOURCES_LIST[ ; do if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2 exit 1 fi done])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) m4_popdef([gltests_LIBSOURCES_DIR]) m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gltests_libobjs= gltests_ltlibobjs= if test -n "$gltests_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do gltests_libobjs="$gltests_libobjs $i.$ac_objext" gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" done fi AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) ]) LIBGNU_LIBDEPS="$gl_libdeps" AC_SUBST([LIBGNU_LIBDEPS]) LIBGNU_LTLIBDEPS="$gl_ltlibdeps" AC_SUBST([LIBGNU_LTLIBDEPS]) ]) # Like AC_LIBOBJ, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_LIBOBJ], [ AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" ]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_REPLACE_FUNCS], [ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)]) ]) # Like AC_LIBSOURCES, except the directory where the source file is # expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the alloca-opt module). # We could also entirely rely on EXTRA_lib..._SOURCES. AC_DEFUN([gl_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ m4_define([gl_LIBSOURCES_DIR], [gnulib/lib]) m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) # Like AC_LIBOBJ, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_LIBOBJ], [ AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" ]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_REPLACE_FUNCS], [ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)]) ]) # Like AC_LIBSOURCES, except the directory where the source file is # expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the alloca-opt module). # We could also entirely rely on EXTRA_lib..._SOURCES. AC_DEFUN([gltests_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ m4_define([gltests_LIBSOURCES_DIR], [tests]) m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ build-aux/link-warning.h lib/c-strtod.c lib/c-strtod.h lib/errno.in.h lib/error.c lib/error.h lib/exitfail.c lib/exitfail.h lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h lib/gettext.h lib/intprops.h lib/inttypes.in.h lib/stdbool.in.h lib/stdint.in.h lib/stdlib.in.h lib/strerror.c lib/string.in.h lib/strtoimax.c lib/strtol.c lib/strtoll.c lib/strtoul.c lib/strtoull.c lib/strtoumax.c lib/unistd.in.h lib/verify.h lib/wchar.in.h lib/xalloc-die.c lib/xalloc.h lib/xmalloc.c lib/xstrtod.c lib/xstrtod.h lib/xstrtoimax.c lib/xstrtol-error.c lib/xstrtol.c lib/xstrtol.h lib/xstrtoul.c lib/xstrtoumax.c m4/c-strtod.m4 m4/errno_h.m4 m4/error.m4 m4/exitfail.m4 m4/extensions.m4 m4/getopt.m4 m4/gnulib-common.m4 m4/include_next.m4 m4/inline.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/longlong.m4 m4/onceonly.m4 m4/stdbool.m4 m4/stdint.m4 m4/stdlib_h.m4 m4/strerror.m4 m4/string_h.m4 m4/strtoimax.m4 m4/strtol.m4 m4/strtoll.m4 m4/strtoul.m4 m4/strtoull.m4 m4/strtoumax.m4 m4/unistd_h.m4 m4/wchar.m4 m4/wint_t.m4 m4/xalloc.m4 m4/xstrtod.m4 m4/xstrtol.m4 ]) genparse-0.9.1/gnulib/m4/string_h.m40000644000076600001440000000754111673365613014151 00000000000000# Configure a GNU-like replacement for . # Copyright (C) 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # Written by Paul Eggert. AC_DEFUN([gl_HEADER_STRING_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_HEADER_STRING_H_BODY]) ]) AC_DEFUN([gl_HEADER_STRING_H_BODY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([string.h]) ]) AC_DEFUN([gl_STRING_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP]) HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) ]) genparse-0.9.1/gnulib/m4/wchar.m40000644000076600001440000000400711673365613013432 00000000000000dnl A placeholder for ISO C99 , for platforms that have issues. dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. # wchar.m4 serial 6 AC_DEFUN([gl_WCHAR_H], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_CACHE_CHECK([whether is standalone], [gl_cv_header_wchar_h_standalone], [AC_COMPILE_IFELSE([[#include wchar_t w;]], [gl_cv_header_wchar_h_standalone=yes], [gl_cv_header_wchar_h_standalone=no])]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else HAVE_WINT_T=0 fi AC_SUBST([HAVE_WINT_T]) if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then WCHAR_H=wchar.h fi dnl Prepare for creating substitute . dnl Do it always: WCHAR_H may be empty here but can be set later. dnl Check for (missing in Linux uClibc when built without wide dnl character support). AC_CHECK_HEADERS_ONCE([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) gl_CHECK_NEXT_HEADERS([wchar.h]) ]) dnl Unconditionally enables the replacement of . AC_DEFUN([gl_REPLACE_WCHAR_H], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) WCHAR_H=wchar.h ]) AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) WCHAR_H=''; AC_SUBST([WCHAR_H]) ]) genparse-0.9.1/gnulib/m4/inttypes-pri.m40000644000076600001440000000215211673365613014774 00000000000000# inttypes-pri.m4 serial 4 (gettext-0.16) dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.52) # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_CHECK_HEADERS([inttypes.h]) if test $ac_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) PRI_MACROS_BROKEN=1 else PRI_MACROS_BROKEN=0 fi AC_SUBST([PRI_MACROS_BROKEN]) ]) genparse-0.9.1/gnulib/m4/strerror.m40000644000076600001440000000442111673365613014210 00000000000000# strerror.m4 serial 9 dnl Copyright (C) 2002, 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRERROR], [ AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE]) if test $REPLACE_STRERROR = 1; then AC_LIBOBJ([strerror]) AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR], [Define this to 1 if strerror is broken.]) fi ]) # Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ). AC_DEFUN([gl_FUNC_STRERROR_SEPARATE], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_ERRNO_H]) if test -z "$ERRNO_H"; then AC_CACHE_CHECK([for working strerror function], [gl_cv_func_working_strerror], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[return !*strerror (-2);]])], [gl_cv_func_working_strerror=yes], [gl_cv_func_working_strerror=no], [dnl Assume crossbuild works if it compiles. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[return !*strerror (-2);]])], [gl_cv_func_working_strerror=yes], [gl_cv_func_working_strerror=no]) ]) ]) if test $gl_cv_func_working_strerror = no; then dnl The system's strerror() fails to return a string for out-of-range dnl integers. Replace it. REPLACE_STRERROR=1 fi else dnl The system's strerror() cannot know about the new errno values we add dnl to . Replace it. REPLACE_STRERROR=1 fi if test $REPLACE_STRERROR = 1; then gl_PREREQ_STRERROR fi ]) # Prerequisites of lib/strerror.c. AC_DEFUN([gl_PREREQ_STRERROR], [ AC_CHECK_DECLS([strerror]) AC_CHECK_HEADERS_ONCE([sys/socket.h]) if test $ac_cv_header_sys_socket_h != yes; then dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make dnl the check for those headers unconditional; yet cygwin reports dnl that the headers are present but cannot be compiled (since on dnl cygwin, all socket information should come from sys/socket.h). AC_CHECK_HEADERS([winsock2.h]) fi ]) genparse-0.9.1/gnulib/m4/strtol.m40000644000076600001440000000052511673365613013656 00000000000000# strtol.m4 serial 4 dnl Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOL], [ AC_REPLACE_FUNCS(strtol) ]) genparse-0.9.1/gnulib/m4/c-strtod.m40000644000076600001440000000272611673365613014073 00000000000000# c-strtod.m4 serial 9 # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. AC_DEFUN([gl_C99_STRTOLD], [ AC_CACHE_CHECK([whether strtold conforms to C99], [gl_cv_func_c99_strtold], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[/* On HP-UX before 11.23, strtold returns a struct instead of long double. Reject implementations like that, by requiring compatibility with the C99 prototype. */ #include static long double (*p) (char const *, char **) = strtold; static long double test (char const *nptr, char **endptr) { long double r; r = strtold (nptr, endptr); return r; }]], [[return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;]])], [gl_cv_func_c99_strtold=yes], [gl_cv_func_c99_strtold=no])]) if test $gl_cv_func_c99_strtold = yes; then AC_DEFINE([HAVE_C99_STRTOLD], 1, [Define to 1 if strtold conforms to C99.]) fi ]) AC_DEFUN([gl_C_STRTOD], [ AC_LIBOBJ([c-strtod]) dnl Prerequisites of lib/c-strtod.c. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) : ]) AC_DEFUN([gl_C_STRTOLD], [ AC_LIBOBJ([c-strtold]) dnl Prerequisites of lib/c-strtold.c. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_C99_STRTOLD]) : ]) genparse-0.9.1/gnulib/m4/include_next.m40000644000076600001440000001251311673365613015010 00000000000000# include_next.m4 serial 9 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Derek Price. dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER. dnl dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to dnl 'include' otherwise. dnl dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next, dnl so as to avoid GCC warnings when the gcc option -pedantic is used. dnl '#pragma GCC system_header' has the same effect as if the file was found dnl through the include search path specified with '-isystem' options (as dnl opposed to the search path specified with '-I' options). Namely, gcc dnl does not warn about some things, and on some systems (Solaris and Interix) dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead dnl of plain '__STDC__'. AC_DEFUN([gl_INCLUDE_NEXT], [ AC_LANG_PREPROC_REQUIRE() AC_CACHE_CHECK([whether the preprocessor supports include_next], [gl_cv_have_include_next], [rm -rf conftestd1 conftestd2 mkdir conftestd1 conftestd2 dnl The include of is because IBM C 9.0 on AIX 6.1 supports dnl include_next when used as first preprocessor directive in a file, dnl but not when preceded by another include directive. cat < conftestd1/conftest.h #define DEFINED_IN_CONFTESTD1 #include #include_next #ifdef DEFINED_IN_CONFTESTD2 int foo; #else #error "include_next doesn't work" #endif EOF cat < conftestd2/conftest.h #ifndef DEFINED_IN_CONFTESTD1 #error "include_next test doesn't work" #endif #define DEFINED_IN_CONFTESTD2 EOF save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" AC_COMPILE_IFELSE([#include ], [gl_cv_have_include_next=yes], [gl_cv_have_include_next=no]) CPPFLAGS="$save_CPPFLAGS" rm -rf conftestd1 conftestd2 ]) PRAGMA_SYSTEM_HEADER= if test $gl_cv_have_include_next = yes; then INCLUDE_NEXT=include_next if test -n "$GCC"; then PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' fi else INCLUDE_NEXT=include fi AC_SUBST([INCLUDE_NEXT]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) ]) # gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) # ------------------------------------------ # For each arg foo.h, if #include_next works, define NEXT_FOO_H to be # ''; otherwise define it to be # '"///usr/include/foo.h"', or whatever other absolute file name is suitable. # That way, a header file with the following line: # #@INCLUDE_NEXT@ @NEXT_FOO_H@ # behaves (after sed substitution) as if it contained # #include_next # even if the compiler does not support include_next. # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". # Use `""', not `<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ AC_REQUIRE([gl_INCLUDE_NEXT]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_HEADERS_ONCE([$1]) m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME]))) if test $gl_cv_have_include_next = yes; then AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) else AC_CACHE_CHECK( [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>], m4_quote(m4_defn([gl_next_header])), [AS_VAR_PUSHDEF([gl_header_exists], [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME]))) if test AS_VAR_GET(gl_header_exists) = yes; then AC_LANG_CONFTEST( [AC_LANG_SOURCE( [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] )]) dnl AIX "xlc -E" and "cc -E" omit #line directives for header files dnl that contain only a #include of other header files and no dnl non-comment tokens of their own. This leads to a failure to dnl detect the absolute name of , , dnl and others. The workaround is to force preservation of comments dnl through option -C. This ensures all necessary #line directives dnl are present. GCC supports option -C as well. case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac dnl eval is necessary to expand gl_absname_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, dnl so use subshell. AS_VAR_SET([gl_next_header], ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{ s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1# s#^/[^/]#//&# p q }'`'"']) else AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) fi AS_VAR_POPDEF([gl_header_exists])]) fi AC_SUBST( AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))), [AS_VAR_GET([gl_next_header])]) AS_VAR_POPDEF([gl_next_header])]) ]) genparse-0.9.1/gnulib/m4/strtoumax.m40000644000076600001440000000205611673365613014376 00000000000000# strtoumax.m4 serial 6 dnl Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOUMAX], [ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([whether defines strtoumax as a macro], gl_cv_func_strtoumax_macro, [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include #ifdef strtoumax inttypes_h_defines_strtoumax #endif], gl_cv_func_strtoumax_macro=yes, gl_cv_func_strtoumax_macro=no)]) if test "$gl_cv_func_strtoumax_macro" != yes; then AC_REPLACE_FUNCS(strtoumax) if test $ac_cv_func_strtoumax = no; then gl_PREREQ_STRTOUMAX fi fi ]) # Prerequisites of lib/strtoumax.c. AC_DEFUN([gl_PREREQ_STRTOUMAX], [ AC_CHECK_DECLS(strtoull) AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) ]) genparse-0.9.1/gnulib/m4/xalloc.m40000644000076600001440000000105511673365613013610 00000000000000# xalloc.m4 serial 16 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XALLOC], [ AC_LIBOBJ([xmalloc]) gl_PREREQ_XALLOC gl_PREREQ_XMALLOC ]) # Prerequisites of lib/xalloc.h. AC_DEFUN([gl_PREREQ_XALLOC], [ AC_REQUIRE([gl_INLINE]) : ]) # Prerequisites of lib/xmalloc.c. AC_DEFUN([gl_PREREQ_XMALLOC], [ : ]) genparse-0.9.1/gnulib/m4/unistd_h.m40000644000076600001440000000701211673365613014142 00000000000000# unistd_h.m4 serial 16 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Simon Josefsson, Bruno Haible. AC_DEFUN([gl_UNISTD_H], [ dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([unistd.h]) AC_CHECK_HEADERS_ONCE([unistd.h]) if test $ac_cv_header_unistd_h = yes; then HAVE_UNISTD_H=1 else HAVE_UNISTD_H=0 fi AC_SUBST([HAVE_UNISTD_H]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) ]) genparse-0.9.1/gnulib/m4/onceonly.m40000644000076600001440000000752111667215657014165 00000000000000# onceonly.m4 serial 6 dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl This file defines some "once only" variants of standard autoconf macros. dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL dnl The advantage is that the check for each of the headers/functions/decls dnl will be put only once into the 'configure' file. It keeps the size of dnl the 'configure' file down, and avoids redundant output when 'configure' dnl is run. dnl The drawback is that the checks cannot be conditionalized. If you write dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to dnl empty, and the check will be inserted before the body of the AC_DEFUNed dnl function. dnl The original code implemented AC_CHECK_HEADERS_ONCE and AC_CHECK_FUNCS_ONCE dnl in terms of AC_DEFUN and AC_REQUIRE. This implementation uses diversions to dnl named sections DEFAULTS and INIT_PREPARE in order to check all requested dnl headers at once, thus reducing the size of 'configure'. It is known to work dnl with autoconf 2.57..2.62 at least . The size reduction is ca. 9%. dnl Autoconf version 2.59 plus gnulib is required; this file is not needed dnl with Autoconf 2.60 or greater. But note that autoconf's implementation of dnl AC_CHECK_DECLS_ONCE expects a comma-separated list of symbols as first dnl argument! AC_PREREQ([2.59]) # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of # AC_CHECK_HEADERS(HEADER1 HEADER2 ...). AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ : m4_foreach_w([gl_HEADER_NAME], [$1], [ AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___])), [ m4_divert_text([INIT_PREPARE], [gl_header_list="$gl_header_list gl_HEADER_NAME"]) gl_HEADERS_EXPANSION AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])), [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.]) ]) AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___]))) ]) ]) m4_define([gl_HEADERS_EXPANSION], [ m4_divert_text([DEFAULTS], [gl_header_list=]) AC_CHECK_HEADERS([$gl_header_list]) m4_define([gl_HEADERS_EXPANSION], []) ]) # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of # AC_CHECK_FUNCS(FUNC1 FUNC2 ...). AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ : m4_foreach_w([gl_FUNC_NAME], [$1], [ AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ m4_divert_text([INIT_PREPARE], [gl_func_list="$gl_func_list gl_FUNC_NAME"]) gl_FUNCS_EXPANSION AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])), [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.]) ]) AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) ]) ]) m4_define([gl_FUNCS_EXPANSION], [ m4_divert_text([DEFAULTS], [gl_func_list=]) AC_CHECK_FUNCS([$gl_func_list]) m4_define([gl_FUNCS_EXPANSION], []) ]) # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of # AC_CHECK_DECLS(DECL1, DECL2, ...). AC_DEFUN([AC_CHECK_DECLS_ONCE], [ : m4_foreach_w([gl_DECL_NAME], [$1], [ AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) ]) AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) ]) ]) genparse-0.9.1/gnulib/m4/stdlib_h.m40000644000076600001440000000544211673365613014122 00000000000000# stdlib_h.m4 serial 13 dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([stdlib.h]) AC_CHECK_TYPES([struct random_data], [], [HAVE_STRUCT_RANDOM_DATA=0], [[#include ]]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) ]) genparse-0.9.1/gnulib/m4/xstrtol.m40000644000076600001440000000061611673365613014047 00000000000000#serial 10 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSTRTOL], [ AC_LIBOBJ([xstrtol]) AC_LIBOBJ([xstrtoul]) AC_LIBOBJ([xstrtol-error]) ]) genparse-0.9.1/gnulib/m4/strtoimax.m40000644000076600001440000000204411673365613014357 00000000000000# strtoimax.m4 serial 6 dnl Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOIMAX], [ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([whether defines strtoimax as a macro], gl_cv_func_strtoimax_macro, [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include #ifdef strtoimax inttypes_h_defines_strtoimax #endif], gl_cv_func_strtoimax_macro=yes, gl_cv_func_strtoimax_macro=no)]) if test "$gl_cv_func_strtoimax_macro" != yes; then AC_REPLACE_FUNCS(strtoimax) if test $ac_cv_func_strtoimax = no; then gl_PREREQ_STRTOIMAX fi fi ]) # Prerequisites of lib/strtoimax.c. AC_DEFUN([gl_PREREQ_STRTOIMAX], [ AC_CHECK_DECLS(strtoll) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) ]) genparse-0.9.1/gnulib/m4/stdint.m40000644000076600001440000003221711673365613013637 00000000000000# stdint.m4 serial 31 dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Bruno Haible. dnl Test whether is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ AC_PREREQ(2.59)dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else HAVE_LONG_LONG_INT=0 fi AC_SUBST([HAVE_LONG_LONG_INT]) AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) if test $ac_cv_type_unsigned_long_long_int = yes; then HAVE_UNSIGNED_LONG_LONG_INT=1 else HAVE_UNSIGNED_LONG_LONG_INT=0 fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi AC_SUBST([HAVE_INTTYPES_H]) dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi AC_SUBST([HAVE_SYS_TYPES_H]) gl_CHECK_NEXT_HEADERS([stdint.h]) if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else HAVE_STDINT_H=0 fi AC_SUBST([HAVE_STDINT_H]) dnl Now see whether we need a substitute . if test $ac_cv_header_stdint_h = yes; then AC_CACHE_CHECK([whether stdint.h conforms to C99], [gl_cv_header_working_stdint_h], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) #error "WCHAR_MIN, WCHAR_MAX not defined in " #endif ] gl_STDINT_INCLUDES [ #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) #define TYPE_MAXIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) struct s { int check_PTRDIFF: PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) ? 1 : -1; /* Detect bug in FreeBSD 6.0 / ia64. */ int check_SIG_ATOMIC: SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) ? 1 : -1; int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; int check_WCHAR: WCHAR_MIN == TYPE_MINIMUM (wchar_t) && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) ? 1 : -1; /* Detect bug in mingw. */ int check_WINT: WINT_MIN == TYPE_MINIMUM (wint_t) && WINT_MAX == TYPE_MAXIMUM (wint_t) ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; ]])], [gl_cv_header_working_stdint_h=yes])]) fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= else dnl Check for , and for dnl (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 else HAVE_SYS_INTTYPES_H=0 fi AC_SUBST([HAVE_SYS_INTTYPES_H]) if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 else HAVE_SYS_BITYPES_H=0 fi AC_SUBST([HAVE_SYS_BITYPES_H]) dnl Check for (missing in Linux uClibc when built without wide dnl character support). AC_CHECK_HEADERS_ONCE([wchar.h]) gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi AC_SUBST(STDINT_H) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) dnl Determine the size of each of the given types in bits. AC_DEFUN([gl_STDINT_BITSIZEOF], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], [$2 #include ], [result=unknown]) eval gl_cv_bitsizeof_${gltype}=\$result ]) eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, dnl do a syntax check even on unused #if conditions and give an error dnl on valid C code like this: dnl #if 0 dnl # if > 32 dnl # endif dnl #endif result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) eval BITSIZEOF_${GLTYPE}=\$result done m4_foreach_w([gltype], [$1], [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) dnl Determine the signedness of each of the given types. dnl Define HAVE_SIGNED_TYPE if type is signed. AC_DEFUN([gl_CHECK_TYPES_SIGNED], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to 1 if ']gltype[' is a signed integer type.])]) for gltype in $1 ; do AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], result=yes, result=no) eval gl_cv_type_${gltype}_signed=\$result ]) eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done m4_foreach_w([gltype], [$1], [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) dnl Determine the suffix to use for integer constants of the given types. dnl Define t_SUFFIX for each such type. AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for constants of type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for $gltype integer literal suffix], [gl_cv_type_${gltype}_suffix], [eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ extern $gltype foo; extern $gltype1 foo;]])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done]) GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) done m4_foreach_w([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) ]) dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ /* BSD/OS 4.0.1 has a bug: , and must be included before . */ #include #include #if HAVE_WCHAR_H # include # include # include #endif ]]) dnl gl_STDINT_TYPE_PROPERTIES dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t dnl of interest to stdint.in.h. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], [gl_STDINT_INCLUDES]) ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) # Hey Emacs! # Local Variables: # indent-tabs-mode: nil # End: genparse-0.9.1/gnulib/m4/error.m40000644000076600001440000000103411673365613013454 00000000000000#serial 11 # Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_ERROR], [ AC_FUNC_ERROR_AT_LINE dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). gl_PREREQ_ERROR ]) # Prerequisites of lib/error.c. AC_DEFUN([gl_PREREQ_ERROR], [ AC_REQUIRE([AC_FUNC_STRERROR_R]) : ]) genparse-0.9.1/gnulib/m4/strtoull.m40000644000076600001440000000143511673365613014220 00000000000000# strtoull.m4 serial 5 dnl Copyright (C) 2002, 2004, 2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOULL], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) dnl We don't need (and can't compile) the replacement strtoull dnl unless the type 'unsigned long long int' exists. AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) if test "$ac_cv_type_unsigned_long_long_int" = yes; then AC_REPLACE_FUNCS(strtoull) if test $ac_cv_func_strtoull = no; then HAVE_STRTOULL=0 gl_PREREQ_STRTOULL fi fi ]) # Prerequisites of lib/strtoull.c. AC_DEFUN([gl_PREREQ_STRTOULL], [ : ]) genparse-0.9.1/gnulib/Makefile.am0000644000076600001440000000001610716376260013571 00000000000000SUBDIRS = lib genparse-0.9.1/gnulib/Makefile.in0000644000076600001440000005737611732677151013631 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = gnulib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ SUBDIRS = lib all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gnulib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gnulib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: genparse-0.9.1/link-warning.h0000644000076600001440000000241411673365613013035 00000000000000/* GL_LINK_WARNING("literal string") arranges to emit the literal string as a linker warning on most glibc systems. We use a linker warning rather than a preprocessor warning, because #warning cannot be used inside macros. */ #ifndef GL_LINK_WARNING /* This works on platforms with GNU ld and ELF object format. Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. Testing __ELF__ guarantees the ELF object format. Testing __GNUC__ is necessary for the compound expression syntax. */ # if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ # define GL_LINK_WARNING(message) \ GL_LINK_WARNING1 (__FILE__, __LINE__, message) # define GL_LINK_WARNING1(file, line, message) \ GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ # define GL_LINK_WARNING2(file, line, message) \ GL_LINK_WARNING3 (file ":" #line ": warning: " message) # define GL_LINK_WARNING3(message) \ ({ static const char warning[sizeof (message)] \ __attribute__ ((__unused__, \ __section__ (".gnu.warning"), \ __aligned__ (1))) \ = message "\n"; \ (void)0; \ }) # else # define GL_LINK_WARNING(message) ((void) 0) # endif #endif genparse-0.9.1/config.guess0000755000076600001440000012724411667213344012611 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-12-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: genparse-0.9.1/ChangeLog0000644000076600001440000003035011732676713012040 000000000000002012-03-22 Michael Geng * add const attribute to generated C++ classes (thanks to Thomas Sprinkmeier) 2012-02-16 Michael Geng * use gcc in tests/misc instead of $CC 2012-02-13 Michael Geng * update copyright notes 2012-02-12 Michael Geng * use /bin/bash in all test scripts * CPPFLAGS in tests/misc fixed 2011-12-28 Michael Geng * configure checks for Java class gnu.getopt.Getopt 2011-12-10 Michael Geng * replaced gcj by java and javac * upgraded autoconf and gnulib 2010-03-14 Michael Geng * remove old FSF address and use the URL, as recommended by newest GPL template * update year in copyright notes * fix warning issued by gcc 4.5.0 * update doxygen configuration file for doxygen version 1.6.2 2010-03-06 Michael Geng * documentation fixed, thanks to Jari Aalto 2010-02-23 Michael Geng * spelling errors fixed * warning "deprecated conversion from string constant to 'char*'" fixed * removed outdated autotools helper files config.sub and config.guess 2010-02-15 Michael Geng * unsigned int replaced by string::size_type where appropriate 2009-05-17 Michael Geng * uninitialized variable fixed * memory leaks fixed 2009-02-20 Michael Geng * genparse java tests can be compiled with gcj version 4.3 2008-11-16 Michael Geng * genparse compiles with gcc version 4.4 2008-10-30 Michael Geng * genparse no longer crashes when it tries to remove commas from the username while writing the comment headers 2008-10-29 Michael Geng * Fix improper use of string::erase () in userinfo.cc 2008-08-20 Michael Geng * requirement for TMPDIR environment variable in Java tests removed 2008-07-13 Michael Geng * allow dashes ('-') in include files 2008-07-12 Michael Geng * Changes in order to compile with newer versions of gcc and the C++ Standard Template Library 2008-01-18 Michael Geng * __CODE__ directive added for specifying user defined code related to command line parameters * __COMMAND__ removed because __CODE__ replaces it * New global directive #no_struct in order to give the user the possibility to define all actions on command line switches on his own which adds the possibility to specify user defined code which is executed when a command line parameter is specified. 2007-12-26 Michael Geng * The examples and the test scripts are no longer installed on "make install" 2007-12-23 Michael Geng * Descriptive text for command line parameters will be printed starting in the 1st column if it starts in the 1st column in the Genparse file * ping commmand from the GNU inetutils added to examples * conversion to double uses c_strtod only if called with --internationalize * setter and getter functions in classes Clparam and Cldesc start with set_ or get_ * new directive __ADD_FLAG__ 2007-12-16 Michael Geng * Updated to newer versions of automake, autoconf, gnulib and Java tools * __ERR_MSG__ can have a conversion function as an optional argument 2007-11-21 Michael Geng * make distcheck works now 2007-11-20 Michael Geng * Test script string renamed to string_macro because of a naming conflict with the string include file in the C++ standard library 2007-11-13 Michael Geng * A lot of new tests added, especially for testing the usage function * A lot of bugs fixed which were discovered with the above tests * All tests moved to tests directory * __MANDATORIES__ marked as deprecated in the documentation 2007-10-16 Michael Geng * If --manyprints is set then a new print command starts also before the description of the 1st command line parameter 2007-10-12 Michael Geng * New option -P / --manyprints * New directive __COMMENT__(text) in the #usage section * For C output: use puts () instead of printf () if the printed text has no arguments * Parsing of brackets for directives improved * __NEW_PRINT__ directive now also allowed for C++ and Java output * gnulib updated to version from Sept 2007 * Genparse file grammar section updated in the docu 2007-10-04 Michael Geng * New option -g / gnulib, which adds support for the Gnulib * If --gnulib is set then new types are supported (long int, unsigned long int, intmax_t, uintmax_t and double * New directive __ERR_MSG__ for customizing the error message if the conversion fails * Directive #store_longindex renamed to __STORE_LONGINDEX__ 2007-09-21 Michael Geng * New directive #gp_include in the Genparse file which allows including other Genparse files into the main Genparse file * New directive #store_longindex in the parameters section * Added the following directives in the #usage section: __NEW_PRINT__, __COMMAND__, __NL__ * New global directive #export_long_options * Added a spaces before opening braces according with the GNU coding style, both in the Genparse source and in the generated parser code * Added GPL preambles to all source files 2007-09-13 Michael Geng * New global directive #break_lines in the Genparse file * New option -s / --static-headers 2007-08-22 Michael Geng * new global directive #exit_value in the Genparse file * only 1 global callback function supported 2007-08-19 Michael Geng * support for optional parameters added * tail command added to examples 2007-08-18 Michael Geng * parameter callbacks now get names as specified in the Genparse file * multiple parameters can use the same callback function 2007-08-12 Michael Geng * It is now possible to include int macros from other files in the usage() function 2007-07-22 Michael Geng * It is now possible to include string macros from other files in the usage() function 2007-07-09 Michael Geng * status passed to usage() function as an argument * Genparse no longer generates a "duplicate parameter" error if Genparse file has an entry "NONE / help" or "NONE / version" 2007-07-08 Michael Geng * New command line switch -i / --internationalize * Optional designation "opt_name" for long options added 2007-06-23 Michael Geng * Genparse no longer generates any code which allocates memory on the heap, i.e. no calls to malloc(), strdup() et al. Unfortunately this implies that the parser function is changed for the C output. It receives a pointer to an arg_t struct now instead of passing such a struct as the return value. 2007-06-16 Michael Geng * Check not only file opening but also file write and close operations * acconfig.h removed 2007-06-11 Michael Geng * It now compiles also when doxygen, texi2html, texi2pdf or man2html are not installed 2007-06-10 Michael Geng * It now compiles also when gcj or junit are not installed 2007-06-09 Michael Geng * It now compiles also when no cunit or no cppunit is installed * configure.in renamed to configure.ac 2007-06-06 Michael Geng * Project homepage updated 2007-04-21 Michael Geng * single digit options allowed (e.g. -1) 2007-04-16 Michael Geng * mv command added to examples 2007-04-14 Michael Geng * Indentation width for GNU style parameter glossary is now configurable 2007-04-12 Michael Geng * Keywords in #usage section converted to upper case * Indentation changed for GNU style parameter glossary (help screen) 2007-04-08 Michael Geng * GNU style glossary is now also able to print multiple line parameter descriptions 2007-04-06 Michael Geng * Parameter list on help screen printed by usage() function can now optionally be printed in GNU style * Dashes in long parameter names are now allowed * Some include files added in order to compile with gcc version 4.3 2007-03-30 Michael Geng * usage() function can now be configured by specifying a usage section in the Genparse file * The program name can now appear more than once in the usage() function 2007-03-18 Michael Geng * Language independent part of usage() function is now performed in the base class (Clparam_list). * Few long print commands instead of many short ones in the generated output in the usage() function. * invocation_list removed from parser file and parser class because it's unused. 2007-03-13 Michael Geng * Multiple short options for 1 command line switch possible 2007-03-10 Michael Geng * Support for Java output added * New genparse option --directory 2007-03-06 Michael Geng * It is now possible to have include files in double quotes in the generated files, not only in angle brackets. 2007-01-21 Michael Geng * New command line switch --longmembers 2007-01-03 Michael Geng * cunit test added (new folder ccheck) 2006-11-19 Michael Geng * Doxygen documentation started * Factory class added for creating language specific sub class of Clparam_list 2006-11-10 Michael Geng * Langage specific file generation moved from class Clparam_list to sub classes 2006-11-04 Michael Geng * Clparam_list::str2comment and Clparam_list::str2upper simplified 2006-11-03 Michael Geng * Now reports a "duplicate parameter" message also when only the long form is duplicate 2006-10-29 Michael Geng * Default values for char parameters added * Autogenerated files doc/version.texi and doc/stamp-vti removed from the archive * Missing file updated 2006-10-07 Michael Geng * Source file containing callback file (.clp_cb.cc) no longer included * Additional test added to cppunit in order to check the callback functions 2006-09-28 Michael Geng * cppunit test added (new folder cppcheck) new target check added to Makefile * Existing test folder renamed to examples * Files regenerated with automake version 1.9.5 2006-09-06 Michael Geng * Bug with ostringstream usage fixed. genparse crashed when called without command line options. * gcc option -Wstrict-prototypes removed because this option is not valid for C++. 2006-09-05 Michael Geng * Man page imported from Debian 2006-09-02 Michael Geng * Update all sources in order to compile with version 3 of the C++ standard library * Reset global optind in order to make it possible to instantiate the genparse generated parser class multiple times within the same program * config files regenerated with autoconv version 2.59 and automake version 1.7.9 * In the test subdirectory: execute genparse from ../src * docu updated, especially the link to the project home page, it is now: http://sourceforge.net/projects/genparse * .deps and stamp-vti in the root directory deleted 2000-10-22 Mike Borella * Merged getopt.cc and getopt_internal.cc into getopt.cc * Added #invocation command to grammar * Added html support for documentation. Just type 'make html' * src/userinfo.cc: Added check for presence of cygwin * src/clparam.cc: Added get_descriptions(). * src/clparam.cc: Fixed output of _longopt_value in debug mode so that it actually works. * src/clparam.cc: Changed usage function output so that multiple descriptions work, and so that type, range, and default values are displayed. genparse-0.9.1/Makefile.in0000644000076600001440000007177311732677153012350 00000000000000# Makefile.in generated by automake 1.10a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # 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 WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO config.guess config.sub depcomp install-sh missing \ mkinstalldirs ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/c-strtod.m4 \ $(top_srcdir)/gnulib/m4/errno_h.m4 \ $(top_srcdir)/gnulib/m4/error.m4 \ $(top_srcdir)/gnulib/m4/exitfail.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/inline.m4 \ $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \ $(top_srcdir)/gnulib/m4/inttypes.m4 \ $(top_srcdir)/gnulib/m4/longlong.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/stdbool.m4 \ $(top_srcdir)/gnulib/m4/stdint.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/strerror.m4 \ $(top_srcdir)/gnulib/m4/string_h.m4 \ $(top_srcdir)/gnulib/m4/strtoimax.m4 \ $(top_srcdir)/gnulib/m4/strtol.m4 \ $(top_srcdir)/gnulib/m4/strtoll.m4 \ $(top_srcdir)/gnulib/m4/strtoul.m4 \ $(top_srcdir)/gnulib/m4/strtoull.m4 \ $(top_srcdir)/gnulib/m4/strtoumax.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/wchar.m4 \ $(top_srcdir)/gnulib/m4/wint_t.m4 \ $(top_srcdir)/gnulib/m4/xalloc.m4 \ $(top_srcdir)/gnulib/m4/xstrtod.m4 \ $(top_srcdir)/gnulib/m4/xstrtol.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOT = @DOT@ DOXYGEN = @DOXYGEN@ DOXYGEN_SRC_DIRECTORY = @DOXYGEN_SRC_DIRECTORY@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ GETOPT_H = @GETOPT_H@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ GNULIB_MBSCHR = @GNULIB_MBSCHR@ GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ GNULIB_MBSLEN = @GNULIB_MBSLEN@ GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ GNULIB_MBSSEP = @GNULIB_MBSSEP@ GNULIB_MBSSPN = @GNULIB_MBSSPN@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STPCPY = @GNULIB_STPCPY@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNULIB_WRITE = @GNULIB_WRITE@ GREP = @GREP@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETOPT_JAVA = @HAVE_GETOPT_JAVA@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_JAVA = @HAVE_JAVA@ HAVE_JAVAC = @HAVE_JAVAC@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_OS_H = @HAVE_OS_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WINT_T = @HAVE_WINT_T@ HAVE__BOOL = @HAVE__BOOL@ INCLUDE_NEXT = @INCLUDE_NEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTTYPES_H = @INTTYPES_H@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVA_JUNIT = @JAVA_JUNIT@ JUNIT = @JUNIT@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TESTS_JUNIT = @TESTS_JUNIT@ TEXI2HTML = @TEXI2HTML@ TEXI2PDF = @TEXI2PDF@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ VERSION = @VERSION@ VOID_UNSETENV = @VOID_UNSETENV@ WCHAR_H = @WCHAR_H@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uudecode = @uudecode@ EXTRA_DIST = genparse.gp SUBDIRS = gnulib src doc examples tests ACLOCAL_AMFLAGS = -I gnulib/m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ fi; \ cp -pR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: