This list is closed, nobody may subscribe to it.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(13) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(38) |
Jul
(10) |
Aug
(70) |
Sep
(63) |
Oct
(61) |
Nov
(41) |
Dec
(28) |
| 2002 |
Jan
(43) |
Feb
(11) |
Mar
(9) |
Apr
(2) |
May
(97) |
Jun
(94) |
Jul
(13) |
Aug
(49) |
Sep
(41) |
Oct
(24) |
Nov
(55) |
Dec
(126) |
| 2003 |
Jan
(90) |
Feb
(75) |
Mar
(32) |
Apr
(24) |
May
(54) |
Jun
(54) |
Jul
(22) |
Aug
(4) |
Sep
(16) |
Oct
(8) |
Nov
(6) |
Dec
(13) |
| 2004 |
Jan
|
Feb
(17) |
Mar
(60) |
Apr
(21) |
May
(12) |
Jun
|
Jul
(13) |
Aug
|
Sep
(29) |
Oct
|
Nov
|
Dec
(2) |
| 2005 |
Jan
(22) |
Feb
(3) |
Mar
(2) |
Apr
(13) |
May
(82) |
Jun
(18) |
Jul
(30) |
Aug
(17) |
Sep
(3) |
Oct
(19) |
Nov
(4) |
Dec
(8) |
| 2006 |
Jan
(1) |
Feb
(6) |
Mar
(2) |
Apr
(40) |
May
|
Jun
(21) |
Jul
(1) |
Aug
(410) |
Sep
(3) |
Oct
|
Nov
(56) |
Dec
(7) |
| 2007 |
Jan
(19) |
Feb
|
Mar
(4) |
Apr
(8) |
May
(19) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(2) |
| 2008 |
Jan
(13) |
Feb
(18) |
Mar
(12) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(11) |
Oct
(13) |
Nov
(17) |
Dec
(6) |
| 2010 |
Jan
(24) |
Feb
(10) |
Mar
(27) |
Apr
(20) |
May
(108) |
Jun
(8) |
Jul
(23) |
Aug
(38) |
Sep
(49) |
Oct
(17) |
Nov
(12) |
Dec
(14) |
| 2011 |
Jan
(17) |
Feb
(7) |
Mar
(28) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(12) |
Sep
(4) |
Oct
(20) |
Nov
(19) |
Dec
(2) |
| 2012 |
Jan
(2) |
Feb
(6) |
Mar
(5) |
Apr
(24) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(18) |
Sep
(38) |
Oct
(26) |
Nov
(12) |
Dec
(6) |
| 2013 |
Jan
(19) |
Feb
(18) |
Mar
(44) |
Apr
(35) |
May
(18) |
Jun
(21) |
Jul
(10) |
Aug
(19) |
Sep
(44) |
Oct
(25) |
Nov
(1) |
Dec
(2) |
| 2014 |
Jan
(8) |
Feb
|
Mar
|
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
(7) |
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(4) |
Jul
(6) |
Aug
(2) |
Sep
(8) |
Oct
(2) |
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
(7) |
Feb
(9) |
Mar
(5) |
Apr
(5) |
May
(9) |
Jun
(4) |
Jul
(20) |
Aug
(4) |
Sep
(7) |
Oct
(6) |
Nov
(9) |
Dec
(2) |
| 2017 |
Jan
(7) |
Feb
(7) |
Mar
(5) |
Apr
|
May
(1) |
Jun
(4) |
Jul
(12) |
Aug
(4) |
Sep
(1) |
Oct
(4) |
Nov
(11) |
Dec
(14) |
| 2018 |
Jan
(3) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
|
2
|
3
|
4
|
5
|
|
6
|
7
(1) |
8
|
9
|
10
|
11
(85) |
12
|
|
13
|
14
(324) |
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
|
29
|
30
|
31
|
|
|
|
From: Earnie B. <ea...@us...> - 2006-08-14 18:00:59
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10210/test Modified Files: Makefile.in Log Message: autoreconf Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/test/Makefile.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.in 14 Aug 2006 17:39:00 -0000 1.2 --- Makefile.in 14 Aug 2006 18:00:55 -0000 1.3 *************** *** 780,784 **** GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk CMP = cmp ! AWKPROG = ../gawk$(EXEEXT) all: all-am --- 780,784 ---- GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk CMP = cmp ! AWKPROG = ../gawk all: all-am |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:59:54
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9767/test Modified Files: Makefile.am Log Message: Do not add .exe to AWKPROG variable so that tests do not fail Index: Makefile.am =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/test/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 14 Aug 2006 17:32:38 -0000 1.1 --- Makefile.am 14 Aug 2006 17:59:51 -0000 1.2 *************** *** 622,626 **** CMP = cmp ! AWKPROG = ../gawk$(EXEEXT) # This business forces the locale to be C for running the tests, --- 622,626 ---- CMP = cmp ! AWKPROG = ../gawk # This business forces the locale to be C for running the tests, |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:39:06
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/m4 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv969/m4 Modified Files: printf-posix.m4 Log Message: autoreconf --force Index: printf-posix.m4 =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/m4/printf-posix.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** printf-posix.m4 14 Aug 2006 17:32:32 -0000 1.1 --- printf-posix.m4 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 29,33 **** [ AC_EGREP_CPP(notposix, [ ! #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif --- 29,33 ---- [ AC_EGREP_CPP(notposix, [ ! #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ || defined __MSYS__ notposix #endif |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:39:06
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv969 Modified Files: Makefile.in aclocal.m4 config.guess config.sub configure Log Message: autoreconf --force Index: aclocal.m4 =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/aclocal.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** aclocal.m4 14 Aug 2006 17:32:10 -0000 1.1 --- aclocal.m4 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 1,3 **** ! # generated automatically by aclocal 1.9.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, --- 1,3 ---- ! # generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, *************** *** 29,33 **** # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], ! [AM_AUTOMAKE_VERSION([1.9.5])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- --- 29,33 ---- # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], ! [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- *************** *** 902,905 **** --- 902,906 ---- m4_include([m4/intmax_t.m4]) m4_include([m4/inttypes_h.m4]) + m4_include([m4/isc-posix.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.in 14 Aug 2006 17:32:09 -0000 1.1 --- Makefile.in 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ *************** *** 38,43 **** # - SOURCES = $(gawk_SOURCES) $(pgawk_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ --- 38,41 ---- *************** *** 74,84 **** $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ ! $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ ! $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ ! $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/socket.m4 \ ! $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strtod.m4 \ ! $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ ! $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) --- 72,82 ---- $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ ! $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ ! $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ ! $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ ! $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/stdint_h.m4 \ ! $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/uintmax_t.m4 \ ! $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) Index: config.guess =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/config.guess,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.guess 14 Aug 2006 17:32:11 -0000 1.1 --- config.guess 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 4,8 **** # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ! timestamp='2005-02-10' # This file is free software; you can redistribute it and/or modify it --- 4,8 ---- # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ! timestamp='2005-12-13' [...1766 lines suppressed...] c4*) echo c4-convex-bsd ! exit ;; esac fi *************** *** 1420,1424 **** download the most up to date version of the config scripts from ! ftp://ftp.gnu.org/pub/gnu/config/ If the version you run ($0) is already up to date, please --- 1439,1445 ---- download the most up to date version of the config scripts from ! http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess ! and ! http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please Index: config.sub =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/config.sub,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.sub 14 Aug 2006 17:32:11 -0000 1.1 --- config.sub 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 4,8 **** # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ! timestamp='2005-02-10' # This file is (in principle) common to ALL GNU software. --- 4,8 ---- # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ! timestamp='2005-12-11' # This file is (in principle) common to ALL GNU software. *************** *** 22,28 **** # 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. ! # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a --- 22,28 ---- # 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. ! # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a *************** *** 30,33 **** --- 30,34 ---- # the same distribution terms that you use for the rest of that program. + # Please send patches to <con...@gn...>. Submit a context # diff and a properly formatted ChangeLog entry. *************** *** 84,92 **** case $1 in --time-stamp | --time* | -t ) ! echo "$timestamp" ; exit 0 ;; --version | -v ) ! echo "$version" ; exit 0 ;; --help | --h* | -h ) ! echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; --- 85,93 ---- 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 ;; *************** *** 100,104 **** # First pass through any local machine types. echo $1 ! exit 0;; * ) --- 101,105 ---- # First pass through any local machine types. echo $1 ! exit ;; * ) *************** *** 119,124 **** maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in ! nto-qnx* | linux-gnu* | linux-dietlibc | 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/'` --- 120,126 ---- 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/'` *************** *** 171,174 **** --- 173,180 ---- os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 *************** *** 187,190 **** --- 193,200 ---- 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 *************** *** 232,235 **** --- 242,246 ---- | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ *************** *** 247,250 **** --- 258,262 ---- | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ *************** *** 255,267 **** | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ ! | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ ! | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ ! | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ --- 267,281 ---- | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ | ns16k | ns32k \ ! | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ ! | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ ! | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ ! | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ *************** *** 272,275 **** --- 286,292 ---- basic_machine=$basic_machine-unknown ;; + m32c) + basic_machine=$basic_machine-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. *************** *** 279,282 **** --- 296,302 ---- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' *************** *** 299,303 **** | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ ! | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ --- 319,323 ---- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ ! | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ *************** *** 320,323 **** --- 340,344 ---- | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ *************** *** 328,331 **** --- 349,353 ---- | mipstx39-* | mipstx39el-* \ | mmix-* \ + | mt-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ *************** *** 335,341 **** | pyramid-* \ | romp-* | rs6000-* \ ! | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ ! | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ --- 357,364 ---- | pyramid-* \ | romp-* | rs6000-* \ ! | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ ! | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ ! | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ *************** *** 349,352 **** --- 372,377 ---- | z8k-*) ;; + m32c-*) + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. *************** *** 684,687 **** --- 709,715 ---- os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm *************** *** 759,765 **** os=-proelf ;; ! or32 | or32-*) basic_machine=or32-unknown - os=-coff ;; os400) --- 787,792 ---- os=-proelf ;; ! openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) *************** *** 848,851 **** --- 875,882 ---- os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k *************** *** 1087,1096 **** basic_machine=we32k-att ;; ! sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun --- 1118,1124 ---- 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) basic_machine=sparc-sun *************** *** 1172,1177 **** | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ ! | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ! | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ --- 1200,1206 ---- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ ! | -cygwin* | -msys* | -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* \ *************** *** 1179,1183 **** | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ ! | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; --- 1208,1213 ---- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ ! | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ! | -skyos* | -haiku* | -rdos*) # Remember, each alternative MUST END IN *, to match a version number. ;; *************** *** 1197,1201 **** ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ ! | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; --- 1227,1231 ---- ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ ! | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; *************** *** 1386,1389 **** --- 1416,1422 ---- os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix *************** *** 1557,1561 **** echo $basic_machine$os ! exit 0 # Local variables: --- 1590,1594 ---- echo $basic_machine$os ! exit # Local variables: Index: configure =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/configure,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** configure 14 Aug 2006 17:32:11 -0000 1.1 --- configure 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 3495,3505 **** ! echo "$as_me:$LINENO: checking for library containing strerror" >&5 ! echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 ! if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ! ac_func_search_save_LIBS=$LIBS ! ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ --- 3495,3506 ---- ! ! echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 ! echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 ! if test "${ac_cv_lib_cposix_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ! ac_check_lib_save_LIBS=$LIBS ! LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ *************** *** 3546,3623 **** echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_search_strerror="none required" ! else ! echo "$as_me: failed program was:" >&5 ! sed 's/^/| /' conftest.$ac_ext >&5 ! ! fi ! rm -f conftest.err conftest.$ac_objext \ ! conftest$ac_exeext conftest.$ac_ext ! if test "$ac_cv_search_strerror" = no; then ! for ac_lib in cposix; do ! LIBS="-l$ac_lib $ac_func_search_save_LIBS" ! cat >conftest.$ac_ext <<_ACEOF ! /* confdefs.h. */ ! _ACEOF ! cat confdefs.h >>conftest.$ac_ext ! cat >>conftest.$ac_ext <<_ACEOF ! /* end confdefs.h. */ ! ! /* Override any gcc2 internal prototype to avoid an error. */ ! #ifdef __cplusplus ! extern "C" ! #endif ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char strerror (); ! int ! main () ! { ! strerror (); ! ; ! return 0; ! } ! _ACEOF ! rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ! (eval $ac_link) 2>conftest.er1 ! ac_status=$? ! grep -v '^ *+' conftest.er1 >conftest.err ! rm -f conftest.er1 ! cat conftest.err >&5 ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); } && ! { ac_try='test -z "$ac_c_werror_flag" ! || test ! -s conftest.err' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; } && ! { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; }; then ! ac_cv_search_strerror="-l$ac_lib" ! break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ! done fi ! LIBS=$ac_func_search_save_LIBS fi - echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 - echo "${ECHO_T}$ac_cv_search_strerror" >&6 - if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" ! fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 --- 3547,3568 ---- echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_lib_cposix_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_cposix_strerror=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ! LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 ! echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 ! if test $ac_cv_lib_cposix_strerror = yes; then ! LIBS="$LIBS -lcposix" fi ! echo "$as_me:$LINENO: checking for ANSI C header files" >&5 |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:39:04
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/test In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv969/test Modified Files: Makefile.in Log Message: autoreconf --force Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/test/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.in 14 Aug 2006 17:32:38 -0000 1.1 --- Makefile.in 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ *************** *** 66,76 **** $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ ! $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ ! $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ ! $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/socket.m4 \ ! $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strtod.m4 \ ! $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ ! $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) --- 66,76 ---- $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ ! $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ ! $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ ! $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ ! $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/stdint_h.m4 \ ! $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/uintmax_t.m4 \ ! $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:39:03
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/doc In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv969/doc Modified Files: Makefile.in Log Message: autoreconf --force Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/doc/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.in 14 Aug 2006 17:32:27 -0000 1.1 --- Makefile.in 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ *************** *** 66,76 **** $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ ! $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ ! $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ ! $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/socket.m4 \ ! $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strtod.m4 \ ! $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ ! $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) --- 66,76 ---- $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ ! $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ ! $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ ! $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ ! $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/stdint_h.m4 \ ! $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/uintmax_t.m4 \ ! $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) *************** *** 263,269 **** am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ ! 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; \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ --- 263,271 ---- 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) \ *************** *** 311,314 **** --- 313,317 ---- gawkinet.html: gawkinet.texi .dvi.ps: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:39:03
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/awklib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv969/awklib Modified Files: Makefile.in Log Message: autoreconf --force Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/msys/packages/gawk/3.1.5/awklib/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.in 14 Aug 2006 17:32:21 -0000 1.1 --- Makefile.in 14 Aug 2006 17:39:00 -0000 1.2 *************** *** 1,3 **** ! # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ --- 1,3 ---- ! # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ *************** *** 39,44 **** - SOURCES = $(nodist_grcat_SOURCES) $(nodist_pwcat_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ --- 39,42 ---- *************** *** 69,79 **** $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ ! $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ ! $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ ! $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/socket.m4 \ ! $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strtod.m4 \ ! $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ ! $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) --- 67,77 ---- $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ ! $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ ! $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ ! $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ ! $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/stdint_h.m4 \ ! $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/uintmax_t.m4 \ ! $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) |
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/vms In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/vms Added Files: ChangeLog descrip.mms fcntl.h gawk.cld gawk.hlp gawkmisc.vms posix-cc.sh redirect.h unixlib.h varargs.h vms-conf.h vms.h vms_args.c vms_cli.c vms_fwrite.c vms_gawk.c vms_misc.c vms_popen.c vmsbuild.com vmstest.com Log Message: Update package --- NEW FILE: vmstest.com --- $! vmstest.com -- DCL script to perform test/Makefile actions for VMS $! $! Usage: $! $ set default [-.test] $! $ @[-.vms]vmstest.com bigtest $! This assumes that newly built gawk.exe is in the next directory up. $! $ echo = "write sys$output" $ cmp = "diff/Output=_NL:/Maximum=1" $ rm = "delete/noConfirm/noLog" $ gawk = "$sys$disk:[-]gawk" $ AWKPATH_srcdir = "define/User AWKPATH sys$disk:[]" $ $ if p1.eqs."" then p1 = "bigtest" $ gosub 'p1' $ if p2.nes."" then gosub 'p2' $ if p3.nes."" then gosub 'p3' $ if p4.nes."" then gosub 'p4' $ if p5.nes."" then gosub 'p5' [...1669 lines suppressed...] organization sequential record format stream_lf size 32767 $ if $status .and. p2.eqs."purge" then rm 'p1';-1 $ else cmp nl: nl: !deassign/user sys${error,output} $ endif $ endsubroutine !fixup_LRL $ $! add a fake "EXIT CODE" record to the end of the temporary output file $! to simulate the ``|| echo EXIT CODE $$? >>_$@'' shell script usage $exit_code: subroutine $ if f$trnlnm("FTMP").nes."" then close/noLog ftmp $ open/Append ftmp tmp. $ write ftmp "EXIT CODE: ",p1 $ close ftmp $ endsubroutine !exit_code $ $!NOTREACHED $ exit --- NEW FILE: redirect.h --- /* * redirect.h --- definitions for functions that are OS specific. */ /* * Copyright (C) 1986, 88, 89, 91-93, 1996, 1997 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ /* This file is included by custom.h for VMS-POSIX, or first by config.h (vms-conf.h) then again by awk.h for normal VMS. */ #if defined(VMS_POSIX) || defined(IN_CONFIG_H) #define DEFAULT_FILETYPE ".awk" /* some macros to redirect some non-VMS-specific code */ #define getopt gnu_getopt #define opterr gnu_opterr #define optarg gnu_optarg #define optind gnu_optind #define optopt gnu_optopt #define regcomp gnu_regcomp #define regexec gnu_regexec #define regfree gnu_regfree #define regerror gnu_regerror #ifndef VMS_POSIX #define strftime gnu_strftime /* always use missing/strftime.c */ #define strcasecmp gnu_strcasecmp #define strncasecmp gnu_strncasecmp #ifndef VMS_V7 #define tzset fake_tzset #define tzname fake_tzname #define daylight fake_daylight #define timezone fake_timezone #define altzone fake_altzone #endif #if !defined(__DECC) && !defined(VAXC2DECC) && !defined(__alpha) #define strcoll(s,t) strcmp((s),(t)) /* VAXCRTL lacks locale support */ #endif #endif #ifdef STDC_HEADERS /* This is for getopt.c and alloca.c (compiled with HAVE_CONFIG_H defined), to prevent diagnostics about various implicitly declared functions. */ #include <stdlib.h> #include <string.h> #endif #ifndef VMS_POSIX /* This if for random.c. */ #define gettimeofday vms_gettimeofday #ifndef __TIMEVAL #define __TIMEVAL 1 struct timeval { long tv_sec, tv_usec; }; #endif extern int gettimeofday(struct timeval *,void *); #endif #else /* awk.h, not POSIX */ /* some macros to redirect to code in vms/vms_misc.c */ #ifndef bcopy #define bcopy vms_bcopy #endif #define exit vms_exit #define open vms_open #define popen vms_popen #define pclose vms_pclose #define strerror vms_strerror #define strdup vms_strdup #define unlink vms_unlink #if defined(VAXC) || (defined(__GNUC__) && !defined(__alpha)) #define fstat(fd,sb) VMS_fstat(fd,sb) #endif extern void exit P((int)); extern int open P((const char *,int,...)); extern char *strerror P((int)); extern char *strdup P((const char *str)); extern int vms_devopen P((const char *,int)); # ifndef NO_TTY_FWRITE #define fwrite tty_fwrite #define fclose tty_fclose extern size_t fwrite P((const void *,size_t,size_t,FILE *)); extern int fclose P((FILE *)); # endif extern FILE *popen P((const char *,const char *)); extern int pclose P((FILE *)); extern void vms_arg_fixup P((int *,char ***)); /* some things not in STDC_HEADERS */ extern size_t gnu_strftime P((char *,size_t,const char *,const struct tm *)); extern int unlink P((const char *)); extern int getopt P((int,char **,char *)); extern int isatty P((int)); #ifndef fileno extern int fileno P((FILE *)); #endif extern int close P((int)); extern int dup P((int)); extern int dup2 P((int, int)); extern int read P((int, void *, int)); extern int getpgrp P((void)); extern void tzset P((void)); #endif /* not VMS_POSIX and not IN_CONFIG_H */ /*vms/redirect.h*/ --- NEW FILE: gawkmisc.vms --- /* * gawkmisc.vms --- miscellanious gawk routines that are OS specific. */ /* * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. * * GAWK 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. * * GAWK 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 */ char quote = '\''; char *defpath = DEFPATH; char envsep = ','; /* gawk_name --- pull out the "gawk" part from how the OS called us */ char * gawk_name(filespec) const char *filespec; { char *p, *q; /* "device:[root.][directory.subdir]GAWK.EXE;n" -> "GAWK" */ p = strrchr(filespec, ']'); /* directory punctuation */ q = strrchr(filespec, '>'); /* alternate <international> punct */ if (p == NULL || q > p) p = q; p = strdup(p == NULL ? filespec : (p + 1)); if ((q = strrchr(p, '.')) != NULL) *q = '\0'; /* strip .typ;vers */ return p; } /* os_arg_fixup --- fixup the command line */ void os_arg_fixup(argcp, argvp) int *argcp; char ***argvp; { (void) vms_arg_fixup(argcp, argvp); } /* os_devopen --- open special per-OS devices */ int os_devopen(name, flag) const char *name; int flag; { return vms_devopen(name, flag); } /* optimal_bufsize --- determine optimal buffer size */ size_t optimal_bufsize(fd, stb) int fd; struct stat *stb; { /* force all members to zero in case OS doesn't use all of them. */ memset(stb, '\0', sizeof(struct stat)); /* * These values correspond with the RMS multi-block count used by * vms_open() in vms/vms_misc.c. */ if (isatty(fd) > 0) return BUFSIZ; else if (fstat(fd, stb) < 0) return 8*512; /* conservative in case of DECnet access */ else return 32*512; } /* ispath --- return true if path has directory components */ int ispath(file) const char *file; { for (; *file; file++) { switch (*file) { case ':': case ']': case '>': case '/': return 1; } } return 0; } /* isdirpunct --- return true if char is a directory separator */ int isdirpunct(c) int c; { return (strchr(":]>/", c) != NULL); } /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; const char *name, *what, *dir; { /* no-op */ } /* os_isdir --- is this an fd on a directory? */ #if ! defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif int os_isdir(fd) int fd; { struct stat sbuf; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } /* os_is_setuid --- true if running setuid root */ int os_is_setuid() { return 0; } /* os_setbinmode --- set binary mode on file */ int os_setbinmode (fd, mode) int fd, mode; { return 0; } /* os_restore_mode --- restore the original mode of the console device */ void os_restore_mode (fd) int fd; { /* no-op */ return; } --- NEW FILE: vms_popen.c --- /* [.vms]vms_popen.c -- substitute routines for missing pipe calls. Copyright (C) 1991-1993, 1996 the 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 NO_VMS_PIPES #include "awk.h" /* really "../awk.h" */ #include <stdio.h> #ifndef PIPES_SIMULATED FILE * popen( const char *command, const char *mode ) { fatal(" Cannot open pipe `%s' (not implemented)", command); /* NOT REACHED */ return 0; } int pclose( FILE *current ) { fatal(" Internal error ('pclose' not implemented)"); /* NOT REACHED */ return -1; } int fork( void ) { fatal(" Internal error ('fork' not implemented)"); /* NOT REACHED */ return -1; } #else /*PIPES_SIMULATED*/ /* * Simulate pipes using temporary files; hope that the user * doesn't expect pipe i/o to be interleaved with other i/o ;-}. * * This was initially based on the MSDOS version, but cannot * use a static array to hold pipe info, because there's no * fixed limit on the range of valid 'fileno's. Another * difference is that redirection is handled using LIB$SPAWN * rather than constructing a command for system() which uses * '<' or '>'. */ #include "vms.h" #include <errno.h> #include <lnmdef.h> /* logical name definitions */ #ifndef STDC_HEADERS extern int strcmp P((const char*, const char *)); #endif extern char *mktemp P((char *)); static void push_logicals P((void)); static void pop_logicals P((void)); static Itm *save_translation P((const Dsc *)); static void restore_translation P((const Dsc *, const Itm *)); typedef enum { unopened = 0, reading, writing } pipemode; typedef struct pipe_info { char *command; char *name; pipemode pmode; } PIPE; static PIPE *pipes; static int pipes_lim = 0; #define psize(n) ((n) * sizeof(PIPE)) #define expand_pipes(k) do { PIPE *new_p; \ int new_p_lim = ((k) / _NFILE + 1) * _NFILE; \ emalloc(new_p, PIPE *, psize(new_p_lim), "expand_pipes"); \ if (pipes_lim > 0) \ memcpy(new_p, pipes, psize(pipes_lim)), free(pipes); \ memset(new_p + psize(pipes_lim), 0, psize(new_p_lim - pipes_lim)); \ pipes = new_p, pipes_lim = new_p_lim; } while(0) FILE * popen( const char *command, const char *mode ) { FILE *current; char *name; int cur; pipemode curmode; if (strcmp(mode, "r") == 0) curmode = reading; else if (strcmp(mode, "w") == 0) curmode = writing; else return NULL; /* make a name for the temporary file */ if ((name = mktemp(strdup("sys$scratch:gawk-pipe_XXXXXX.tmp"))) == 0) return NULL; if (curmode == reading) { /* an input pipe reads a temporary file created by the command */ vms_execute(command, (char *)0, name); /* 'command >tempfile' */ } if ((current = fopen(name, mode, "mbc=24", "mbf=2")) == NULL) { free(name); return NULL; } cur = fileno(current); if (cur >= pipes_lim) expand_pipes(cur); /* assert( cur >= 0 && cur < pipes_lim ); */ pipes[cur].name = name; pipes[cur].pmode = curmode; pipes[cur].command = strdup(command); return current; } int pclose( FILE *current ) { int rval, cur = fileno(current); /* assert( cur >= 0 && cur < pipes_lim ); */ if (pipes[cur].pmode == unopened) return -1; /* should never happen */ rval = fclose(current); /* close temp file; if reading, we're done */ if (pipes[cur].pmode == writing) { /* an output pipe feeds the temporary file to the other program */ rval = vms_execute(pipes[cur].command, pipes[cur].name, (char *)0); } /* clean up */ unlink(pipes[cur].name); /* get rid of the temporary file */ pipes[cur].pmode = unopened; free(pipes[cur].name), pipes[cur].name = 0; free(pipes[cur].command), pipes[cur].command = 0; return rval; } /* * Create a process and execute a command in it. This is essentially * the same as system() but allows us to specify SYS$INPUT (stdin) * and/or SYS$OUTPUT (stdout) for the process. * [With more work it could truly simulate a pipe using mailboxes.] */ int vms_execute( const char *command, const char *input, const char *output ) { Dsc cmd, in, out, *in_p, *out_p; U_Long sts, cmpltn_sts; cmd.len = strlen(cmd.adr = (char *)command); if (input) in.len = strlen(in.adr = (char *)input), in_p = ∈ else in_p = 0; if (output) out.len = strlen(out.adr = (char *)output), out_p = &out; else out_p = 0; push_logicals(); /* guard against user-mode definitions of sys$Xput */ sts = lib$spawn(&cmd, in_p, out_p, (U_Long *)0, (Dsc *)0, (U_Long *)0, &cmpltn_sts); pop_logicals(); /* restore environment */ if (vmswork(sts) && vmsfail(cmpltn_sts)) sts = cmpltn_sts; if (vmsfail(sts)) { errno = EVMSERR, vaxc$errno = sts; return -1; } else return 0; } /*----* This rigmarole is to guard against interference from the current environment. User-mode definitions of SYS$INPUT and/or SYS$OUTPUT will interact with spawned subprocesses--including LIB$SPAWN with explicit input and/or output arguments specified--if they were defined without the 'CONFINED' attribute. The definitions created in vms_args.c as part of command line I/O redirection happened to fall into this category :-(, but even though that's been fixed, there's still the possibility of the user doing something like |$ define/user sys$output foo.out prior to starting the program. Without ``/name_attr=confine'', that will really screw up pipe simulation, so we've got to work- around it here. This is true whether pipes are implemented via mailboxes or temporary files, as long as lib$spawn() is being used. push_logicals() calls save_translation() the first time it's invoked; the latter allocates some memory to hold a full logical name translation and uses $trnlnm to fill that in. Then if either sys$input or sys$output has a user-mode, non-confined translation, push_logicals() will delete the definition(s) using $dellnm. After the spawned command has returned, pop_logicals() is called; it calls restore_translation() for any deleted values; the latter uses $crllnm or $crelog to recreate the original definition. SYS$ERROR is currently ignored; perhaps it should receive the same treatment... *----*/ /* logical name table, and names of interest; these are all constant */ static const Descrip(lnmtable,"LNM$PROCESS_TABLE"); static const Descrip(sys_input,"SYS$INPUT"); static const Descrip(sys_output,"SYS$OUTPUT"); static const unsigned char acmode = PSL$C_USER; /* only care about user-mode */ /* macros for simplfying the code a bunch */ #define DelTrans(l) sys$dellnm(&lnmtable, (l), &acmode) #define GetTrans(l,i) sys$trnlnm((U_Long *)0, &lnmtable, (l), &acmode, (i)) #define SetTrans(l,i) sys$crelnm((U_Long *)0, &lnmtable, (l), &acmode, (i)) /* itemlist manipulation macros; separate versions for aggregate and scalar */ #define SetItmA(i,c,p,r) ((i).code = (c), (i).len = sizeof (p),\ (i).buffer = (p), (i).retlen = (U_Short *)(r)) #define SetItmS(i,c,p) ((i).code = (c), (i).len = sizeof *(p),\ (i).buffer = (p), (i).retlen = (U_Short *)0) #define EndItm0(i) ((i).code = (i).len = 0) /* translate things once, then hold the results here for multiple re-use */ static Itm *input_definition, *output_definition; static void push_logicals( void ) /* deassign sys$input and/or sys$output */ { static int init_done = 0; if (!init_done) { /* do logical name lookups one-time only */ input_definition = save_translation(&sys_input); output_definition = save_translation(&sys_output); init_done = 1; } if (input_definition) DelTrans(&sys_input); /* kill sys$input */ if (output_definition) DelTrans(&sys_output); /* and sys$output */ } static void pop_logicals( void ) /* redefine sys$input and/or sys$output */ { if (input_definition) restore_translation(&sys_input, input_definition); if (output_definition) restore_translation(&sys_output, output_definition); } static Itm * save_translation( const Dsc *logname ) { Itm trans[4], *itmlst; long trans_attr, max_trans_indx; /* 0-based translation index count */ unsigned char trans_acmode; /* translation's access mode */ unsigned itmlst_size; register int i, j; itmlst = 0; /* Want translation index count for non-confined, user-mode definition; unfortunately, $trnlnm does not provide that much control. Try to fetch several values of interest, then decide based on the result. */ SetItmS(trans[0], LNM$_MAX_INDEX, &max_trans_indx), max_trans_indx = -1; SetItmS(trans[1], LNM$_ACMODE, &trans_acmode), trans_acmode = 0; SetItmS(trans[2], LNM$_ATTRIBUTES, &trans_attr), trans_attr = 0; EndItm0(trans[3]); if (vmswork(GetTrans(logname, trans)) && max_trans_indx >= 0 && trans_acmode == PSL$C_USER && !(trans_attr & LNM$M_CONFINE)) { /* Now know that definition of interest exists; allocate and initialize an item list and associated buffers; use three entries for each translation. */ itmlst_size = (3 * (max_trans_indx + 1) + 1) * sizeof(Itm); emalloc(itmlst, Itm *, itmlst_size, "save_translation"); for (i = 0; i <= max_trans_indx; i++) { struct def { U_Long indx, attr; U_Short len; char str[LNM$C_NAMLENGTH], eos; } *wrk; emalloc(wrk, struct def *, sizeof (struct def), "save_translation"); wrk->indx = (U_Long)i; /* this one's an input value for $trnlnm */ SetItmS(itmlst[3*i+0], LNM$_INDEX, &wrk->indx); SetItmS(itmlst[3*i+1], LNM$_ATTRIBUTES, &wrk->attr), wrk->attr = 0; SetItmA(itmlst[3*i+2], LNM$_STRING, &wrk->str, &wrk->len), wrk->len = 0; } EndItm0(itmlst[3*i]); /* assert( i == max_trans_indx+1 ); */ /* Time to perform full logical name translation, then update item list for subsequent restoration. If there are any holes [don't know whether that's possible] collapse them out of the list; don't want them at restore time. */ if (vmswork(GetTrans(logname, itmlst))) { for (i = 0, j = -1; i <= max_trans_indx; i++) { U_Long *attr_p; attr_p = itmlst[3*i+1].buffer; /* copy (void *) to true type */ if (*attr_p & LNM$M_EXISTS) { *attr_p &= ~LNM$M_EXISTS; /* must clear this bit */ if (++j < i) itmlst[3*j+0] = itmlst[3*i+0], itmlst[3*j+1] = itmlst[3*i+1], itmlst[3*j+2] = itmlst[3*i+2]; if (itmlst[3*j+2].retlen) { /* fixup buffer length */ itmlst[3*j+2].len = *itmlst[3*j+2].retlen; itmlst[3*j+2].retlen = (U_Short *)0; } } } if (++j < i) EndItm0(itmlst[3*j]); } else /* should never happen; tolerate potential memory leak */ free(itmlst), itmlst = 0; /*('wrk' buffer(s) will become lost)*/ } return itmlst; } static void restore_translation( const Dsc *logname, const Itm *itemlist ) { Dsc trans_val; U_Long *attr_p; # define LOG_PROCESS_TABLE 2 /* <obsolete> */ # define LOG_USERMODE PSL$C_USER /* assert( itemlist[1].code == LNM$_ATTRIBUTES ); */ attr_p = itemlist[1].buffer; /* copy (void *) to (U_Long *) */ if (*attr_p & LNM$M_CRELOG) { /* check original creation method */ /* $crelog values can have only one translation; so it'll be the first string entry in the itemlist. */ /* assert( itemlist[2].code == LNM$_STRING ); */ trans_val.adr = itemlist[2].buffer; trans_val.len = itemlist[2].len; (void) sys$crelog(LOG_PROCESS_TABLE, logname, &trans_val, LOG_USERMODE); } else { /* $crelnm definition; itemlist could specify multiple translations, but has already been setup properly for use as-is. */ (void) SetTrans(logname, itemlist); } } #endif /*PIPES_SIMULATED*/ #endif /*!NO_VMS_PIPES*/ --- NEW FILE: vms_misc.c --- /* vms_misc.c -- sustitute code for missing/different run-time library routines. Copyright (C) 1991-1993, 1996-1997, 2001, 2003 the 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. */ #define creat creat_dummy /* one of gcc-vms's headers has bad prototype */ #include "awk.h" #include "vms.h" #undef creat #include <fab.h> #ifndef O_RDONLY #include <fcntl.h> #endif #include <rmsdef.h> #include <ssdef.h> #include <stsdef.h> /* * VMS uses a completely different status scheme (odd => success, * even => failure), so we'll trap calls to exit() and alter the * exit status code. [VAXC can't handle this as a macro.] */ #ifdef exit # undef exit #endif void vms_exit( int final_status ) { exit(final_status == 0 ? SS$_NORMAL : (SS$_ABORT | STS$M_INHIB_MSG)); } #define exit(v) vms_exit(v) /* * In VMS's VAXCRTL, strerror() takes an optional second argument. * #define strerror(errnum) strerror(errnum,vaxc$errno) * is all that's needed, but VAXC can't handle that (gcc can). * [The 2nd arg is used iff errnum == EVMSERR.] */ #ifdef strerror # undef strerror #endif extern char *strerror P((int,...)); /* vms_strerror() -- convert numeric error code into text string */ char * vms_strerror( int errnum ) { return ( errnum != EVMSERR ? strerror(errnum) : strerror(EVMSERR, vaxc$errno) ); } # define strerror(v) vms_strerror(v) /* * Miscellaneous utility routine, not part of the run-time library. */ /* vms_strdup() - allocate some new memory and copy a string into it */ char * vms_strdup( const char *str ) { char *result; int len = strlen(str); emalloc(result, char *, len+1, "strdup"); return strcpy(result, str); } /* * VAXCRTL does not contain unlink(). This replacement has limited * functionality which is sufficient for GAWK's needs. It works as * desired even when we have the file open. */ /* unlink(file) -- delete a file (ignore soft links) */ int unlink( const char *file_spec ) { char tmp[255+1]; /*(should use alloca(len+2+1)) */ extern int delete(const char *); strcpy(tmp, file_spec); /* copy file name */ if (strchr(tmp, ';') == NULL) strcat(tmp, ";0"); /* append version number */ return delete(tmp); } /* * Work-around an open(O_CREAT+O_TRUNC) bug (screwed up modification * and creation dates when new version is created), and also use some * VMS-specific file options. Note: optional 'prot' arg is completely * ignored; gawk doesn't need it. */ #ifdef open # undef open #endif extern int creat P((const char *,int,...)); extern int open P((const char *,int,unsigned,...)); /* vms_open() - open a file, possibly creating it */ int vms_open( const char *name, int mode, ... ) { int result; if (STREQN(name, "/dev/", 5)) { /* (this used to be handled in vms_devopen(), but that is only called when opening files for output; we want it for input too) */ if (strcmp(name + 5, "null") == 0) /* /dev/null -> NL: */ name = "NL:"; else if (strcmp(name + 5, "tty") == 0) /* /dev/tty -> TT: */ name = "TT:"; } if (mode == (O_WRONLY|O_CREAT|O_TRUNC)) { /* explicitly force stream_lf record format to override DECC$SHR's defaulting of RFM to earlier file version's when one is present */ result = creat(name, 0, "rfm=stmlf", "shr=nil", "mbc=32"); } else { struct stat stb; const char *mbc, *shr = "shr=get", *ctx = "ctx=stm"; if (stat((char *)name, &stb) < 0) { /* assume DECnet */ mbc = "mbc=8"; } else { /* ordinary file; allow full sharing iff record format */ mbc = "mbc=32"; if ((stb.st_fab_rfm & 0x0F) < FAB$C_STM) shr = "shr=get,put,upd"; } result = open(name, mode, 0, shr, mbc, "mbf=2"); } /* This is only approximate; the ACP -> RMS -> VAXCRTL interface discards too much potentially useful status information... */ if (result < 0 && errno == EVMSERR && (vaxc$errno == RMS$_ACC || vaxc$errno == RMS$_CRE)) errno = EMFILE; /* redirect() should close 1 file & try again */ return result; } /* * Check for attempt to (re-)open known file. */ /* vms_devopen() - check for "SYS$INPUT" or "SYS$OUTPUT" or "SYS$ERROR" */ int vms_devopen( const char *name, int mode ) { FILE *file = NULL; if (strncasecmp(name, "SYS$", 4) == 0) { name += 4; /* skip "SYS$" */ if (strncasecmp(name, "INPUT", 5) == 0 && (mode & O_WRONLY) == 0) file = stdin, name += 5; else if (strncasecmp(name, "OUTPUT", 6) == 0 && (mode & O_WRONLY) != 0) file = stdout, name += 6; else if (strncasecmp(name, "ERROR", 5) == 0 && (mode & O_WRONLY) != 0) file = stderr, name += 5; if (*name == ':') name++; /* treat trailing colon as optional */ } /* note: VAXCRTL stdio has extra level of indirection (*file) */ return (file && *file && *name == '\0') ? fileno(file) : -1; } #define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */ #define UNIX_EPOCH "01-JAN-1970 00:00:00.00" extern U_Long sys$bintim(), sys$gettim(); extern U_Long lib$subx(), lib$ediv(); /* * Get current time in microsecond precision. */ /* vms_gettimeofday() - get current time in `struct timeval' format */ int vms_gettimeofday(struct timeval *tv, void *timezone__not_used) { /* Emulate unix's gettimeofday call; timezone argument is ignored. */ static const Dsc epoch_dsc = { sizeof UNIX_EPOCH - sizeof "", UNIX_EPOCH }; static long epoch[2] = {0L,0L}; /* needs one time initialization */ const long thunk = VMS_UNITS_PER_SECOND; long now[2], quad[2]; if (!epoch[0]) sys$bintim(&epoch_dsc, epoch); /* 1 Jan 0:0:0 1970 */ /* get current time, as VMS quadword time */ sys$gettim(now); /* convert the quadword time so that it's relative to Unix epoch */ lib$subx(now, epoch, quad); /* quad = now - epoch; */ /* convert 1e-7 units into seconds and fraction of seconds */ lib$ediv(&thunk, quad, &tv->tv_sec, &tv->tv_usec); /* convert fraction of seconds into microseconds */ tv->tv_usec /= (VMS_UNITS_PER_SECOND / 1000000); return 0; /* success */ } #ifndef VMS_V7 /* * VMS prior to V7.x has no timezone support unless DECnet/OSI is used. */ /* these are global for use by missing/strftime.c */ char *tzname[2] = { "local", "" }; int daylight = 0, timezone = 0, altzone = 0; /* tzset() -- dummy to satisfy linker */ void tzset(void) { return; } #endif /*VMS_V7*/ #ifndef CRTL_VER_V731 /* getpgrp() -- there's no such thing as process group under VMS; * job tree might be close enough to be useful though. */ int getpgrp(void) { return 0; } #endif #ifndef __GNUC__ void vms_bcopy( const char *src, char *dst, int len ) { (void) memcpy(dst, src, len); } #endif /*!__GNUC__*/ /*----------------------------------------------------------------------*/ #ifdef NO_VMS_ARGS /* real code is in "vms/vms_args.c" */ void vms_arg_fixup( int *argc, char ***argv ) { return; } /* dummy */ #endif #ifdef NO_VMS_PIPES /* real code is in "vms/vms_popen.c" */ FILE *popen( const char *command, const char *mode ) { fatal(" Cannot open pipe `%s' (not implemented)", command); return NULL; } int pclose( FILE *current ) { fatal(" Cannot close pipe #%d (not implemented)", fileno(current)); return -1; } int fork( void ) { fatal(" Cannot fork process (not implemented)"); return -1; } #endif /*NO_VMS_PIPES*/ /*----------------------------------------------------------------------*/ /* * The following code is taken from the GNU C preprocessor (cccp.c, * 2.8.1 vintage) where it was used #if VMS. It is only needed for * VAX C and GNU C on VAX configurations; DEC C's run-time library * doesn't have the problem described. * * VMS_fstat() and VMS_stat() were static in cccp.c but need to be * accessible to the whole program here. Also, the special handling * for the null device has been introduced for gawk's benefit, to * prevent --lint mode from giving spurious warnings about /dev/null * being empty if it's used as an input file. */ #if defined(VAXC) || (defined(__GNUC__) && !defined(__alpha)) /* more VMS hackery */ #include <fab.h> #include <nam.h> extern unsigned long sys$parse(), sys$search(); /* Work around a VAXCRTL bug. If a file is located via a searchlist, and if the device it's on is not the same device as the one specified in the first element of that searchlist, then both stat() and fstat() will fail to return info about it. `errno' will be set to EVMSERR, and `vaxc$errno' will be set to SS$_NORMAL due yet another bug in stat()! We can get around this by fully parsing the filename and then passing that absolute name to stat(). Without this fix, we can end up failing to find header files, which is bad enough, but then compounding the problem by reporting the reason for failure as "normal successful completion." */ #undef fstat /* Get back to the library version. */ int VMS_fstat (fd, statbuf) int fd; struct stat *statbuf; { int result = fstat (fd, statbuf); if (result < 0) { FILE *fp; char nambuf[NAM$C_MAXRSS+1]; if ((fp = fdopen (fd, "r")) != 0 && fgetname (fp, nambuf) != 0) result = VMS_stat (nambuf, statbuf); /* No fclose(fp) here; that would close(fd) as well. */ } if (result == 0 /* GAWK addition; fixup /dev/null flags */ && (statbuf->st_mode & S_IFREG) && STREQ(statbuf->st_dev, "_NLA0:")) { statbuf->st_mode &= ~S_IFREG; statbuf->st_mode |= S_IFCHR; } return result; } int VMS_stat (name, statbuf) const char *name; struct stat *statbuf; { int result = stat (name, statbuf); if (result < 0) { struct FAB fab; struct NAM nam; char exp_nam[NAM$C_MAXRSS+1], /* expanded name buffer for sys$parse */ res_nam[NAM$C_MAXRSS+1]; /* resultant name buffer for sys$search */ fab = cc$rms_fab; fab.fab$l_fna = (char *) name; fab.fab$b_fns = (unsigned char) strlen (name); fab.fab$l_nam = (void *) &nam; nam = cc$rms_nam; nam.nam$l_esa = exp_nam, nam.nam$b_ess = sizeof exp_nam - 1; nam.nam$l_rsa = res_nam, nam.nam$b_rss = sizeof res_nam - 1; nam.nam$b_nop = NAM$M_PWD | NAM$M_NOCONCEAL; if (sys$parse (&fab) & 1) { if (sys$search (&fab) & 1) { res_nam[nam.nam$b_rsl] = '\0'; result = stat (res_nam, statbuf); } /* Clean up searchlist context cached by the system. */ nam.nam$b_nop = NAM$M_SYNCHK; fab.fab$l_fna = 0, fab.fab$b_fns = 0; (void) sys$parse (&fab); } } if (result == 0 /* GAWK addition; fixup /dev/null flags */ && (statbuf->st_mode & S_IFREG) && STREQ(statbuf->st_dev, "_NLA0:")) { statbuf->st_mode &= ~S_IFREG; statbuf->st_mode |= S_IFCHR; } return result; } #endif /* VAXC || (__GNUC__ && !__alpha) */ --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Mon May 23 20:54:31 2005 Pat Rankin <ra...@pa...> * vms_gawk.c [gawk_cmd, #if __ia64__]: Switch from globalvalue to strict_refdef and then take gawk_cmd's address during use. * vmstest.com (concat1, longsub, arrayprm2, arrayprm3, arryref2, arryref3, arryref4, arryref5, aryprm1, aryprm2, aryprm3, aryprm4, aryprm5, aryprm6, aryprm7, aryprm8, concat2, concat3, delarpm2, delfunc, exitval2, fmttest, fnarray2, fnmisc, fordel, getline3, gsubasgn, gsubtest, gsubtst2, gsubtst4, gsubtst5, hex, inputred, iobug1, manglprm, nested, nfneg, noloop1, noloop2, nulrsend, prec, prtoeval, rstest1, rstest2, rstest3, rstest4, rstest5, scalar, sortempty, splitarr, strcat1, subsepnm, synerr1, uninit2, uninit3, uninit4, uninitialized, unterm, wjposer1, zeroe0): New tests. Wed May 18 21:22:09 2005 Pat Rankin <ra...@pa...> * vms_gawk.c [#if __ia64__]: Use #pragma extern_model globalvalue for the declaration of gawk_cmd. Mon May 9 21:17:33 2005 Pat Rankin <ra...@pa...> * vms-conf.h [#if DECC]: Use #pragma to suppress "new feature in C99" diagnostic for structure field designator style initialization in regexec.c. Thu May 5 21:17:48 2005 Anders Wallin <and...@ya...> * vms_gawk.c [__ia64__]: Change to lower case, then Itanium VMS is happy. Sun May 1 08:20:00 2005 Pat Rankin <ra...@pa...> * vms_gawk.c [gawk_cmd]: Declare as ordinary data symbol rather than as a fake routine for Itanium. (Can't do that for other configurations without getting tangled up in compiler-specific details like `#pragma extern_model' and VAX C's `globalref'.) Fri Mar 4 20:46:20 2005 Pat Rankin <ra...@pa...> * vms-conf.h: Define VAXCRTL when appropriate; used in builtin.c. Sat Feb 19 20:13:28 2005 Pat Rankin <ra...@pa...> * vms-conf.h [RE_TOKEN_INIT_BUG]: Define for regcomp.c. Wed Feb 16 20:45:21 2005 Pat Rankin <ra...@pa...> * vms-conf.h [NO_MBSUPPORT]: Define when compiling with VAX C. [inline]: Define as empty when compiling with VAX C. Thu Jan 20 19:09:52 2005 Pat Rankin <ra...@pa...> * vms-conf.h: Synchronize with configh.in. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Mon Jun 14 18:40:22 2004 Pat Rankin <ra...@pa...> * descrip.mms (dfa.c, dfa.h): reinstate these. (gettext.h, mbsupport.h): add these. (patchlev.h): remove this. * vmstest.com (longwrds): customize it. (getline, getline2): replace getline with getline2. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Mon Jun 9 22:15:40 2003 Pat Rankin <ra...@pa...> * vms-conf.h: Synchronize with current configh.in. ALLOW_SWITCH: Define this to enable new `switch' feature. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Thu Feb 27 17:54:33 2003 Pat Rankin <ra...@pa...> * descrip.mms: Revert regex compilation to single file. vmsbuild.com: Likewise. Thu Feb 20 18:06:54 2003 Pat Rankin <ra...@pa...> * vms_gawk.c (vms_gawk): Don't check for `RUNUSED' status because it gets a false match when gawk is invoked via fork+exec. * gawk.hlp: Limited updates to the release notes section. Tue Feb 4 14:28:06 2003 Arnold D. Robbins <ar...@sk...> All relevant files: Copyright year updated to 2003. Mon Feb 3 20:37:09 2003 Pat Rankin <ra...@pa...> * vms-conf.h (ssize_t): Define as int. (TIME_T_UNSIGNED): New macro; used in strftime. * vms_cli.c (Cli_Parse_Command): Increase command buffer size from 2.5Kb to 8Kb. From Steve Pitcher: * vms_gawk.c (vms_gawk): Don't report "missing required element" for INSFPRM status unless invoked via a native DCL verb. From Jouk Jansen: * vms-conf.h (CRTL_VER_V731): New macro. * vms_misc.c (getpgrp): Use it. Mon Dec 23 16:53:42 2002 Pat Rankin <ra...@pa...> * descrip.mms (AWKOBJ1, AWKOBJ2): Split AWKOBJS into pieces to avoid line length overflow when creating gawk.opt. (regcomp.obj, regexec.obj, regex_internal.obj): New targets. * vmsbuild.com: Likewise. Thu Nov 21 19:45:08 2002 Pat Rankin <ra...@pa...> * descrip.mms: Update to reflect regex changes; eliminate dfa. * vmstest.com (exit_code): Hack to add "EXIT CODE n" record to output for tests that trigger gawk failure. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Wed Apr 17 15:57:30 2002 Pat Rankin <ra...@eq...> * vmstest.com (forsimp, concat1, longsub): New Tests. (strftime): Revamp test to avoid use of defunct %v extension. Sat Dec 22 19:18:31 2001 Pat Rankin <ra...@eq...> * redirect.h (tzset): Declare. Sun Jun 3 13:04:44 2001 Arnold D. Robbins <ar...@sk...> * Release 3.1.0: Release tar file made. And there was rejoicing. Thu Apr 12 18:29:50 2001 Pat Rankin <ra...@eq...> * vms_misc.c (open): Add handling for /dev/null and /dev/tty. (vms_devopen): Remove handling for /dev/null and /dev/tty. * vms_misc.c (VMS_stat, VMS_fstat): New functions to work around old VAXCRTL bugs. * redirect.h (fstat): Define as VMS_fstat for VAX C or GNU C. * vms-conf.h (HAVE_UNISTD_H): Avoid <unistd.h> for GNU C. * descrip.mms: Synchronize with 3.1.0 sources. * vmstest.com: Add many new tests. (fixup_LRL): New subroutine. Thu Apr 5 20:31:22 2001 Pat Rankin <ra...@eq...> * vms-conf.h: synchronize with current configh.in. [NO_ALLOCA]: define instead of C_ALLOCA. * redirect.h (strcoll): substitute strcmp for VAXCRTL config. (struct timeval): define. (gettimeofday): substitute vms_gettimeofday; declare. * vms_misc.c (vms_gettimeofday): new function. * vms_fwrite.c [#if NO_ALLOCA]: fix fake alloca's use of free(). * vmsbuild.com: synchronize with current sources. Sun Jan 28 15:50:02 2001 Eli Zaretskii <el...@is...> * gawkmisc.vms (os_restore_mode): New function Sun Dec 3 16:53:37 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.vms (os_setbinmode): new function. Tue Nov 7 14:09:14 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.vms (os_is_setuid): new function. Wed Jul 30 19:53:52 1997 Arnold D. Robbins <ar...@gn...> * Close-on-exec changes: gawkmisc.vms: (os_close_on_exec, os_isdir): new functions. Mon Aug 7 15:23:00 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.6: Release tar file made. Sat Jul 15 20:52:09 2000 Pat Rankin <ra...@eq...> * vmstest.com (printf1, fusmnam, fnamedat, numindex, subslash, opasnslf, opasnidx, arynocls, getlnbuf, arysubnm, fnparydl): New basic tests. (igncdym): New gawk.extensions test. (nondec): Old gawk.extensions test commented out. Sun Jun 25 15:08:19 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.5: Release tar file made. Wed Jun 30 16:14:36 1999 Arnold D. Robbins <ar...@gn...> * Release 3.0.4: Release tar file made. This time for sure. Fri May 7 20:29:04 1999 Pat Rankin <ra...@eq...> * vms-conf.h (__CRTL_VER): Add same override as __VMS_VER. Wed May 5 19:10:15 1999 Pat Rankin <ra...@eq...> * vmstest.com (nasty, zeroflag, getnr2tm, getnr2tb): New tests. Wed Nov 25 17:24:26 1998 Pat Rankin <ra...@eq...> * vmstest.com (vms_tests): New general target. (vms_io1): New specific test. Thu May 15 12:49:08 1997 Arnold D. Robbins <ar...@sk...> * Release 3.0.3: Release tar file made. Mon May 12 18:39:30 1997 Pat Rankin <ra...@eq...> * vmstest.com (delarprm, prdupval): new `basic' tests. (nondec): new `gawk.extensions' test (commented out for now). (reint): move from `basic' to `gawk.extensions'. Mon May 5 21:40:07 1997 Pat Rankin <ra...@eq...> * vmstest.com (clobber): new `basic' test. (pid): new test, replacing `specfile'. (pipeio2): new for `unix-tests'; can't execute this one under VMS. Mon May 5 21:23:52 1997 Pat Rankin <ra...@eq...> * vms_args.c (vms_arg_fixup): for the 2>&1 case, don't set the output filename to "sys$error" because that results in an extra empty file being created. * vms_misc.c (vms_open): explicitly specify stream_lf format when creating files rather than letting DECC$SHR make a new file inherit its record format from any earlier version of that file. Suggested by Pete Cascio <pe...@rm...>: * vms_misc.c (vms_open): use full record sharing options when reading any record-oriented file, regardless of its organization. Mon Apr 21 19:22:12 1997 Pat Rankin <ra...@eq...> * vmstest.com (funstack): new `basic' test. (reint): add missing entry to `basic'. (pipeio1, specfile, strftlng): move from `basic' to `unix-tests'. (childin): skip due to known failure. (specfile): skip due to potentially confusing feedback. Thu Apr 24 23:18:04 1997 Arnold D. Robbins <ar...@sk...> * vms_popen.c, vms_misc.c, vms_gawk.c, vms_fwrite.c, vms_args.c: moved to generic GPL statement at top. Fri Apr 18 07:55:47 1997 Arnold D. Robbins <ar...@sk...> * BETA Release 3.0.34: Release tar file made. Wed Apr 2 18:17:30 1997 Pat Rankin <ra...@eq...> * descrip.mms, vmsbuild.com (PATCHLVL): update to 3. * vmstest.com (nlfldsep, splitvar, intest, nfldstr, nors, fnarydel, noparms, pipeio1): new tests. Wed Jan 15 15:21:01 1997 Pat Rankin <ra...@eq...> * redirect.h (stat, fstat): do not declare these functions; rely on <stat.h> to do so. There are too many DEC C version variants to handle otherwise. From Martin Zinser <zi...@ax...>: * descrip.mms (gawk.dvi): update to build in [.doc] directory using texindex.c retained from an earlier gawk 2.x distribution. (texindex.exe): don't assume VAX C. Wed Dec 25 11:25:22 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.2: Release tar file made. Mon Dec 23 20:51:27 1996 Pat Rankin <ra...@eq...> * vms_misc.c (vms_bcopy): `bcopy' is defined as this in redirect.h. Thu Dec 19 17:49:31 1996 Pat Rankin <ra...@eq...> * redirect.h (strcasecmp, strncasecmp, tzset, tzname, daylight, timezone, altzone, bcopy, popen, pclose, unlink): New macros to avoid conflict with VMS V7.x DECC$SHR symbols. (close, dup, dup2, read): Declare with full prototypes. (fstat, stat): Ditto, and guard against conflicting DEC C declarations (which might have trailing elipsis). * vms_misc.c (tzset, tzname, daylight, timezone, altzone): Suppress these if compiled with VMS_V7 defined [not supported]. Mon Dec 16 14:32:08 1996 Pat Rankin <ra...@eq...> * vms_popen (popen): Delete unprototyped declaration of strcmp() to avoid conflict with a strcmp macro in DEC C V5.0 header files. Tue Dec 10 23:09:26 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.1: Release tar file made. Fri Dec 6 20:55:57 1996 Pat Rankin <ra...@eq...> * redirect.h, vms-conf.h: Refine Sep 20th change: include <stdlib.h> and <string.h> in redirect.h rather than vms-conf.h so that it occurs for VMS POSIX as well as for normal VMS. Wed Nov 20 15:47:02 1996 Pat Rankin <ra...@eq...> * descrip.mms (LIBOBJS): Rename from GNUOBJS; add random.obj. (LIBSRC): Rename from GNUSRC; add random.c. (AWKSRC): Add random.h. (random.obj, builtin.obj): Depend upon random.h. * vmsbuild.com: compile random.c, link random.obj. * vmstest.com (childin): Split message about expected failure in order to avoid consecutive tick marks in the quoted string. Wed Nov 13 15:32:58 1996 Pat Rankin <ra...@eq...> * vmstest.com: New file to execute test suite. Fri Nov 8 18:29:42 1996 Pat Rankin <ra...@eq...> Revise makefiles so that no editing should be needed. * descrip.mms: Use DEC C as the default compiler, since the same compile and link options for it can be used as-is on both VAX and Alpha. (GNUC, VAXC): New `make' macros for specifying an alternate compiler on the MMS or MMK command line. (PATCHLVL): Update to 1. * vmsbuild.com: Make the equivalent changes. Mon Oct 28 17:02:39 1996 Pat Rankin <ra...@eq...> * vms.h (U_Long, U_Short): Replace u_long and u_short typedefs. * vms_*.c: Use them. * vms.h, vms_*.c: Change SYS$ and LIB$ routines to lower case equivalents; fully prototype sys$ and lib$ routines rather than just declare them. Fri Sep 20 17:33:05 1996 Pat Rankin <ra...@eq...> * vms-conf.h: directly include <stdlib.h> and <string.h>. * vms-conf.h (strftime): delete this macro. * redirect.h (strftime): define it here instead. Fri May 17 09:08:16 1996 Arnold Robbins <ar...@sk...> * gawkmisc.vms (envsep): Now initialized to ',' instead of ':', per email from Pat Rankin. Thu Jan 11 15:20:14 1996 Pat Rankin <ra...@eq...> * vms-conf.h [#if __DECC]: Changes to support V5.x of DEC C. (_DECC_V4SOURCE, __SOCKET_TYPEDEFS): Define these to avoid duplicate u_long and u_short typedefs. (__VMS_VER): If value indicates VMS V6.2 or later, redefine it to indicate V6.1 in order to avoid conflicting prototype for getopt. Wed Jan 10 22:58:55 1996 Arnold D. Robbins <ar...@sk...> * ChangeLog created. --- NEW FILE: fcntl.h --- /* "fcntl.h" -- constants for BSD-style I/O routines (ala VAX C's <file.h>) */ #define O_RDONLY 0 #define O_WRONLY 1 #define O_RDWR 2 #define O_NDELAY 4 #define O_NOWAIT 4 #define O_APPEND 8 #define O_CREAT 0x0200 #define O_TRUNC 0x0400 #define O_EXCL 0x0800 --- NEW FILE: unixlib.h --- /* "unixlib.h" -- limited substitute for VAX C V3.x's <unixlib.h>, * for use with VAX C V2.x and/or GNU C when building gawk. */ /* declare the global environ[] array */ #ifdef VAXC extern char noshare **environ; #else # ifdef __GNUC__ # define environ $$PsectAttributes_NOSHR$$environ # endif extern char **environ; #endif /* miscellaneous Unix emulation routines available in VAXCRTL */ char *getenv(), *getcwd(); char *ecvt(), *fcvt(), *gcvt(); int getpid(), getppid(); unsigned getuid(); #ifndef _stdlib_h /* gcc's stdlib.h has these with conflicting types */ unsigned getgid(), getegid(), geteuid(); #endif int setgid(), setuid(); /* no-ops */ --- NEW FILE: gawk.hlp --- ! Gawk.Hlp ! Pat Rankin, Jun'90 ! revised, Jun'91 ! revised, Jul'92 ! revised, Jan'95 ! revised, Apr'97 ! revised, Jan'03 ! Online help for GAWK. ! 1 GAWK GAWK is GNU awk, the Free Software Foundation's implementation of the awk programming language. awk is an interpretive language which can handle many data-reformatting jobs with just a few lines of code. It has powerful string manipulation and pattern matching capabilities built in. This version is compatible with POSIX 1003.2 awk. The VMS version of GAWK supports both the original UN*X-style command interface and a DCL interface. The only setup requirement for GAWK is to define it as a 'foreign' command: a DCL symbol with a value [...1215 lines suppressed...] Handling of '\' on command line modified; no longer necessary to double it up Problem redirecting stderr (>&efile) at same time as stdin (<ifile) or stdout (>ofile) has been fixed ``2>&1'' and ``1>&2'' redirection constructs added Interaction between command line I/O redirection and gawk pipes fixed; also, name used for pseudo-pipe temporary file expanded 3 license GAWK is covered by the "GNU General Public License", the gist of which is that if you supply this software to a third party, you are expressly forbidden to prevent them from supplying it to a fourth party, and if you supply binaries you must make the source code available to them at no additional cost. Any revisions or modified versions are also covered by the same license. There is no warranty, express or implied, for this software. It is provided "as is." [Disclaimer: This is just an informal summary with no legal basis; refer to the actual GNU General Public License for specific details.] !2 examples ! --- NEW FILE: vms_fwrite.c --- /* vms_fwrite.c - augmentation for the fwrite() function. Copyright (C) 1991-1996 the 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. */ #include "awk.h" /* really "../awk.h" */ #ifndef NO_TTY_FWRITE #include "vms.h" #include <stdio.h> #include <errno.h> #ifdef VAXC_BUILTINS #pragma builtins /* VAXC V3.0 & up */ # define find_c(s,n,c) ((n) - _LOCC((c),(n),(s))) #else /*VAXC_BUILTINS*/ static int find_c( const char *s, int n, char c ) { register const char *t = (const char *)memchr(s, c, n); return (t == 0 ? n : t - s); /* 0..n-1, or n if not found */ } #endif /*VAXC_BUILTINS*/ #define is_stdout(file_no) ((file_no) == 1) /* fileno(stdout) */ #define is_stderr(file_no) ((file_no) == 2) /* fileno(stderr) */ #define PREFIX_CR 0x008D0000 /* leading carriage return */ #define POSTFIX_CR 0x8D000000 /* trailing carriage return (=> lf/cr) */ static short channel[_NFILE] = {0}; static FILE *prev_file = 0; static int prev_file_num; /* * VAXCRTL's fwrite() seems to flush after every character when * writing to a terminal. This routine is a limited functionality * substitute that is *much* faster. However, calls to fwrite() * should not be mixed with other stdio calls to the same file * unless fflush() is always called first. Also, this routine * will not detect that a freopen() call has finished with the * original terminal; tty_fclose() should be used to close a file. */ #ifdef fwrite # undef fwrite #endif /* tty_fwrite() - performance hack for fwrite() to a terminal */ size_t tty_fwrite( const void *buf, size_t size, size_t number, FILE *file ) { static long evfn = -1; short chan; int file_num, result; if (!size || !number) return 0; else if (!file || !*file) return 0 * (errno = EBADF); /* kludge alert! */ else if (file == prev_file) file_num = prev_file_num; else /* note: VAXCRTL's fileno() is a function, not just a macro */ prev_file_num = file_num = fileno(file), prev_file = file; chan = file_num < _NFILE ? channel[file_num] : -1; if (chan == 0) { /* if not initialized, need to assign a channel */ if (isatty(file_num) > 0) { /* isatty: 1=yes, 0=no, -1=problem */ Dsc device; char devnam[255+1]; fgetname(file, devnam); /* get 'file's name */ device.len = strlen(device.adr = devnam); /* create descriptor */ if (vmswork(sys$assign(&device, &chan, 0, (Dsc *)0))) { /* get an event flag; use #0 if problem */ if (evfn == -1 && vmsfail(lib$get_ef(&evfn))) evfn = 0; } else chan = 0; /* $ASSIGN failed */ } /* store channel for later use; -1 => don't repeat failed init attempt */ channel[file_num] = (chan > 0 ? chan : -1); } if (chan > 0) { /* chan > 0 iff 'file' is a terminal */ struct _iosbw { U_Short status, count; U_Long rt_kludge; } iosb; register U_Long sts = 1; register char *pt = (char *)buf; register int offset, pos, count = size * number; U_Long cc_fmt, io_func = IO$_WRITEVBLK; int extra = 0; result = 0; if (is_stderr(file_num)) /* if it's SYS$ERROR (stderr)... */ io_func |= IO$M_CANCTRLO; /* cancel ^O (resume tty output) */ while (count > 0) { /* special handling for line-feeds to make them be 'newlines' */ offset = 0; if (*pt == '\n') { /* got at least one leading line-feed */ cc_fmt = PREFIX_CR, extra++; /* precede 1st LF with a CR */ do offset++; while (offset < count && *(pt + offset) == '\n'); } else cc_fmt = 0; /* look for another line-feed; if found, break line there */ pos = offset + find_c(pt + offset, count - offset, '\n'); if (pos >= BUFSIZ) pos = BUFSIZ - 1; /* throttle quota usage */ else if (pos < count) pos++, cc_fmt |= POSTFIX_CR, extra++; /* wait for previous write, if any, to complete */ if (pt > (char *)buf) { sts = sys$synch(evfn, &iosb); if (vmswork(sts)) sts = iosb.status, result += iosb.count; if (vmsfail(sts)) break; } /* queue an asynchronous write */ sts = sys$qio(evfn, chan, io_func, &iosb, (void (*)(U_Long))0, 0L, pt, pos, 0, cc_fmt, 0, 0); if (vmsfail(sts)) break; /*(should never happen)*/ pt += pos, count -= pos; } /* wait for last write to complete */ if (pt > (char *)buf && vmswork(sts)) { sts = sys$synch(evfn, &iosb); if (vmswork(sts)) sts = iosb.status, result += iosb.count; } if (vmsfail(sts)) errno = EVMSERR, vaxc$errno = sts; else if (iosb.rt_kludge == 0) result = number + extra; result -= extra; /* subtract the additional carriage-returns */ } else { /* use stdio */ /* Note: we assume that we're writing text, not binary data. For stream format files, 'size' and 'number' are effectively interchangable, and fwrite works fine. However, for record format files, 'size' governs the maximum record length, so fwrite(string, size(char), strlen(string), file) will produce a sequence of 1-byte records, which is hardly what we want in this (assumed) situation. Line-feeds ('\n') are converted into newlines (ie, record separators) by the run-time library, but strings that don't end with a newline still become separate records. The simplest work around is just to use fputs() instead of fwrite(); unfortunately, we have to provide special treatment for NULs ('\0's). At present, only stdout might be in record format (via >$'filename' redirection on the command line). */ if (size > 1) { /* not used by GAWK */ result = fwrite((void *)buf, size, number, file); } else if (*((char *)buf + number - 1) == '\n' || !is_stdout(file_num)) { result = fwrite((void *)buf, number, size, file); result = result * number / size; /*(same as 'result = number')*/ } else { #ifdef NO_ALLOCA # define alloca(n) ((n) <= abuf_siz ? abuf : \ ((abuf_siz > 0 ? (free(abuf),0) : 0), \ (abuf = malloc(abuf_siz = (n)+20)))) static void *abuf = 0; static size_t abuf_siz = 0; #endif /*NO_ALLOCA*/ register char *pt = (char *)buf; register int pos, count = number; if (pt[count] != '\0') { /*(out of bounds, but relatively safe)*/ pt = (char *)alloca(count + 1); memcpy(pt, buf, count), pt[count] = '\0'; /* if exiting this block undoes the alloca(), we're hosed :-( */ } result = 0; while (count > 0) { pos = find_c(pt, count, '\0'); if (fputs(pt, file) < 0) break; if (pos < count) { if (fputc('\0', file) < 0) break; pos++; /* 0..n-1 -> 1..n */ } result += pos, pt += pos, count -= pos; } } } return result; } #define fwrite(b,s,n,f) tty_fwrite((b),(s),(n),(f)) #ifdef fclose # undef fclose #endif /* tty_fclose() - keep tty_fwrite() up to date when closing a file */ int tty_fclose( FILE *file ) { if (file && *file) { /* note: VAXCRTL stdio has extra level of indirection */ int file_num = fileno(file); short chan = file_num < _NFILE ? channel[file_num] : -1; if (chan > 0) (void)sys$dassgn(chan); /* deassign the channel (ie, close) */ if (file_num < _NFILE) channel[file_num] = 0; /* clear stale info */ } prev_file = 0; /* force tty_fwrite() to reset */ return fclose(file); } #define fclose(f) tty_fclose(f) #endif /*!NO_TTY_FWRITE*/ --- NEW FILE: vms_gawk.c --- /* vms_gawk.c -- parse GAWK command line using DCL syntax Copyright (C) 1991-1993, 1996, 2003, 2005 the 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. */ /* * vms_gawk.c - routines to parse the command line as a native DCL command * rather than as a foreign command string. * Pat Rankin, Nov'89 * [ revised for 2.12, May'91 ] */ #include "awk.h" #include "vms.h" #define COMMAND_NAME "GAWK" /* verb name & for 'usage' message(s) */ #define USAGE_PROG_RQRD 1 #define USAGE_FILE_RQRD 2 #define USAGE_BAD_COMBO 3 #define USAGE_RUN_CMD 4 #define STS$M_INHIB_MSG 0x10000000 #define Present(arg) vmswork(Cli_Present(arg)) #define Get_Value(arg,buf,siz) vmswork(Cli_Get_Value(arg,buf,siz)) #ifndef __ia64__ extern void gawk_cmd(); /* created with $ SET COMMAND/OBJECT */ #define GAWK_CMD ((const void *)gawk_cmd) #else /* linker on Itanium is much pickier about such things */ #pragma extern_model save #pragma extern_model strict_refdef /* (could use globalvalue rather than _refdef if we omit GAWK_CMD's `&') */ extern void *gawk_cmd; #pragma extern_model restore #define GAWK_CMD ((const void *)&gawk_cmd) #endif extern void _exit(int); static int vms_usage(int); #define ARG_SIZ 250 union arg_w_prefix { /* structure used to simplify prepending of "-" */ char value[2+ARG_SIZ+1]; struct { char prefix[2]; /* for "-?" */ char buf[ARG_SIZ]; char suffix[1]; /* room for '\0' */ } arg; }; #define chk_option(qualifier,optname) \ if (Present(qualifier)) \ strcat(strcat(buf.arg.buf, W_cnt++ ? "," : ""), optname) /* vms_gawk() - parse GAWK command line using DCL and convert it into the */ /* appropriate "-arg" values for compatability with GNU code */ int vms_gawk() { U_Long sts; union arg_w_prefix buf; char misc_args[10], *misc_argp; int argc, W_cnt; int native_dcl = 1; /* assume true until we know otherwise */ /* check "GAWK_P1"--it's required; its presence will tip us off */ sts = Cli_Present("GAWK_P1"); if (CondVal(sts) == CondVal(CLI$_SYNTAX)) { native_dcl = 0; /* not invoked via a native command verb */ /* syntax error indicates that we weren't invoked as a native... [truncated message content] |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:33:39
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/unsupported/tandem In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/unsupported/tandem Added Files: ChangeLog compit config.h getid.c isatty.c popen.c popen.h strdup.c strnchk.c tmisc.c Log Message: Update package --- NEW FILE: config.h --- /* config.h. Generated automatically by configure. */ /* configh.in. Generated automatically from configure.in by autoheader. */ /* * acconfig.h -- configuration definitions for gawk. */ /* * Copyright (C) 1995-1997 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. * * GAWK 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. * * GAWK 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 */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif /* Define if using alloca.c. */ #define C_ALLOCA /* Define if type char is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ #define __CHAR_UNSIGNED__ #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #define GETGROUPS_T gid_t /* Define if the `getpgrp' function takes no argument. */ #define GETPGRP_VOID 1 /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ /* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if you don't have vprintf but do have _doprnt. */ /* #undef HAVE_DOPRNT */ /* Define if your struct stat has st_blksize. */ /* #define HAVE_ST_BLKSIZE 1 */ /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define if your struct tm has tm_zone. */ /* #undef HAVE_TM_ZONE */ /* Define if you don't have tm_zone but do have the external array tzname. */ #define HAVE_TZNAME 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define if on MINIX. */ /* #undef _MINIX */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef pid_t */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define to `unsigned' if <sys/types.h> doesn't define. */ /* #undef size_t */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME 1 /* Define if your <sys/time.h> declares struct tm. */ /* #undef TM_IN_SYS_TIME */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ #define HAVE_STRINGIZE 1 /* can use ANSI # operator in cpp */ #define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */ #define SPRINTF_RET int /* return type of sprintf */ /* #undef BITOPS */ /* bitwise ops (undocumented feature) */ /* #undef NONDECDATA */ /* non-decimal input data (undocumented feature) */ /* #undef HAVE_MKTIME */ /* we have the mktime function */ /* Define if you have the fmod function. */ #define HAVE_FMOD /* Define if you have the memcmp function. */ #define HAVE_MEMCMP 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memset function. */ #define HAVE_MEMSET 1 /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the strncasecmp function. */ /* Tandem doesn't have it but the file name is too long, so pretend here and do it properly at the end of this file */ #define HAVE_STRNCASECMP 1 /* Define if you have the strtod function. */ #define HAVE_STRTOD 1 /* Define if you have the system function. */ #define HAVE_SYSTEM 1 /* Define if you have the tzset function. */ #define HAVE_TZSET 1 /* Define if you have the <fcntl.h> header file. */ /* #undef HAVE_FCNTL_H */ /* Define if you have the <limits.h> header file. */ /* #undef HAVE_LIMITS_H */ /* Define if you have the <locale.h> header file. */ /* #undef HAVE_LOCALE_H */ /* Define if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the <signum.h> header file. */ /* #undef HAVE_SIGNUM_H */ /* Define if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define if you have the <strings.h> header file. */ /* #undef HAVE_STRINGS_H */ /* Define if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H 1 /* Define if you have the <sys/time.h> header file. */ /* #undef HAVE_SYS_TIME_H */ /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H 1 /* Define if you have the m library (-lm). */ /* #undef HAVE_LIBM */ #define HAVE_POPEN_H 1 #include <custom.h> /* overrides for stuff autoconf can't deal with */ --- NEW FILE: strdup.c --- /* * strdup --- duplicate a string * * We supply this routine for those systems that aren't standard yet. */ char * strdup (str) register const char *str; { char *p; p=(char *)malloc(strlen(str)+1); return strcpy(p,str); } --- NEW FILE: popen.c --- #include "popen.h" #include <stdlib.h> #if !defined(TANDEM) #include <io.h> #else #include "config.h" #include <fcntl.h> #endif #include <string.h> #if !defined(TANDEM) #include <process.h> #endif #ifdef OS2 #ifdef _MSC_VER #define popen(c,m) _popen(c,m) #define pclose(f) _pclose(f) #endif #endif #ifndef _NFILE #define _NFILE 40 #endif static char template[] = "piXXXXXX"; typedef enum { unopened = 0, reading, writing } pipemode; static struct { char *command; char *name; pipemode pmode; } pipes[_NFILE]; FILE * os_popen( char *command, char *mode ) { FILE *current; char *name; int cur; pipemode curmode; #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) return(popen(command, mode)); #endif /* ** decide on mode. */ if(strcmp(mode,"r") == 0) curmode = reading; else if(strcmp(mode,"w") == 0) curmode = writing; else return NULL; /* ** get a name to use. */ if((name = tempnam(".","pip"))==NULL) return NULL; /* ** If we're reading, just call system to get a file filled with ** output. */ if(curmode == reading) { if ((cur = dup(fileno(stdout))) == -1) return NULL; if ((current = freopen(name, "w", stdout)) == NULL) return NULL; system(command); if (dup2(cur, fileno(stdout)) == -1) return NULL; close(cur); if((current = fopen(name,"r")) == NULL) return NULL; } else { if((current = fopen(name,"w")) == NULL) return NULL; } cur = fileno(current); pipes[cur].name = name; pipes[cur].pmode = curmode; pipes[cur].command = strdup(command); return current; } int os_pclose( FILE * current) { int cur = fileno(current),rval; #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) return(pclose(current)); #endif /* ** check for an open file. */ if(pipes[cur].pmode == unopened) return -1; if(pipes[cur].pmode == reading) { /* ** input pipes are just files we're done with. */ rval = fclose(current); unlink(pipes[cur].name); } else { /* ** output pipes are temporary files we have ** to cram down the throats of programs. */ char command[256]; fclose(current); #if defined(TANDEM) sprintf(command,"%s /IN %s/",pipes[cur].command,pipes[cur].name); #else sprintf(command,"%s < %s",pipes[cur].command,pipes[cur].name); #endif rval = system(command); unlink(pipes[cur].name); } /* ** clean up current pipe. */ pipes[cur].pmode = unopened; free(pipes[cur].name); free(pipes[cur].command); return rval; } --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Sun Jun 3 13:04:44 2001 Arnold D. Robbins <ar...@sk...> * Release 3.1.0: Release tar file made. And there was rejoicing. Sun Jan 28 15:50:02 2001 Eli Zaretskii <el...@is...> * tmisc.c (os_restore_mode): New function Sun Dec 3 16:53:37 2000 Arnold D. Robbins <ar...@sk...> * tmisc.c (os_setbinmode): new function. Tue Nov 7 14:09:14 2000 Arnold D. Robbins <ar...@sk...> * tmisc.c (os_is_setuid): new function. Tue Jun 1 14:09:36 1999 Arnold D. Robbins <ar...@gn...> Sync with changes in 3.0.4 for non-Unix popen/pclose * popen.h: add defines for popen and pclose. * config.h: add define for HAVE_POPEN_H. Wed Jul 30 19:53:52 1997 Arnold D. Robbins <ar...@gn...> * Close-on-exec changes: tmisc.c: (os_close_on_exec, os_isdir): new functions. Mon Jul 27 11:40:00 1997 Arnold D. Robbins <ar...@gn...> * Initial integration of Tandem stuff into gawk source tree. --- NEW FILE: getid.c --- #if defined _MSC_VER || defined TANDEM #ifndef TANDEM #ifdef OS2 # define INCL_DOSPROCESS # include <os2.h> # if _MSC_VER == 510 # define DosGetPID DosGetPid # endif #else # include <process.h> #endif #ifdef OS2 int getpid(void) { PIDINFO PidInfo; DosGetPID(&PidInfo); return(PidInfo.pid); } #endif int getppid(void) { #ifdef OS2 PIDINFO PidInfo; DosGetPID(&PidInfo); return(PidInfo.pidParent); #else return(0); #endif } #endif /* TANDEM */ #ifdef TANDEM unsigned int getuid (void) { short cret; short cwd,pwd; cret = PROCESS_GETINFO_(,,,,,,,,,,&cwd,&pwd); return ((unsigned int) (cwd & 255)); } unsigned int geteuid (void) { short cret; short cwd,pwd; cret = PROCESS_GETINFO_(,,,,,,,,,,&cwd,&pwd); return ((unsigned int) (pwd & 255)); } unsigned int getgid (void) { short cret; short cwd,pwd; cret = PROCESS_GETINFO_(,,,,,,,,,,&cwd,&pwd); return ((unsigned int) ((cwd >> 8) & 255)); } unsigned int getegid (void) { short cret; short cwd,pwd; cret = PROCESS_GETINFO_(,,,,,,,,,,&cwd,&pwd); return ((unsigned int) ((pwd >> 8) & 255)); } int getpid(void) { return (0); } int getppid(void) { return (0); } #else unsigned int getuid (void) { return (0); /* root! */ } unsigned int geteuid (void) { return (0); } unsigned int getgid (void) { return (0); } unsigned int getegid (void) { return (0); } char *getlogin (void) { return ("root"); } #endif /* TANDEM */ #endif int getpgrp(void) { return (0); } --- NEW FILE: popen.h --- /* ** popen.h -- prototypes for pipe functions */ #if !defined(FILE) #include <stdio.h> #endif extern FILE *os_popen( char *, char * ); extern int os_pclose( FILE * ); #define popen os_popen #define pclose os_close --- NEW FILE: tmisc.c --- /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; char *name, *what, *dir; { /* no-op */ } /* os_isdir --- is this an fd on a directory? */ #if ! defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif int os_isdir(fd) int fd; { struct stat sbuf; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } /* * gawkmisc.c --- miscellanious gawk routines that are OS specific. */ /* * Copyright (C) 1986, 1988, 1989, 1991 - 95 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. * * GAWK 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. * * GAWK 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 */ char quote = '"'; char envsep = ';'; char *defpath = ""; /* gawk_name --- pull out the "gawk" part from how the OS called us */ char * gawk_name(filespec) const char *filespec; { char *p, *q; p = (char *) filespec; /* Sloppy... */ if ((q = strrchr(p, '.')) != NULL) p = q + 1; return p; } /* os_arg_fixup --- fixup the command line */ void os_arg_fixup(argcp, argvp) int *argcp; char ***argvp; { return; } /* os_devopen --- open special per-OS devices */ int os_devopen(name, flag) const char *name; int flag; { /* no-op */ return -1; } /* optimal_bufsize --- determine optimal buffer size */ size_t optimal_bufsize(fd, stb) int fd; struct stat *stb; { /* * TANDEM doesn't have a stat function. * So we just return 4096 which is the Tandem disk block size. */ /* set all members to zero. */ memset(stb, '\0', sizeof(struct stat)); /* set file size to arbitrary non-zero value. */ stb->st_size = 1; return 4096; } /* ispath --- return true if path has directory components */ int ispath(file) const char *file; { for (; *file; file++) { switch (*file) { case '.': return 1; } } return 0; } /* isdirpunct --- return true if char is a directory separator */ int isdirpunct(c) int c; { return (strchr(".\\", c) != NULL); } void initstate(i, j, k) unsigned i; char * j; int k; { } void setstate(i) char * i; { } /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; char *name, *what, *dir; { /* no-op */ } /* os_isdir --- is this an fd on a directory? */ /* can't do this on tandem, so just assume it's not a directory */ int os_isdir(fd) int fd; { return 0; } /* os_is_setuid --- true if running setuid root */ int os_is_setuid() { return 0; } /* os_setbinmode --- set binary mode on file */ int os_setbinmode (fd, mode) int fd, mode; { return 0; } /* os_restore_mode --- restore the original mode of the console device */ void os_restore_mode (fd) int fd; { /* no-op */ return; } --- NEW FILE: isatty.c --- #include <cextdecs(FILE_GETINFO_)> #include <stdioh> #include <talh> int isatty(int fd) { short cret,sfd,typ[5]; sfd = (short) fd; cret = FILE_GETINFO_(sfd,,,,,&typ[0]); if(typ[0] == 6) return (1); else return (0); } int dup(int fd) { return (fd); } int dup2(int fd, int fd2) { return (0); } --- NEW FILE: compit --- ?TACL MACRO #FRAME #PUSH #INLINEPREFIX #SET #INLINEPREFIX + == == Compile the bits == c /in allocac, out allocax/allocao; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in arrayc, out arrayx/arrayo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in builtinc, out builtinx/builtino; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in dfac, out dfax/dfao; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in evalc, out evalx/evalo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in fieldc, out fieldx/fieldo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in gawkmisc, out gawkmisx/gawkmiso; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in getoptc, out getoptx/getopto; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in getopt1c, out getopt1x/getopt1o;symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in ioc, out iox/ioo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in isattyc, out isattyx/isattyo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in mainc, out mainx/maino; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in missingc, out missingx/missingo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in msgc, out msgx/msgo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in nodec, out nodex/nodeo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in popenc, out popenx/popeno; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in rec, out rex/reo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in regexc, out regexx/regexo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in awktabc, out tawktabx/tawktabo; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" c /in versionc, out versionx/versiono; symbols,WIDE,define TANDEM,define HAVE_CONFIG_H,SSV0 "$system.system",SSV1 "[#defaults]" == == then bind them == bind/inline,out bindout/ + select runnable object on + select check parameter off + select list * off + select fixups on + select search $system.system.cwide + add * from arrayo + add * from allocao + add * from builtino + add * from dfao + add * from evalo + add * from fieldo + add * from gawkmiso + add * from getopto + add * from getopt1o + add * from ioo + add * from isattyo + add * from maino + add * from missingo + add * from msgo + add * from nodeo + add * from popeno + add * from reo + add * from regexo + add * from tawktabo + add * from versiono + set heap 5000 pages + build awk + file awk + info unresolved * + list * INLEOF #UNFRAME --- NEW FILE: strnchk.c --- /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcasecmp.c 5.6 (Berkeley) 6/27/88"; #endif /* LIBC_SCCS and not lint */ #ifdef atarist #include <sys/types.h> #else #define u_char unsigned char #endif /* * This array is designed for mapping upper and lower case letter * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ static u_char charmap[] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', }; int strcasecmp(s1, s2) const char *s1, *s2; { register u_char *cm = charmap, *us1 = (u_char *)s1, *us2 = (u_char *)s2; while (cm[*us1] == cm[*us2++]) if (*us1++ == '\0') return(0); return(cm[*us1] - cm[*--us2]); } int strncasecmp(s1, s2, n) const char *s1, *s2; register size_t n; { register u_char *cm = charmap, *us1 = (u_char *)s1, *us2 = (u_char *)s2; while ((long)(--n) >= 0 && cm[*us1] == cm[*us2++]) if (*us1++ == '\0') return(0); return((long)n < 0 ? 0 : cm[*us1] - cm[*--us2]); } |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:33:39
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/unsupported/atari In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/unsupported/atari Added Files: ChangeLog Makefile.awklib Makefile.st README.1st config.h gawkmisc.atr redirect.h stack.c system.c tmpnam.c Log Message: Update package --- NEW FILE: redirect.h --- /* * redirect.h --- definitions for functions that are OS specific. */ /* * Copyright (C) 1986, 1988, 1989, 1991-1993 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ /* This file is already conditioned on atarist in awk.h */ #define read _text_read /* we do not want all these CR's to mess our input */ extern int _text_read(int, char *, int); #ifndef __MINT__ #undef NGROUPS_MAX #endif /* __MINT__ */ --- NEW FILE: config.h --- /* * Sample configuration file for ST - works with gcc and TOS libraries; * revise for your configuration if configure script does not work */ /* * config.h -- configuration definitions for gawk. */ /* * Copyright (C) 1995, 96 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ /* Define if using alloca.c. */ /* #undef C_ALLOCA */ /* Define if type char is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ /* #undef __CHAR_UNSIGNED__ */ #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #define GETGROUPS_T gid_t /* Define if the `getpgrp' function takes no argument. */ #define GETPGRP_VOID 1 /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ /* Define if you have alloca, as a function or macro. */ #define HAVE_ALLOCA 1 /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* #undef HAVE_ALLOCA_H */ /* Define if you don't have vprintf but do have _doprnt. */ /* #undef HAVE_DOPRNT */ /* Define if you have a working `mmap' system call. */ /* #undef HAVE_MMAP */ /* Define if your struct stat has st_blksize. */ #define HAVE_ST_BLKSIZE 1 /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define if your struct tm has tm_zone. */ /* #undef HAVE_TM_ZONE */ /* Define if you don't have tm_zone but do have the external array tzname. */ /* #undef HAVE_TZNAME */ /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define if on MINIX. */ /* #undef _MINIX */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef pid_t */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define to `unsigned' if <sys/types.h> doesn't define. */ /* #undef size_t */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME 1 /* Define if your <sys/time.h> declares struct tm. */ #define TM_IN_SYS_TIME 1 /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ #define HAVE_STRINGIZE 1 /* can use ANSI # operator in cpp */ /* #undef REGEX_MALLOC */ /* use malloc instead of alloca in regex.c */ #define SPRINTF_RET int /* return type of sprintf */ /* Define if you have the fmod function. */ #define HAVE_FMOD 1 /* Define if you have the getpagesize function. */ #define HAVE_GETPAGESIZE 1 /* Define if you have the madvise function. */ /* #undef HAVE_MADVISE */ /* Define if you have the memcmp function. */ #define HAVE_MEMCMP 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memset function. */ #define HAVE_MEMSET 1 /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the strncasecmp function. */ /* #undef HAVE_STRNCASECMP */ /* Define if you have the strtod function. */ #define HAVE_STRTOD 1 /* Define if you have the system function. */ /* This is a white lie - but you may or may not prefer this way */ /* #define HAVE_SYSTEM 1 */ /* Define if you have the tzset function. */ #define HAVE_TZSET 1 /* Define if you have the valloc function. */ /* #undef HAVE_VALLOC */ /* Define if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the <signum.h> header file. */ /* #undef HAVE_SIGNUM_H */ /* Define if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define if you have the <strings.h> header file. */ /* #undef HAVE_STRINGS_H */ /* Define if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 #include <custom.h> /* overrides for stuff autoconf can't deal with */ --- NEW FILE: README.1st --- Tue Nov 7 14:19:41 2000 The atari port is no longer supported. If you have an atari, you are welcome to try and use the port here, but we no longer have the hardware to test gawk on. --- NEW FILE: system.c --- /* * function system() - slightly modified from sources dLibs 1.2 * - a freely distributable C library for Atari ST. * Authors: Dale Schumacher and John Stanley, I believe. * Changes for gcc compiler and gnulib.olb - Michal Jaegermann */ #include <osbind.h> #include <stdio.h> #include <string.h> #include <basepage.h> #ifdef __GNUC__ #include <process.h> #define ERROR 2 #endif /* #define DEBUG */ #ifdef DEBUG #define _COOKIE(x) puts(x);putchar('\n') #endif static void parse_args(char *cmdln, register char **argv) { register char *p; static char delim[] = " \t\r\n"; if(NULL != (p = strtok(cmdln, delim))) { do { *argv++ = p; } while(NULL != (p = strtok(NULL, delim))); } } #ifdef __GNUC__ /* this is used by assembler statement to keep a copy of registers */ static volatile long savearea[16]; #endif int system(const char *command) { register char *p; register int (*shell)(); #ifndef __GNUC__ char rv[2]; #endif char cmdln[1024]; char *args[64]; char *getenv(const char *); if(!command) return(ERROR); /* get _shell_p value */ p = (char *) Super(0L); /* supervisor mode */ shell = (int (*)()) *((long *) 0x4F6L); (void) Super(p); /* restore user mode */ /* validate _shell_p */ if((shell) && /* Shell available. */ (((long) shell) < ((long) _base)) && /* Reasonable shell pointer. */ (strncmp((char *)shell, "PATH", 4))) /* Not corrupted */ { #ifdef __GNUC__ int ret; #endif /* execute the command */ #ifdef DEBUG _COOKIE("system: using _shell_p"); printf("'shell' got value 0x%08lx\n", (long)shell); #endif /* a bit of paranoia caused by some misbehaving programs */ #ifdef __GNUC__ asm("moveml d1-d7/a0-a7,_savearea"); ret = (*shell)(command); asm("moveml _savearea,d1-d7/a0-a7"); return (ret); #else return ((*shell)(command)); #endif } strcpy(cmdln, command); /* copy the command line for parsing */ if((p = getenv("SHELL")) && (*p)) /* SHELL= variable? */ { args[0] = p; parse_args(cmdln, (args + 1)); #ifdef DEBUG _COOKIE("system: executing SHELL"); _COOKIE(p); #endif } else /* attempt to find first token as a program on the path */ { parse_args(cmdln, args); p = args[0]; #ifdef DEBUG _COOKIE("system: directly executing program"); _COOKIE(p); #endif } #ifdef __GNUC__ return(spawnvp(0, p, args)); #else /* original from dLibs */ forkvpe(p, args, NULL); wait(rv); return((rv[1] == 0) ? rv[0] : rv[1]); #endif } --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Sun Jun 3 13:04:44 2001 Arnold D. Robbins <ar...@sk...> * Release 3.1.0: Release tar file made. And there was rejoicing. Sun Jan 28 15:50:02 2001 Eli Zaretskii <el...@is...> * gawkmisc.atr (os_restore_mode): New function Sun Dec 3 16:53:37 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.atr (os_setbinmode): new function. Tue Nov 7 14:09:14 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.atr (os_is_setuid): new function. Wed Jul 30 19:53:52 1997 Arnold D. Robbins <ar...@gn...> * Close-on-exec changes: gawkmisc.atr: (os_close_on_exec, os_isdir): new functions. Mon Aug 7 15:23:00 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.6: Release tar file made. Sun Jun 25 15:08:19 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.5: Release tar file made. Wed Jun 30 16:14:36 1999 Arnold D. Robbins <ar...@gn...> * Release 3.0.4: Release tar file made. This time for sure. Thu May 15 12:49:08 1997 Arnold D. Robbins <ar...@sk...> * Release 3.0.3: Release tar file made. Fri Apr 18 07:55:47 1997 Arnold D. Robbins <ar...@sk...> * BETA Release 3.0.34: Release tar file made. Wed Dec 25 11:25:22 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.2: Release tar file made. Tue Dec 10 23:09:26 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.1: Release tar file made. Thu Nov 21 13:11:20 1996 Michal Jaegermann <mi...@ph...> * Makefile.st: Once again Makefile.st and config.h chase moving targets from the main directory. Thu Nov 7 21:02:01 1996 Michal Jaegermann <mi...@ph...> * Makefile.st, Makefile.awklib: sync'ed with ones in main tree. Wed Jan 10 22:58:55 1996 Arnold D. Robbins <ar...@sk...> * ChangeLog created. --- NEW FILE: gawkmisc.atr --- /* * gawkmisc.atr --- miscellaneous gawk routines that are OS specific. */ /* * Copyright (C) 1986, 1988, 1989, 1991-1996 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. * * GAWK 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. * * GAWK 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 */ #include <string.h> char quote = '\''; #ifndef DEFPATH char *defpath = ".,c:\\lib\\awk,c:\\gnu\\lib\\awk"; #else char *defpath = DEFPATH; #endif char envsep = ','; /* gawk_name --- pull out the "gawk" part from how the OS called us */ char * gawk_name(filespec) const char *filespec; { char *p, *q; p = (char *)filespec; if ((q = strrchr(p, '\\')) != NULL) p = q + 1; if ((q = strrchr(p, '/')) != NULL) p = q + 1; if ((q = strchr(p, '.')) != NULL) *q = '\0'; strlwr(p); return (p == NULL ? (char *)filespec : (char *)p); } /* os_arg_fixup --- fixup the command line */ void os_arg_fixup(argcp, argvp) int *argcp; char ***argvp; { /* no-op */ return; } /* os_devopen --- open special per-OS devices */ int os_devopen(name, flag) const char *name; int flag; { /* no-op */ return INVALID_HANDLE; } /* optimal_bufsize --- determine optimal buffer size */ size_t optimal_bufsize(fd, stb) int fd; struct stat *stb; { /* force all members to zero in case OS doesn't use all of them. */ memset(stb, '\0', sizeof(struct stat)); /* The atari has the st_blksize structure, so we just use it. */ #define DEFBLKSIZE (stb->st_blksize ? stb->st_blksize : BUFSIZ) /* * On ST redirected stdin does not have a name attached * (this could be hard to do to) and fstat would fail */ if (fd == 0) return BUFSIZ; if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); if (S_ISREG(stb->st_mode) && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } /* ispath --- return true if path has directory components */ int ispath(file) const char *file; { return (strchr(file, '/') != NULL || strchr(file, '\\') != NULL); } /* isdirpunct --- return true if char is a directory separator */ int isdirpunct(c) int c; { return (c == '/' || c == '\\'); } /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; const char *name, *what, *dir; { if (fcntl(fd, F_SETFD, 1) < 0) warning("%s %s `%s': could not set close-on-exec: %s", what, dir, name, strerror(errno)); } /* os_isdir --- is this an fd on a directory? */ #if ! defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif int os_isdir(fd) int fd; { struct stat sbuf; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } /* os_is_setuid --- true if running setuid root */ int os_is_setuid() { return 0; } /* os_setbinmode --- set binary mode on file */ int os_setbinmode (fd, mode) int fd, mode; { return 0; } /* os_restore_mode --- restore the original mode of the console device */ void os_restore_mode (fd) int fd; { /* no-op */ return; } --- NEW FILE: Makefile.awklib --- # Makefile for GNU Awk support library # Copy this file to 'awklib' subdirectory of main directory # and execute via relevant targets in your top Makefile # # This Makefile actually will work for awklib even when NOT # compiling with Atari Makefile!!! # # Copyright (C) 1995, 96 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. # # GAWK 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. # # GAWK 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 SHELL = /bin/sh srcdir = . INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 CC = gcc CFLAGS = -g -O prefix = /usr/local exec_prefix = ${prefix} binprefix = manprefix = bindir = ${exec_prefix}/bin libdir = ${exec_prefix}/lib mandir = ${prefix}/man/man1 manext = .1 infodir = ${prefix}/info datadir = ${prefix}/share/awk libexecdir = ${exec_prefix}/libexec/awk # default names of library utilities; on some systems they may require # names with extenstions PWCAT = pwcat GRCAT = grcat # the following command used, when necessary, for edits when # creating igawk from igawk.sh GCOM = '{print}' GAWK = gawk # $(AWK) is a by default freshly compiled gawk or installed awk when # cross-compiling; it is used for edits, since we may compile not on # Unix machine and an utility like 'sed' may NOT exist there AWK = $(srcdir)/../$(GAWK) AUXPROGS = $(PWCAT) $(GRCAT) AUXAWK = passwd.awk group.awk all: stamp-eg $(AUXPROGS) igawk $(AUXAWK) stamp-eg: $(srcdir)/../doc/gawk.texi rm -fr eg stamp-eg $(AWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi @echo 'some makes are stupid and will not check a directory' > stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg $(PWCAT): $(srcdir)/eg/lib/pwcat.c $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@ $(GRCAT): $(srcdir)/eg/lib/grcat.c $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@ igawk: $(srcdir)/eg/prog/igawk.sh $(AWK) $(GCOM) $(srcdir)/eg/prog/igawk.sh > $@ ; chmod 755 $@ passwd.awk: $(srcdir)/eg/lib/passwdawk.in $(AWK) '{gsub(/\/usr\/local\/libexec\/awk/, "$(libexecdir)"); print}' \ $? > $@ group.awk: $(srcdir)/eg/lib/groupawk.in $(AWK) '{gsub(/\/usr\/local\/libexec\/awk/, "$(libexecdir)"); print}' \ $? > $@ install: igawk $(AUXPROGS) $(AUXAWK) $(INSTALL_PROGRAM) igawk $(bindir)/igawk && chmod 755 $(bindir)/igawk for i in $(AUXPROGS) ; do \ $(INSTALL_PROGRAM) $$i $(libexecdir)/$$i ; \ done for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \ $(INSTALL_DATA) $$i $(datadir)/$$i ; \ done # libexecdir and bindir are removed in the top level Makefile's uninstall uninstall: rm -fr $(libexecdir)/* $(datadir)/* rm -f $(bindir)/igawk clean: rm -f $(AUXPROGS) $(AUXAWK) igawk *~ distclean: clean rm -f Makefile --- NEW FILE: stack.c --- /* * This value indicates an amount of reserved memory for a stack * in executables - see source of a startup code for details. * It can be changed without recompilation with fixstk.ttp utility. */ long _stksize = 2L; /* keep half of memory */ --- NEW FILE: tmpnam.c --- #ifdef PIPES_SIMULATED /* tmpnam.c : return a temporary file name */ /* written by Eric R. Smith and placed in the public domain */ /** * - modified for gawk needs - pattern /$$XXXXXX from the original * code creates names which are hard to remove when somethig * goes wrong * - returned name can be passed outside via system(); other programs * may not dig '/' as a path separator * - somehow more frugal in a memory use * (mj - October 1990) **/ #include <stdio.h> #include <stdlib.h> #include <string.h> extern char * getenv(const char *); extern char * mktemp(char *); char * tempnam(const char *path, const char *base); static char pattern[] = "\\gwkXXXXX"; char *tmpnam(buf) char *buf; { char *tmpdir; if (!(tmpdir = getenv("TEMP")) && !(tmpdir = getenv("TMPDIR"))) tmpdir = "."; if (!buf) { size_t blen; blen = strlen (tmpdir) + sizeof(pattern); if (NULL == (buf = malloc(blen))) return NULL; } (void) strcat(strcpy(buf, tmpdir), pattern); return(mktemp(buf)); } /* used by gawk_popen() */ char *tempnam(path, base) const char *path, *base; /* ignored */ { return tmpnam(NULL); } #endif /* PIPES_SIMULATED */ --- NEW FILE: Makefile.st --- # Makefile for GNU Awk - ST version. # # This makefile hand edited from Makefile automatically generated # by configure - gcc 2.x.x compiler with TOS version of libraries # and modified system(). # Check comments in this Makefile and adjust to your needs!! # # This Makefile assumes that you are using Bourne compatible shell # (like bash). If this is not the case you will have to edit various # targets or perform some actions by hand. # # Copyright (C) 1986, 1988-1996 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. # # GAWK 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. # # GAWK 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 MAKEINFO = makeinfo --no-split srcdir = . # native compiler with freshly compiled gawk.ttp to fix awklib GAWK = gawk.ttp CC = gcc # cross-compiler and gawk already installed on the system (any awk will do) # GAWK = gawk # CC = cgcc # WIDTH and EXT have to be both defined or both undefined # WIDTH = -mshort -DINT_IS_16BIT # EXT = 16 OFLAGS = -O2 -Wall -fomit-frame-pointer $(WIDTH) LDFLAGS = $(WIDTH) YACC = bison -y # xstrip -k in target gawk.ttp removes all symbols but _stksize # allowing for stack size manipulations without recompiling (with fixstk) INSTALL = xstrip -k ; cp -p INSTALL_PROGRAM = ${INSTALL} #INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA = ${INSTALL} LIBS = -lpml$(EXT) ALLOCA = #all these definitions likely require changes exec_prefix = ${prefix} prefix = /usr/local binprefix = manprefix = bindir = ${exec_prefix}/bin libdir = ${exec_prefix}/lib manexta = l mandir = ${prefix}/man/man$(manexta) manext = .$(manexta) infodir = ${prefix}/info #datadir = ${prefix}/share/awk datadir = ${prefix}/lib/awk libexecdir = ${exec_prefix}/lib/awk #DEFPATH = ".:$(datadir)" # datadir is passed to the next Makefile level and through sed # you may need many more backslashes than that if you have to use # them at all - sigh... DEFPATH = ".,c:\\lib\\awk,c:\\gnu\\lib\\awk" SHELL = /bin/sh SHELL = /bin/sh #CFLAGS = -g -O CFLAGS = $(OFLAGS) COMPFLAGS = $(CFLAGS) -DGAWK -I. -I$(srcdir) -DHAVE_CONFIG_H MFLAGS = "CC=$(CC)" \ "CFLAGS=$(CFLAGS)" \ GAWK=../$(GAWK) \ AWK=awk \ PWCAT=pwcat.ttp GRCAT=grcat.ttp \ "GCOM='{sub(/\":\"/, \"\\\",\\\"\"); print}'" \ "COMPFLAGS=$(COMPFLAGS)" \ "LDFLAGS=$(LDFLAGS)" \ "INSTALL=$(INSTALL)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ "INSTALL_DATA=$(INSTALL_DATA)" \ "bindir=$(bindir)" \ "libdir=$(libdir)" \ "mandir=$(mandir)" \ "manext=$(manext)" \ "infodir=$(infodir)" \ "datadir=$(datadir)" \ "libexecdir=$(libexecdir)" MMAKE = $(MAKE) $(MFLAGS) # object files AWKOBJS = array.o builtin.o eval.o field.o gawkmisc.o io.o main.o \ missing.o msg.o node.o re.o version.o ALLOBJS = $(AWKOBJS) awktab.o # LIBOBJS # GNU and other stuff that gawk uses as library routines. LIBOBJS= getopt.o getopt1.o regex.o dfa.o random.o $(ALLOCA) # source and documentation files SRC = array.c builtin.c eval.c field.c gawkmisc.c io.c main.c \ missing.c msg.c node.c re.c version.c ALLSRC= $(SRC) awktab.c AWKSRC= awk.h awk.y custom.h $(ALLSRC) patchlevel.h protos.h random.h LIBSRC = alloca.c dfa.c dfa.h regex.c regex.h getopt.h getopt.c getopt1.c random.c COPIES = missing/system.c missing/tzset.c \ missing/memcmp.c missing/memcpy.c missing/memset.c \ missing/strncasecmp.c missing/strchr.c \ missing/strerror.c missing/strtod.c \ missing/strftime.c missing/strftime.3 DOCS= doc/gawk.1 doc/gawk.texi doc/texinfo.tex TEXFILES= doc/gawk.aux doc/gawk.cp doc/gawk.cps doc/gawk.fn doc/gawk.fns \ doc/gawk.ky doc/gawk.kys doc/gawk.pg doc/gawk.pgs doc/gawk.toc \ doc/gawk.tp doc/gawk.tps doc/gawk.vr doc/gawk.vrs MISC = NEWS COPYING FUTURES Makefile.in PROBLEMS README PORTS POSIX.STD \ configure configure.in acconfig.h configh.in ACKNOWLEDGMENT \ ChangeLog INSTALL LIMITATIONS install-sh mkinstalldirs aclocal.m4 \ stamp-h.in OTHERS= amiga doc pc atari vms README_d posix awklib ALLDOC= doc/gawk.dvi $(TEXFILES) doc/gawk.info* MAKEFILEIN = Makefile.in awklib/Makefile.in doc/Makefile.in test/Makefile.in # Release of gawk. There can be no leading or trailing white space here! REL=3.0 # clear out suffixes list .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) -c $(COMPFLAGS) $< # rules to build gawk all: $(GAWK) awklib/all alldoc: all doc/all $(GAWK): $(ALLOBJS) $(LIBOBJS) $(REOBJS) $(CC) -o $(GAWK) $(COMPFLAGS) $(LDFLAGS) $(ALLOBJS) $(LIBOBJS) \ $(REOBJS) $(LIBS) $(ALLOBJS): awk.h dfa.h regex.h config.h custom.h $(LIBOBJS): config.h custom.h gawkmisc.o: $(srcdir)/atari/gawkmisc.atr $(CC) -c $(COMPFLAGS) -DDEFPATH='$(DEFPATH)' $(srcdir)/gawkmisc.c # this rule needed or not - depending on your library missing.o io.o: $(CC) -c $(COMPFLAGS) -DPIPES_SIMULATED $(srcdir)/$< # cheat with defines to force an inclusion of a proper code getopt.o: getopt.h $(CC) $(CFLAGS) -D_LIBC -D__alloca=__builtin_alloca -c getopt.c getopt.o: getopt.h getopt1.o: getopt.h random.o: random.h main.o: patchlevel.h awktab.c: awk.y $(YACC) -v $(srcdir)/awk.y && \ if test -f y.tab.c ; then mv y.tab.c ytab.c ; else true ; fi && \ sed '/^extern char .malloc(), .realloc();$$/d' ytab.c >awktab.c && \ rm ytab.c # VMS POSIX make won't apply the default .c.o rule to awktab.o for some reason awktab.o: awktab.c awk.h $(CC) -c $(COMPFLAGS) $(srcdir)/awktab.c alloca.o: alloca.c install: $(GAWK) info installdirs $(INSTALL_PROGRAM) $(GAWK) $(bindir) && chmod 755 $(bindir)/$(GAWK) cd awklib && $(MMAKE) install installdirs: mkinstalldirs $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ $(libdir) $(infodir) $(mandir) $(libexecdir) installdoc: info cd doc && $(MMAKE) install # #installtotal: installdirs install installdoc uninstall: rm -f $(bindir)/$(GAWK) cd awklib && $(MMAKE) uninstall -rmdir $(datadir) $(libexecdir) # cd doc && $(MMAKE) uninstall clean: rm -rf $(GAWK) *.o core y.output cd awklib && $(MMAKE) clean # the following does not always make sense (when crosscompiling) # cd test && $(MAKE) $(MFLAGS) clean # cd doc && $(MAKE) $(MFLAGS) clean local-distclean: rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output \ gmon.out make.out config.h config.status config.cache \ config.log stamp-h *~ distclean: clean local-distclean cd doc && $(MMAKE) distclean cd awklib && $(MMAKE) distclean cd test && $(MMAKE) distclean maintainer-clean: clean local-distclean @echo "This command is intended for maintainers to use; it" @echo "deletes files that may require special tools to rebuild." rm -f awktab.c TAGS tags cd doc && $(MMAKE) maintainer-clean # cd test && $(MMAKE) maintainer-clean # cd awklib && $(MMAKE) maintainer-clean clobber: maintainer-clean TAGS: etags $(AWKSRC) tags: ctags $(AWKSRC) dvi: $(srcdir)/doc/gawk.texi cd doc && $(MMAKE) dvi info: $(srcdir)/doc/gawk.texi cd doc && $(MMAKE) info doc/all: cd doc && $(MMAKE) all awklib/all: cd awklib && $(MMAKE) all # to run this target you have to adjust test/Makefile quite a bit # in order to make it palatable to your shell # check: $(GAWK) cd test; $(MMAKE) -k test: check |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:33:37
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/test/reg/Obsolete In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/test/reg/Obsolete Added Files: exp.awk exp.good exp.in log.awk log.good log.in Log Message: Update package --- NEW FILE: exp.in --- --- NEW FILE: log.good --- log: SING error -Inf gawk: reg/log.awk:1: warning: log called with negative argument -1 log: DOMAIN error NaN 4.60517 --- NEW FILE: exp.good --- 1 gawk: reg/exp.awk:1: warning: exp argument 1e+06 is out of range Inf 1.64872 --- NEW FILE: exp.awk --- BEGIN { print exp(0), exp(1000000), exp(0.5) } --- NEW FILE: log.awk --- BEGIN { print log(0), log(-1), log(100) } --- NEW FILE: log.in --- |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:33:36
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/test/reg In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/test/reg Added Files: exp-eq.awk exp-eq.good exp-eq.in func.awk func.good func.in func2.awk func2.good func2.in func2.out Log Message: Update package --- NEW FILE: exp-eq.good --- 1 8 27 --- NEW FILE: func2.awk --- function dummy() { ; } BEGIN { print dummy (1) } --- NEW FILE: exp-eq.in --- 1 2 3 --- NEW FILE: func.awk --- BEGIN { print dummy(1) } --- NEW FILE: func.in --- --- NEW FILE: func2.in --- --- NEW FILE: func2.good --- gawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and `(', or used in other expression context --- NEW FILE: func.good --- gawk: reg/func.awk:1: fatal: function `dummy' not defined --- NEW FILE: func2.out --- gawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and `(', or used as a variable or an array --- NEW FILE: exp-eq.awk --- { $0 ^= 3 ; print $1} |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:33:35
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/test/lib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/test/lib Added Files: awkpath.awk Log Message: Update package --- NEW FILE: awkpath.awk --- BEGIN { print "Found it." } |
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/po In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/po Added Files: ChangeLog LINGUAS Makefile.in.in Makevars POTFILES.in Rules-quot boldquot.sed ca.gmo ca.po da.gmo da.po de.gmo de.po en...@bo... en...@qu... es.gmo es.po fr.gmo fr.po ga.gmo ga.po gawk.pot he.gmo he.po insert-header.sin it.gmo it.po ja.gmo ja.po nl.gmo nl.po pl.gmo pl.po pt_BR.gmo pt_BR.po quot.sed remove-potcdate.sin ro.gmo ro.po rw.gmo rw.po stamp-po sv.gmo sv.po tr.gmo tr.po vi.gmo vi.po Log Message: Update package --- NEW FILE: en...@qu... --- # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # --- NEW FILE: Rules-quot --- # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en...@qu... en...@bo... insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en...@qu...-create: $(MAKE) en...@qu...-update en...@bo...-create: $(MAKE) en...@bo...-update en...@qu...-update: en...@qu...-update-en en...@bo...-update: en...@bo...-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en...@qu...-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en...@qu.../g' $(srcdir)/insert-header.sin > en...@qu...-header en...@bo...-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en...@bo.../g' $(srcdir)/insert-header.sin > en...@bo...-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header --- NEW FILE: stamp-po --- timestamp --- NEW FILE: ja.po --- # Japanese messages for gawk. # Copyright (C) 2003 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # Makoto Hosoya <mh...@oz...>, 2003. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.4l\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2005-06-27 02:37+1000\n" "Last-Translator: Makoto Hosoya <mh...@oz...>\n" "Language-Team: Japanese <tra...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=EUC-JP\n" "Content-Transfer-Encoding: 8bit\n" #: array.c:112 #, c-format [...1824 lines suppressed...] #: regcomp.c:199 msgid "Invalid preceding regular expression" msgstr "Àè¹Ô¤ÎÀµµ¬É½¸½¤¬Ìµ¸ú¤Ç¤¹¡£" #: regcomp.c:202 msgid "Premature end of regular expression" msgstr "Àµµ¬É½¸½¤¬½ªÃ¼¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£" #: regcomp.c:205 msgid "Regular expression too big" msgstr "Àµµ¬É½¸½¤¬Ä¹²á¤®¤Þ¤¹¡£" #: regcomp.c:208 msgid "Unmatched ) or \\)" msgstr ") ¤Þ¤¿¤Ï \\) ¤¬Âбþ¤·¤Þ¤»¤ó¡£" #: regcomp.c:688 msgid "No previous regular expression" msgstr "¤³¤ì¤è¤êÁ°¤Ë»ÈÍѤ·¤¿Àµµ¬É½¸½¤Ï¤¢¤ê¤Þ¤»¤ó¡£" --- NEW FILE: en...@bo... --- # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # --- NEW FILE: fr.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ca.po --- # translation of gawk.po to Catalan # Copyright (C) 2003 Free Software Foundation, Inc. # Antoni Bella Perez <be...@te...>, 2003. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.31\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2003-05-07 21:13+0100\n" "Last-Translator: Antoni Bella Perez <be...@te...>\n" "Language-Team: Catalan <ca...@do...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.0.1\n" #: array.c:112 #, fuzzy, c-format [...1936 lines suppressed...] #~ msgid "malformed repeat count" #~ msgstr "repetició del comptador malformada" #~ msgid "Unbalanced [" #~ msgstr "[ sense aparellar" #~ msgid "Unbalanced (" #~ msgstr "( sense aparellar" #~ msgid "No regexp syntax bits specified" #~ msgstr "No s'especifiquen els bits de sintaxi de l'expressió regular" #~ msgid "Unbalanced )" #~ msgstr ") sense aparellar" #~ msgid "out of memory" #~ msgstr "memòria esgotada" #~ msgid "internal error: file `%s', line %d\n" #~ msgstr "error intern: fitxer «%s», línia %d\n" --- NEW FILE: insert-header.sin --- # Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } --- NEW FILE: sv.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: da.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: de.po --- # GNU awk message strings # Copyright (C) 2000 Free Software Foundation, Inc. # Unknown Author, <in...@gn...>, 2000 # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.0\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2002-04-03 18:55+02:00\n" "Last-Translator: Christian Kirsch <ck...@he...>\n" "Language-Team: German <de...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: array.c:112 #, fuzzy, c-format msgid "attempt to use function `%s' as an array" [...1937 lines suppressed...] #~ msgid "out of memory" #~ msgstr "Kein Speicher mehr." #~ msgid "invalid syntax in name `%s' for variable assignment" #~ msgstr "Ungültige Syntax im Namen '%s' für Variablenzuweisung." #~ msgid "" #~ "\n" #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" #~ msgstr "" #~ "\n" #~ "Um Fehler zu melden, lesen Sie bitte den Abschnitt 'Bugs' in " #~ "'gawk_info',\n" #~ msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)" #~ msgstr "Pipe von '%s': Konnte close-on-exec nicht setzen (fcntl: %s)." #~ msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)" #~ msgstr "Pipe zu '%s': Konnte close-on-exec nicht setzen (fcntl: %s)." --- NEW FILE: es.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vi.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: he.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Makefile.in.in --- # Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper <dr...@gn...> # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.14.4 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: --- NEW FILE: nl.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ga.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: he.po --- # Hebrew messages for GNU Awk -*- coding: hebrew-iso-8bit -*- # Copyright (C) 2001 Free Software Foundation, Inc. # Eli Zaretskii <el...@is...>, 2001, 2002. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.1a\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2002-04-28 21:46+0300\n" "Last-Translator: Eli Zaretskii <el...@gn...>\n" "Language-Team: Hebrew <el...@gn...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-8\n" "Content-Transfer-Encoding: 8-bit\n" #: array.c:112 #, fuzzy, c-format msgid "attempt to use function `%s' as an array" [...1904 lines suppressed...] #~ msgid "unfinished repeat count" #~ msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä" #~ msgid "malformed repeat count" #~ msgstr "úåðùéä äðåî úøãâäá éåâù øéáçú" #~ msgid "Unbalanced (" #~ msgstr "âåæ-ïá åì ïéàù (" #~ msgid "No regexp syntax bits specified" #~ msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà" #~ msgid "Unbalanced )" #~ msgstr "âåæ-ïá åì ïéàù )" #~ msgid "out of memory" #~ msgstr "ïåøëæä øîâð" #~ msgid "invalid syntax in name `%s' for variable assignment" #~ msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú" --- NEW FILE: sv.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vi.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tr.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: it.po --- # Italian messages for GNU Awk # Copyright (C) 2002-2005 Free Software Foundation, Inc. # Antonio Colombo <az...@ya...>. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.35\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2005-06-22 14:00+0100\n" "Last-Translator: Antonio Colombo <az...@ya...>\n" "Language-Team: Italian <it...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" #: array.c:112 #, c-format msgid "attempt to use function `%s' as an array" [...1817 lines suppressed...] #: regcomp.c:199 msgid "Invalid preceding regular expression" msgstr "Espressione regolare precedente invalida" #: regcomp.c:202 msgid "Premature end of regular expression" msgstr "Fine di expressione regolare inaspettata" #: regcomp.c:205 msgid "Regular expression too big" msgstr "Espressione regolare troppo complessa" #: regcomp.c:208 msgid "Unmatched ) or \\)" msgstr ") or \\) non aperta" #: regcomp.c:688 msgid "No previous regular expression" msgstr "Nessuna espressione regolare precedente" --- NEW FILE: fr.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nl.po --- # Translation of gawk-3.1.4l to Dutch. # Copyright (C) 2005 Free Software Foundation, Inc. # Benno Schulenberg <be...@ni...>, 2005. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.4l\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2005-06-24 22:39+0200\n" "Last-Translator: Benno Schulenberg <be...@ni...>\n" "Language-Team: Dutch <ver...@vr...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.10.1\n" #: array.c:112 #, c-format [...1817 lines suppressed...] #: regcomp.c:199 msgid "Invalid preceding regular expression" msgstr "Ongeldige voorafgaande reguliere expressie" #: regcomp.c:202 msgid "Premature end of regular expression" msgstr "Voortijdig einde van reguliere expressie" #: regcomp.c:205 msgid "Regular expression too big" msgstr "Reguliere expressie is te groot" #: regcomp.c:208 msgid "Unmatched ) or \\)" msgstr "Ongepaarde ) of \\)" #: regcomp.c:688 msgid "No previous regular expression" msgstr "Geen eerdere reguliere expressie" --- NEW FILE: da.po --- # Danish translation of gawk # Copyright (C) 2001 Free Software Foundation, Inc. # Keld Simonsen <ke...@dk...>, 2002. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.31\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2002-11-09 10:09+0100\n" "Last-Translator: Keld Simonsen <ke...@dk...>\n" "Language-Team: Danish <da...@kl...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: array.c:112 #, fuzzy, c-format msgid "attempt to use function `%s' as an array" [...1912 lines suppressed...] #~ msgid "unfinished repeat count" #~ msgstr "uafsluttet gentagelsesantal" #~ msgid "malformed repeat count" #~ msgstr "fejlagtigt udformet gentagelsesantal" #~ msgid "Unbalanced [" #~ msgstr "Ubalanceret [" #~ msgid "Unbalanced (" #~ msgstr "Ubalanceret (" #~ msgid "No regexp syntax bits specified" #~ msgstr "Ingen syntaksbit for regulære udtryk angivet" #~ msgid "Unbalanced )" #~ msgstr "Ubalanceret )" #~ msgid "out of memory" #~ msgstr "slut på hukommelsen" --- NEW FILE: es.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tr.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ca.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pl.po --- # Polish translations for GNU AWK package. # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # Wojciech Polak <po...@gn...>, 2003, 2004, 2005. # additional help by Sergey Poznyakoff <gr...@gn...>, 2003. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.4l\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2005-06-26 23:55+0200\n" "Last-Translator: Wojciech Polak <po...@gn...>\n" "Language-Team: Polish <tra...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" [...1927 lines suppressed...] #~ msgid "malformed repeat count" #~ msgstr "¼le sformatowana liczba powtórzeñ" #~ msgid "Unbalanced [" #~ msgstr "[ nie do pary" #~ msgid "Unbalanced (" #~ msgstr "( nie do pary" #~ msgid "No regexp syntax bits specified" #~ msgstr "Nie zosta³y podane bity sk³adni wyra¿enia regularnego" #~ msgid "Unbalanced )" #~ msgstr ") nie do pary" #~ msgid "out of memory" #~ msgstr "brak pamiêci" #~ msgid "internal error: file `%s', line %d\n" #~ msgstr "wewnêtrzny b³±d: plik `%s', linia %d\n" --- NEW FILE: POTFILES.in --- # List of source files containing translatable strings. # Copyright (C) 1999, 2002 Free Software Foundation, Inc. array.c awkgram.c builtin.c eval.c ext.c field.c gawkmisc.c getopt.c getopt1.c io.c main.c msg.c node.c posix/gawkmisc.c profile.c random.c re.c regcomp.c regex_internal.c regexec.c replace.c --- NEW FILE: ro.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ro.po --- (This appears to be a binary file; contents omitted.) --- NEW FILE: boldquot.sed --- (This appears to be a binary file; contents omitted.) --- NEW FILE: remove-potcdate.sin --- # Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } --- NEW FILE: it.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: de.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: gawk.pot --- # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: array.c:112 [...1751 lines suppressed...] #: regcomp.c:199 msgid "Invalid preceding regular expression" msgstr "" #: regcomp.c:202 msgid "Premature end of regular expression" msgstr "" #: regcomp.c:205 msgid "Regular expression too big" msgstr "" #: regcomp.c:208 msgid "Unmatched ) or \\)" msgstr "" #: regcomp.c:688 msgid "No previous regular expression" msgstr "" --- NEW FILE: pt_BR.po --- # gawk pt_BR translation. # Copyright (C) 2003 Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # Juan Carlos Castro y Castro <jc...@vi...>, 2003. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.2g\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" "PO-Revision-Date: 2003-06-26 16:18+0300\n" "Last-Translator: Juan Carlos Castro y Castro <jc...@vi...>\n" "Language-Team: Brazilian Portuguese <ld...@ba...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: array.c:112 #, fuzzy, c-format [...1843 lines suppressed...] #~ msgid "regex match failed, not enough memory to match string \"%.*s%s\"" #~ msgstr "" #~ "busca por exp. reg. falhou, memória insuficiente para testar string \"%.*s" #~ "%s\"" #~ msgid "substr: length %g is < 0" #~ msgstr "substr: comprimento %g é < 0" #~ msgid "delete: illegal use of variable `%s' as array" #~ msgstr "delete: uso ilegal da variável `%s' como vetor" #~ msgid "asort: first argument is not an array" #~ msgstr "asort: primeiro argumento não é um vetor" #~ msgid "asort: second argument is not an array" #~ msgstr "asort: segundo argumento não é um vetor" #~ msgid "internal error: Node_var_array with null vname" #~ msgstr "erro interno: Node_var_array com vname nulo" --- NEW FILE: quot.sed --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. 2004-02-19 gettextize <bug...@gn...> * Makefile.in.in: Upgrade to gettext-0.14.1. * Rules-quot: Upgrade to gettext-0.14.1. 2004-01-16 gettextize <bug...@gn...> * Makefile.in.in: Upgrade to gettext-0.13.1. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. 2003-06-16 gettextize <bug...@gn...> * Makefile.in.in: Upgrade to gettext-0.12.1. * Rules-quot: New file, from gettext-0.12.1. * boldquot.sed: New file, from gettext-0.12.1. * en...@bo...: New file, from gettext-0.12.1. * en...@qu...: New file, from gettext-0.12.1. * insert-header.sin: New file, from gettext-0.12.1. * quot.sed: New file, from gettext-0.12.1. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Mon Dec 2 11:49:59 2002 Arnold D. Robbins <ar...@sk...> * Rules-quot, en...@qu..., en...@bo...: removed. Thu Sep 19 11:00:00 2002 Arnold D. Robbins <ar...@sk...> * Updated to gettext 0.11.5. Mon Jun 17 18:26:23 2002 Arnold D. Robbins <ar...@sk...> * POTFILES.in: Updated with list of new regex files. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. 2002-04-09 gettextize <bug...@gn...> * Makefile.in.in: Upgrade to gettext-0.11.1. * remove-potcdate.sin: New file, from gettext-0.11.1. --- NEW FILE: pl.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ja.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: LINGUAS --- es fr he it sv tr de da pt_BR ca pl ja ro nl rw ga vi --- NEW FILE: rw.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rw.po --- # Kinyarwanda translations for gawk package. # Copyright (C) 2005 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # Steve Murphy <mu...@e-...>, 2005. # Steve performed initial rough translation from compendium built from translations provided by the following translators: # Philibert Ndandali <nda...@ya...>, 2005. # Viateur MUGENZI <mu...@ya...>, 2005. # Noëlla Mupole <s24...@tu...>, 2005. # Carole Karema <kar...@ho...>, 2005. # JEAN BAPTISTE NGENDAHAYO <nge...@ya...>, 2005. # Augustin KIBERWA <aki...@ya...>, 2005. # Donatien NSENGIYUMVA <ndo...@ya...>, 2005. # Antoine Bigirimana <an...@e-...>, 2005. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.4\n" "Report-Msgid-Bugs-To: ar...@sk...\n" "POT-Creation-Date: 2005-07-06 17:20+0300\n" [...1956 lines suppressed...] msgid "Regular expression too big" msgstr "imvugo" #: regcomp.c:208 #, fuzzy msgid "Unmatched ) or \\)" msgstr "Cyangwa" #: regcomp.c:688 #, fuzzy msgid "No previous regular expression" msgstr "Ibanjirije Ibisanzwe imvugo" #, fuzzy #~ msgid "function %s called\n" #~ msgstr "Umumaro" #, fuzzy #~ msgid "field %d in FIELDWIDTHS, must be > 0" #~ msgstr "Umwanya in 0" --- NEW FILE: ga.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pt_BR.gmo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Makevars --- # Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = ar...@sk... # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:42
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/posix In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/posix Added Files: ChangeLog gawkmisc.c Log Message: Update package --- NEW FILE: gawkmisc.c --- /* gawkmisc.c --- miscellaneous gawk routines that are OS specific. Copyright (C) 1986, 1988, 1989, 1991 - 1998, 2001 - 2004 the 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. */ char quote = '\''; char *defpath = DEFPATH; char envsep = ':'; #ifndef INVALID_HANDLE /* FIXME: is this value for INVALID_HANDLE correct? */ #define INVALID_HANDLE -1 #endif /* gawk_name --- pull out the "gawk" part from how the OS called us */ char * gawk_name(filespec) const char *filespec; { char *p; /* "path/name" -> "name" */ p = strrchr(filespec, '/'); return (p == NULL ? (char *) filespec : p + 1); } /* os_arg_fixup --- fixup the command line */ void os_arg_fixup(argcp, argvp) int *argcp; char ***argvp; { /* no-op */ return; } /* os_devopen --- open special per-OS devices */ int os_devopen(name, flag) const char *name; int flag; { /* no-op */ return INVALID_HANDLE; } /* optimal_bufsize --- determine optimal buffer size */ /* * Enhance this for debugging purposes, as follows: * * Always stat the file, stat buffer is used by higher-level code. * * if (AWKBUFSIZE == "exact") * return the file size * else if (AWKBUFSIZE == a number) * always return that number * else * if the size is < default_blocksize * return the size * else * return default_blocksize * end if * endif * * Hair comes in an effort to only deal with AWKBUFSIZE * once, the first time this routine is called, instead of * every time. Performance, dontyaknow. */ size_t optimal_bufsize(fd, stb) int fd; struct stat *stb; { char *val; static size_t env_val = 0; static short first = TRUE; static short exact = FALSE; /* force all members to zero in case OS doesn't use all of them. */ memset(stb, '\0', sizeof(struct stat)); /* always stat, in case stb is used by higher level code. */ if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); if (first) { first = FALSE; if ((val = getenv("AWKBUFSIZE")) != NULL) { if (strcmp(val, "exact") == 0) exact = TRUE; else if (ISDIGIT(*val)) { for (; *val && ISDIGIT(*val); val++) env_val = (env_val * 10) + *val - '0'; return env_val; } } } else if (! exact && env_val > 0) return env_val; /* else fall through */ /* * System V.n, n < 4, doesn't have the file system block size in the * stat structure. So we have to make some sort of reasonable * guess. We use stdio's BUFSIZ, since that is what it was * meant for in the first place. */ #ifdef HAVE_ST_BLKSIZE #define DEFBLKSIZE (stb->st_blksize > 0 ? stb->st_blksize : BUFSIZ) #else #define DEFBLKSIZE BUFSIZ #endif if (S_ISREG(stb->st_mode) /* regular file */ && 0 < stb->st_size /* non-zero size */ && (stb->st_size < DEFBLKSIZE /* small file */ || exact)) /* or debugging */ return stb->st_size; /* use file size */ return DEFBLKSIZE; } /* ispath --- return true if path has directory components */ int ispath(file) const char *file; { return (strchr(file, '/') != NULL); } /* isdirpunct --- return true if char is a directory separator */ int isdirpunct(c) int c; { return (c == '/'); } /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; const char *name, *what, *dir; { if (fd <= 2) /* sanity */ return; if (fcntl(fd, F_SETFD, 1) < 0) warning(_("%s %s `%s': could not set close-on-exec: (fcntl: %s)"), what, dir, name, strerror(errno)); } /* os_isdir --- is this an fd on a directory? */ #if ! defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif int os_isdir(fd) int fd; { struct stat sbuf; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } /* os_is_setuid --- true if running setuid root */ int os_is_setuid() { long uid, euid; uid = getuid(); euid = geteuid(); return (euid == 0 && euid != uid); } /* os_setbinmode --- set binary mode on file */ int os_setbinmode(fd, mode) int fd, mode; { #ifdef __CYGWIN__ setmode (fd, mode); #endif return 0; } /* os_restore_mode --- restore the original mode of the console device */ void os_restore_mode (fd) int fd; { /* no-op */ return; } #ifdef __CYGWIN__ #include <stdio.h> #include <sys/cygwin.h> extern int _fmode; void cygwin_premain0 (int argc, char **argv, void *myself) { static struct __cygwin_perfile pf[] = { {"", O_RDONLY | O_TEXT}, /*{"", O_WRONLY | O_BINARY},*/ {NULL, 0} }; cygwin_internal (CW_PERFILE, pf); } void cygwin_premain2 (int argc, char **argv, void *myself) { setmode (fileno (stdin), O_TEXT); } #endif --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Sun May 25 16:23:43 2003 Corinna Vinschen <vin...@re...> * gawkmisc.c (cygwin_premain0): New function. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Tue Feb 4 14:28:06 2003 Arnold D. Robbins <ar...@sk...> All relevant files: Copyright year updated to 2003. Tue Dec 17 11:05:11 2002 Arnold D. Robbins <ar...@sk...> * gawkmisc.c (optimal_bufsize): Stat the file first, so that stb is always valid for higher level code. Thu Nov 28 10:20:05 2002 Arnold D. Robbins <ar...@sk...> * gawkmisc.c (optimal_bufsize): Enhance to use AWKBUFSIZE environment variable for debugging. Tue Jun 11 22:18:42 2002 Stepan Kasal <ka...@ma...> * gawkmisc.c (DEFBLKSIZE): Add check for st_blksize > 0, fixes weird bug on some versions of HP-UX. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Tue Sep 25 15:19:53 2001 Arnold D. Robbins <ar...@sk...> * gawkmisc.c (os_close_on_exec): If fd <= 2, return. Sun Jun 3 13:04:44 2001 Arnold D. Robbins <ar...@sk...> * Release 3.1.0: Release tar file made. And there was rejoicing. Sun Jan 28 15:50:02 2001 Eli Zaretskii <el...@is...> * gawkmisc.c (os_restore_mode): New function. Sun Dec 3 16:53:37 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.c (os_setbinmode): New function. Tue Nov 14 16:13:08 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.c: Remove all includes. Done by ../gawkmisc.c. Tue Nov 7 14:09:14 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.c (os_is_setuid): new function. Mon Aug 7 15:23:00 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.6: Release tar file made. Sun Jun 25 15:08:19 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.5: Release tar file made. Wed Jun 30 16:14:36 1999 Arnold D. Robbins <ar...@gn...> * Release 3.0.4: Release tar file made. This time for sure. Wed Jul 30 19:53:52 1997 Arnold D. Robbins <ar...@gn...> * Close-on-exec changes: gawkmisc.c: (os_close_on_exec, os_isdir): new functions. Thu May 15 12:49:08 1997 Arnold D. Robbins <ar...@sk...> * Release 3.0.3: Release tar file made. Fri Apr 18 07:55:47 1997 Arnold D. Robbins <ar...@sk...> * BETA Release 3.0.34: Release tar file made. Wed Dec 25 11:25:22 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.2: Release tar file made. Tue Dec 10 23:09:26 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.1: Release tar file made. Wed Jan 10 22:58:55 1996 Arnold D. Robbins <ar...@sk...> * ChangeLog created. |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:40
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/pc/include/sys In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/pc/include/sys Added Files: stat.h types.h Log Message: Update package --- NEW FILE: types.h --- #undef __STDC__ #include <sys/types.h> #define __STDC__ 1 --- NEW FILE: stat.h --- #undef __STDC__ #include <sys/stat.h> #define __STDC__ 1 |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:40
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/pc/awklib In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/pc/awklib Added Files: igawk igawk.awk igawk.bat Log Message: Update package --- NEW FILE: igawk.bat --- @sh igawk %1 %2 %3 %4 %5 %6 %7 %8 %9 --- NEW FILE: igawk.awk --- # igawk.awk # process @include directives function pathto(file, i, t, junk) { if (index(file, "/") != 0) return file for (i = 1; i <= ndirs; i++) { t = (pathlist[i] "/" file) if ((getline junk < t) > 0) { # found it close(t) return t } } return "" } BEGIN { path = ENVIRON["AWKPATH"] ndirs = split(path, pathlist, ";") for (i = 1; i <= ndirs; i++) { if (pathlist[i] == "") pathlist[i] = "." } stackptr = 0 input[stackptr] = ARGV[1] # ARGV[1] is first file for (; stackptr >= 0; stackptr--) { while ((getline < input[stackptr]) > 0) { if (tolower($1) != "@include") { print continue } fpath = pathto($2) if (fpath == "") { printf("igawk:%s:%d: cannot find %s\n", input[stackptr], FNR, $2) > "/dev/stderr" continue } if (! (fpath in processed)) { processed[fpath] = input[stackptr] input[++stackptr] = fpath # push onto stack } else print $2, "included in", input[stackptr], "already included in", processed[fpath] > "/dev/stderr" } close(input[stackptr]) } } --- NEW FILE: igawk --- #! /bin/sh # igawk --- like gawk but do @include processing # Arnold Robbins, ar...@gn..., Public Domain # July 1993 igs=${TMP:-/tmp}/igs$$ ige=${TMP:-/tmp}/ige$$ if [ "$1" = debug ] then set -x shift else # cleanup on exit, hangup, interrupt, quit, termination #trap 'rm -f $igs $ige' 0 1 2 3 15 trap 'rm -f $igs $ige' 0 2 15 fi while [ $# -ne 0 ] # loop over arguments do case $1 in --) shift; break;; -W) shift set -- -W"$@" continue;; -[vF]) opts="$opts $1 '$2'" shift;; -[vF]*) opts="$opts '$1'" ;; -f) echo @include "$2" >> $igs shift;; -f*) f=`echo "$1" | sed 's/-f//'` echo @include "$f" >> $igs ;; -?file=*) # -Wfile or --file f=`echo "$1" | sed 's/-.file=//'` echo @include "$f" >> $igs ;; -?file) # get arg, $2 echo @include "$2" >> $igs shift;; -?source=*) # -Wsource or --source t=`echo "$1" | sed 's/-.source=//'` echo "$t" >> $igs ;; -?source) # get arg, $2 echo "$2" >> $igs shift;; -?version) echo igawk: version 1.0 1>&2 gawk --version exit 0 ;; -[W-]*) opts="$opts '$1'" ;; *) break;; esac shift done if [ ! -s $igs ] then if [ -z "$1" ] then echo igawk: no program! 1>&2 exit 1 else echo "$1" > $igs shift fi fi # at this point, $igs has the program gawk -f igawk.awk $igs > $ige eval gawk -f '$ige' $opts -- "$@" exit $? |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:37
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/pc/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/pc/include Added Files: fcntl.h process.h stdio.h stdlib.h string.h time.h Log Message: Update package --- NEW FILE: stdio.h --- #undef __STDC__ #include <stdio.h> #define __STDC__ 1 --- NEW FILE: process.h --- #undef __STDC__ #include <process.h> #define __STDC__ 1 --- NEW FILE: time.h --- #undef __STDC__ #include <time.h> #define __STDC__ 1 --- NEW FILE: fcntl.h --- #undef __STDC__ #include <fcntl.h> #define __STDC__ 1 --- NEW FILE: string.h --- #undef __STDC__ #include <string.h> #define __STDC__ 1 --- NEW FILE: stdlib.h --- #undef __STDC__ #include <stdlib.h> #define __STDC__ 1 |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:36
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/pc In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/pc Added Files: ChangeLog Makefile Makefile.tst config.h dlfcn.c dlfcn.h gawk.def gawkmisc.pc gawkw32.def getid.c install.awk mkinstal.sh popen.c popen.h Log Message: Update package --- NEW FILE: config.h --- /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ /* * acconfig.h -- configuration definitions for gawk. */ /* * Copyright (C) 1995-2005 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif /* Define if using alloca.c. */ /* #undef C_ALLOCA */ /* Define if type char is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ /* #undef __CHAR_UNSIGNED__ */ #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #define GETGROUPS_T gid_t /* Define if the `getpgrp' function takes no argument. */ #define GETPGRP_VOID 1 /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ /* Define if you have alloca, as a function or macro. */ #define HAVE_ALLOCA 1 /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* #undef HAVE_ALLOCA_H */ /* Define if you don't have vprintf but do have _doprnt. */ /* #undef HAVE_DOPRNT */ /* Define if you have a working `mmap' system call. */ /* #undef HAVE_MMAP */ /* Define if your struct stat has st_blksize. */ #define HAVE_ST_BLKSIZE 1 /* Define if you have the ANSI # stringizing operator in cpp. */ #define HAVE_STRINGIZE 1 /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* #undef HAVE_SYS_WAIT_H */ /* Define if your struct tm has tm_zone. */ /* #undef HAVE_TM_ZONE */ /* Define if you don't have tm_zone but do have the external array tzname. */ #define HAVE_TZNAME 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define as __inline if that's what the C compiler calls it. */ #if defined (_MSC_VER) #define inline #endif /* Define if on MINIX. */ /* #undef _MINIX */ /* Define to `long' if <sys/types.h> doesn't define. */ /* #undef off_t */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef pid_t */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define to `unsigned' if <sys/types.h> doesn't define. */ /* #undef size_t */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME 1 /* Define if your <sys/time.h> declares struct tm. */ /* #undef TM_IN_SYS_TIME */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ #define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */ #define SPRINTF_RET int /* return type of sprintf */ /* #undef HAVE_MKTIME */ /* we have the mktime function */ /* #undef HAVE_SOCKETS */ /* we have sockets on this system */ /* #undef HAVE_PORTALS */ /* we have portals on /p on this system */ /* #undef DYNAMIC */ /* allow dynamic addition of builtins */ /* #undef STRTOD_NOT_C89 */ /* strtod doesn't have C89 semantics */ /* Define if you have the __argz_count function. */ #define HAVE___ARGZ_COUNT 1 /* Define if you have the __argz_next function. */ #define HAVE___ARGZ_NEXT 1 /* Define if you have the __argz_stringify function. */ #define HAVE___ARGZ_STRINGIFY 1 /* Define if you have the alarm function. */ #define HAVE_ALARM 1 /* Define if you have the dcgettext function. */ /* #undef HAVE_DCGETTEXT */ /* Define if you have the fmod function. */ #define HAVE_FMOD 1 /* Define if you have the getcwd function. */ /* #undef HAVE_GETCWD */ /* Define if you have the getpagesize function. */ /* #undef HAVE_GETPAGESIZE */ /* Define if you have the memcmp function. */ #define HAVE_MEMCMP 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memset function. */ #define HAVE_MEMSET 1 /* Define if you have the munmap function. */ /* #undef HAVE_MUNMAP */ /* Define if you have the putenv function. */ /* #undef HAVE_PUTENV */ /* Define if you have the setenv function. */ /* #define HAVE_SETENV */ /* Define if you have the setlocale function. */ /* #undef HAVE_SETLOCALE */ /* Define if you have the stpcpy function. */ /* #undef HAVE_STPCPY */ /* Define if you have the strcasecmp function. */ /* #undef HAVE_STRCASECMP */ /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define if you have the strtod function. */ #define HAVE_STRTOD 1 /* Define if you have the system function. */ #define HAVE_SYSTEM 1 /* Define if you have the tzset function. */ #define HAVE_TZSET 1 /* Define if you have the <argz.h> header file. */ /* #undef HAVE_ARGZ_H */ /* Define if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the <libintl.h> header file. */ /* #undef HAVE_LIBINTL_H */ /* Define if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the <locale.h> header file. */ /* #undef HAVE_LOCALE_H */ /* Define if you have the <malloc.h> header file. */ /* #undef HAVE_MALLOC_H */ /* Define if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the <netdb.h> header file. */ /* #undef HAVE_NETDB_H */ /* Define if you have the <netinet/in.h> header file. */ /* #undef HAVE_NETINET_IN_H */ /* Define if you have the <nl_types.h> header file. */ /* #undef HAVE_NL_TYPES_H */ /* Define if you have the <signum.h> header file. */ /* #undef HAVE_SIGNUM_H */ /* Define if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define if you have the <stdlib.h> header file. */ /* #undef HAVE_STDLIB_H */ /* Define if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define if you have the <strings.h> header file. */ /* #undef HAVE_STRINGS_H */ /* Define if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the <sys/socket.h> header file. */ /* #undef HAVE_SYS_SOCKET_H */ /* Define if you have the <sys/time.h> header file. */ #if defined(DJGPP) # define HAVE_SYS_TIME_H 1 #endif /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the <unistd.h> header file. */ #if defined(DJGPP) # define HAVE_UNISTD_H 1 #endif /* Define if you have the i library (-li). */ /* #undef HAVE_LIBI */ /* Define if you have the intl library (-lintl). */ /* #undef HAVE_LIBINTL */ /* Define if you have the m library (-lm). */ #define HAVE_LIBM 1 /* Name of package */ #define PACKAGE "gawk" /* Version number of package */ #define VERSION "3.0.89" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define to make ftello visible on some hosts (e.g. HP-UX 10.20). */ /* #undef _LARGEFILE_SOURCE */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to make ftello visible on some hosts (e.g. glibc 2.1.3). */ /* #undef _XOPEN_SOURCE */ /* Define if compiler has function prototypes */ #define PROTOTYPES 1 /* Define to 1 if you have the stpcpy function. */ /* #undef HAVE_STPCPY */ /* Define if your locale.h file contains LC_MESSAGES. */ /* #undef HAVE_LC_MESSAGES */ /* Define to 1 if NLS is requested. */ /* #undef ENABLE_NLS */ /* Define to 1 if you have gettext and don't want to use GNU gettext. */ /* #undef HAVE_GETTEXT */ /* Define as 1 if you have catgets and don't want to use GNU gettext. */ /* #undef HAVE_CATGETS */ /* The size of `unsigned int' & `unsigned long', as computed by sizeof. */ #if defined(DJGPP) || defined(_MSC_VER) # include <limits.h> #endif #if UINT_MAX == 65536 # define SIZEOF_UNSIGNED_INT 2 #endif #if UINT_MAX == 4294967295U # define SIZEOF_UNSIGNED_INT 4 #endif #if ULONG_MAX == 4294967295UL # define SIZEOF_UNSIGNED_LONG 4 #endif /* Library search path */ #define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk" #if defined (_MSC_VER) #if !defined(__STDC__) # define __STDC__ 1 #endif #undef HAVE_UNISTD_H #undef HAVE_SYS_PARAM_H #undef HAVE_RANDOM /* msc strftime is incomplete, use supplied version */ #undef HAVE_STRFTIME /* #define HAVE_TM_ZONE */ #define altzone timezone #endif # define HAVE_POPEN_H #if defined(_MSC_VER) && defined(MSDOS) #define system(s) os_system(s) #endif #if defined(_MSC_VER) || defined(__MINGW32__) #define ssize_t long int /* DJGPP has ssize_t */ #define intmax_t long #define uintmax_t unsigned long #endif #if defined (_MSC_VER) || defined(__EMX__) #define strcasecmp stricmp #define strncasecmp strnicmp #endif #if defined(DJGPP) # define HAVE_LIMITS_H 1 # undef HAVE_POPEN_H #define intmax_t long long #define uintmax_t unsigned long long #endif #if defined(__WIN32__) && defined(__CRTRSXNT__) #include <crtrsxnt.h> #endif /* For vcWin32 */ #if defined(WIN32) && defined(_MSC_VER) #define alloca _alloca #define system(s) os_system(s) #endif #if defined(__MINGW32__) #undef HAVE_SYS_PARAM_H #endif /* #define NO_LINT 1 */ --- NEW FILE: gawk.def --- NAME gawk WINDOWCOMPAT NEWFILES DESCRIPTION 'GNU awk for OS/2' --- NEW FILE: dlfcn.h --- /* ** dlfcn.h -- limited implementation of posix dynamic loading functions */ /* * Copyright (C) 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 _DLFCN_H #define _DLFCN_H /* symbols required by susv3. These are not supported here (everything is * RTLD_NOW, RTLD_GLOBAL) */ #define RTLD_LAZY 0 #define RTLD_NOW 1 #define RTLD_GLOBAL 0 #define RTLD_LOCAL 2 int dlclose(void *); char *dlerror(void); void *dlopen(const char *, int); void *dlsym(void * /*restrict*/, const char * /*restrict*/); #endif --- NEW FILE: popen.c --- #include <stdio.h> #include <stdlib.h> #include <io.h> #include <string.h> #include <process.h> #ifdef OS2 #ifdef _MSC_VER #define popen(c,m) _popen(c,m) #define pclose(f) _pclose(f) #endif #endif #if defined(WIN32) && defined(_MSC_VER) #define popen _popen #define pclose _pclose #endif #ifndef _NFILE #define _NFILE 40 #endif static char template[] = "piXXXXXX"; static struct { char *command; char *name; char pmode[4]; } pipes[_NFILE]; /* * For systems where system() and popen() do not follow SHELL: * 1. Write command to temp file. Temp filename must have slashes * compatible with SHELL (if set) or COMSPEC. * 2. Convert slashes in SHELL (if present) to be compatible with COMSPEC. * Currently, only MSC (running under DOS) and MINGW versions are managed. */ #if defined(_MSC_VER) || defined(__MINGW32__) static int unixshell(char *p) { static char *shell[] = {"sh", "bash", "csh", "tcsh", "sh32", "sh16", "ksh", NULL}; char **shellp = shell, *s, *q; if (p == NULL) return (0); s = p = strdup(p); if ((q = strrchr(p, '\\')) != NULL) p = q + 1; if ((q = strrchr(p, '/')) != NULL) p = q + 1; if ((q = strchr(p, '.')) != NULL) *q = '\0'; strlwr(p); do { if (strcmp(*shellp, p) == 0) break; } while (*++shellp); free(s); return(*shellp ? 1 : 0); } static char * slashify(char *p, char *s) { if (unixshell(s)) while (s = strchr(p, '\\')) *s = '/'; else while (s = strchr(p, '/')) *s = '\\'; return(p); } static char * scriptify(char *command) { FILE *fp; char *cmd, *name, *s, *p; int i; if((name = tempnam(".", "pip")) == NULL) return(NULL); p = getenv("COMSPEC"); s = getenv("SHELL"); cmd = malloc(strlen(name) + (s ? strlen(s) : 0) + 9); *cmd = '\0'; if (s) { slashify(strcpy(cmd, s), p); p = s; } slashify(name, p); if (! (i = unixshell(p))) { char *p = (char *) realloc(name, strlen(name) + 5); if (p == NULL) return NULL; name = p; strcat(name, ".bat"); } if (s) sprintf(cmd + strlen(cmd), " %cc ", unixshell(s) ? '-' : '/'); strcpy(p = cmd + strlen(cmd), name); free(name); if ((fp = fopen(p, i ? "wb" : "w")) != NULL) { if (! i) fputs("@echo off\n", fp); i = strlen(command); if ((fwrite(command, 1, i, fp) < i) || (fputc('\n', fp) == EOF)) cmd = NULL; } else cmd = NULL; if (fp) fclose(fp); return(cmd); } static void unlink_and_free(char *cmd) { char *s; if (s = strrchr(cmd, ' ')) s++; else s = cmd; unlink(s); free(cmd); } int os_system(char *cmd) { char *s; int i; #if defined(OS2) if (_osmode == OS2_MODE) return(system(cmd)); #endif if ((cmd = scriptify(cmd)) == NULL) return(1); if (s = getenv("SHELL")) i = spawnlp(P_WAIT, s, s, cmd + strlen(s), NULL); else i = system(cmd); unlink_and_free(cmd); return(i); } #else #define os_system(cmd) system(cmd) #endif FILE * os_popen( char *command, char *mode ) { FILE *current; char *name; int cur; char curmode[4]; #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) return(popen(command, mode)); #endif if (*mode != 'r' && *mode != 'w') return NULL; strncpy(curmode, mode, 3); curmode[3] = '\0'; #if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32)) current = popen(command = scriptify(command), mode); cur = fileno(current); strcpy(pipes[cur].pmode, curmode); pipes[cur].command = command; return(current); #endif /* ** get a name to use. */ if((name = tempnam(".","pip"))==NULL) return NULL; /* ** If we're reading, just call system to get a file filled with ** output. */ if (*curmode == 'r') { FILE *fp; if ((cur = dup(fileno(stdout))) == -1) return NULL; *curmode = 'w'; if ((current = freopen(name, curmode, stdout)) == NULL) return NULL; os_system(command); if (dup2(cur, fileno(stdout)) == -1) return NULL; close(cur); *curmode = 'r'; if ((current = fopen(name, curmode)) == NULL) return NULL; } else { if ((current = fopen(name, curmode)) == NULL) return NULL; } cur = fileno(current); pipes[cur].name = name; strcpy(pipes[cur].pmode, curmode); pipes[cur].command = strdup(command); return current; } int os_pclose( FILE * current) { int cur = fileno(current); int fd, rval; #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) return(pclose(current)); #endif #if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32)) rval = pclose(current); *pipes[cur].pmode = '\0'; unlink_and_free(pipes[cur].command); return rval; #endif /* ** check for an open file. */ switch (*pipes[cur].pmode) { case 'r': /* ** input pipes are just files we're done with. */ rval = fclose(current); unlink(pipes[cur].name); break; case 'w': /* ** output pipes are temporary files we have ** to cram down the throats of programs. */ fclose(current); rval = -1; if ((fd = dup(fileno(stdin))) != -1) { char *mode = pipes[cur].pmode; *mode = 'r'; if (current = freopen(pipes[cur].name, mode, stdin)) { rval = os_system(pipes[cur].command); fclose(current); if (dup2(fd, fileno(stdin)) == -1) rval = -1; close(fd); } } unlink(pipes[cur].name); break; default: return -1; } /* ** clean up current pipe. */ *pipes[cur].pmode = '\0'; free(pipes[cur].name); free(pipes[cur].command); return rval; } --- NEW FILE: gawkw32.def --- ;; export definitions for Windows32 gawk ;; this is to support extension libraries -- this should generate a gawk.lib ;; against which they can link ;; don't change the ordinals (the numbers after the function names) EXPORTS ;; functions related directly to adding external functions get_argument @1 set_value @2 make_builtin @3 get_curfunc_arg_count @4 ;; functions for manipulating data types mk_number @11 tmp_string @12 unref @13 r_force_string @14 r_force_number @15 nodetype2str @16 ;; incidental other functions assoc_lookup @31 assoc_clear @32 r_dupnode @33 set_loc @34 update_ERRNO @35 r_fatal @36 get_actual @37 ;; data -- note that this must be redeclared with __declspec(dllimport) in the extension ;; library since the exported symbol is actually a pointer to the data CONVFMTidx @101 lintfunc @102 do_lint @103 stack_ptr @104 --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Sun Jun 26 09:31:35 2005 Scott Deifik <sc...@am...> * Makefile: Decrease stack size for MSC. * Makefile.tst (Maketests): Syncronized with what's happening in the main dist. Thu Apr 28 23:08:51 2005 Scott Deifik <sc...@am...> * config.h, Makefile.tst: Synced to main distribution. Wed Feb 16 10:20:18 2005 Scott Deifik <sc...@am...> * Makefile: Decrease stack size for MSC. * Makefile.tst: Syncronized with what's happening in the main dist. * config.h: Improved for DJGPP. Wed Feb 9 14:38:38 2005 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Syncronized with what's happening in the main dist. Thu Feb 3 14:57:28 2005 Scott Deifik <sc...@am...> * config.h (SIZEOF_UNSIGNED_INT, SIZEOF_UNSIGNED_LONG): Add definitions. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Sun Jun 13 17:40:09 2004 Scott Deifik <sc...@am...> * Makefile: Reduce the stack size for MSC. * Makefile.tst: Synchronized with main distribution. Sun Jun 13 17:39:47 2004 Arnold D. Robbins <ar...@sk...> * Makefile (AWKOBJS2, PAWKOBJS2): Restore version.o. Tue Jun 1 22:31:36 2004 Arnold D. Robbins <ar...@sk...> * Makefile (AWKOBJS2, PAWKOBJS2): Remove version.o. Per Jim Meyering: * popen.c (scriptify): Check `realloc' return value. Tue Mar 2 18:10:55 2004 Arnold D. Robbins <ar...@sk...> * Makefile (LIBOJBS): Add `dfa$O' into list. (main$O rule): Removed, since patchlev.h not part of dist anymore. Tue Mar 2 18:09:54 2004 Scott Deifik <sc...@am...> * config.h (HAVE_ALLOCA_H): Undefine. * Makefile (LMSC): Adjust stack size for MSC. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Thu Jun 26 15:00:20 2003 Scott Deifik <sc...@am...> * Makefile.tst: Synchronized to main dist. Sun Jun 15 19:27:58 2003 Patrick T.J. McPhee <pt...@in...> * config.h: Separate the ifdefs for os_system from ssize_t etc. Sun Jun 15 19:05:15 2003 Scott Deifik <sc...@am...> * Makefile.tst: Synchronized to main dist. Mon Jun 9 17:12:24 2003 Patrick T.J. McPhee <pt...@in...> * dlfcn.c, dlfcn.h, gawke32.def: New files. * Makefile: Changes to allow dynamic linking of libraries under Windows32. Sun May 11 15:19:52 2003 Scott Deifik <sc...@am...> * config.h: Update defs for ssize_t, intmax_t, uintmax_t. * Makefile: Update compile options. * gawkmisc.pc (memcpy_long, memset_long): New functions. * Makefile.tst: Synchronized with test/Makefile. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Sun Feb 23 16:25:44 2003 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Synchronized to main dist. Sun Feb 16 15:44:20 2003 Scott Deifik <sc...@am...> * config.h: Updated. Sun Feb 9 11:57:11 2003 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Synchronized to main dist. Tue Feb 4 14:28:06 2003 Arnold D. Robbins <ar...@sk...> All relevant files: Copyright year updated to 2003. Sun Nov 24 18:37:31 2002 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Synchronized to main dist. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Thu Apr 18 17:29:16 2002 Scott Deifik <sc...@am...> * Makefile.tst (strftime): Remove comment on call to $(CMP). Sun Mar 10 17:05:35 2002 Scott Deifik <sc...@am...> * Makefile.tst: More clean up and sync with ../test/Makefile. Thu Jan 3 15:20:17 2002 Scott Deifik <sc...@am...> * Makefile.tst: Minor clean up and sync with ../test/Makefile. Wed Dec 19 16:01:58 2001 Peter J. Farley III <pjf...@do...> * gawkmisc.pc: Just use single quote for `quote' for all cases. Wed Dec 19 15:59:52 2001 Eli Zaretskii <el...@is...> * install.awk: Install gawkinet.info as well. * awklib/igawk.awk: Bring in sync with awklib/eg/prog/igawk.sh. * makefile (PRSPFILE, PRSP, PLDRSP, DO_PLNK, DO_PBIND, PLDJG): New variables. (djgpp, djgpp-debug): Set PLNK and PBIND. (PBIND): Define to EMPTY as default. (PAWKOBJS1, PAWKOBJS2, PGAWKOBJS): New variables. (all): Add pgawk.exe. (pgawk.exe, $(PRSPFILE)): New rules. ($(ALLOBJS)): Add eval_p.o and profile_p.o to the list of files that are dependent on awk.h, dfa.h, regex.h, and config.h. (eval_p$O, profile_p$O): New dependencies. (clean): Add pgawk and $(PRSPFILE) to files that are to be cleaned up. Tue Dec 4 16:44:07 2001 Andreas Buening <and...@ne...> Updated OS/2 support. * gawkmisc.pc (quote): Use single quote for __EMX__. (os_arg_fixup): new OS/2 code. (os_devopen): for OS/2 return -1. (ispath): check for leading drive letter for __EMX__. (os_close_on_exec): Add check for defined __EMX__. (os_is_setuid): Add real code for __EMX__. (_os2_is_abs_path): new function. (_os2_unixroot): new function. (_os2_unixroot_path): new function. Tue Sep 25 15:19:53 2001 Arnold D. Robbins <ar...@sk...> * gawkmisc.pc (os_close_on_exec): If fd <= 2, return. Sun Jun 3 13:04:44 2001 Arnold D. Robbins <ar...@sk...> * Release 3.1.0: Release tar file made. And there was rejoicing. Tue Jan 30 10:56:05 2001 Arnold D. Robbins <ar...@sk...> * config.h: Per Kay Uwe Rommel, turn on HAVE_FCNTL_H for all PC platforms so that BINMODE works on all. Sun Jan 28 15:50:02 2001 Eli Zaretskii <el...@is...> * gawkmisc.pc (gawk_name): Support file names with mixed forward- and back-slashes. (orig_tty_mode): New variable. (os_setbinmode): Save the original mode of the console device. [__DJGPP__]: Allow the program to be interrupted with Ctrl-C even though the console was switched to binary mode. (os_restore_mode): New function. Wed Jan 17 10:59:32 2001 Eli Zaretskii <el...@is...> * gawkmisc.pc (os_close_on_exec) [__DJGPP__]: Don't print the warning about failure to set close-on-exec bit, unless it's DJGPP 2.04 or later. Wed Jan 3 19:11:00 2001 Darrel Hankerson <ha...@au...> * popen.c: write script files in binary only if the shell is unix-like. * Makefile: set threshold (-Gt) on MSC 16bit versions to obtain sufficient stack. 3.0.91 builtin.c compiles with optimization, in MSC[67], so remove the special compile Wed Jan 3 19:54:12 2001 Arnold D. Robbins <ar...@sk...> * config.h, gawkmisc.pc: Allow fcntl if DGJPP. From Scott. Sun Dec 3 16:53:37 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.pc (os_setbinmode): new function. Sun Dec 3 14:56:38 2000 Arnold D. Robbins <ar...@sk...> * Makefile, Makefile.tst, gawkmisc.pc: updated from Scottd. * popen.c: updated from Darrell Hankerson. Wed Nov 22 11:47:00 2000 Arnold D. Robbins <ar...@sk...> * gawk.rsp, pc_popen.c, pc_popen.h, Makefile, Makefile.tst, gawkmisc.pc: Synched with diffs from Scott Deifik. * config.h: Updated from main dist, best guess by me, will probably need tweaking. Tue Nov 7 14:09:14 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.pc (os_is_setuid): new function. Thu Nov 5 16:50:09 1998 Arnold D. Robbins <ar...@gn...> * gawkmisc.pc (os_devopen): handle "/dev/null". Wed Jul 30 19:53:52 1997 Arnold D. Robbins <ar...@gn...> * Close-on-exec changes: gawkmisc.pc: (os_close_on_exec, os_isdir): new functions. Mon Aug 7 15:23:00 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.6: Release tar file made. Sun Jun 25 15:08:19 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.5: Release tar file made. Wed Jun 21 16:44:54 2000 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: synchronized with main dist, again. Thu May 18 14:07:52 2000 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: synchronized with main dist. * config.h: Define HAVE_LIMITS_H as 1. Wed Jun 30 16:14:36 1999 Arnold D. Robbins <ar...@gn...> * Release 3.0.4: Release tar file made. This time for sure. Sun Jun 27 12:27:00 1999 Darrel Hankerson <ha...@ma...> * Makefile, Makefile.tst, ../README_d/README.pc: finalized. * include/process.h: new file Fri May 21 00:00:00 1999 Darrel Hankerson <ha...@ma...> * popen.c: MSC (on DOS/Windows32) and MINGW32 now honor SHELL. * io.c: MINGW32 reports errno==0 after failure in redirect(); assume close_one() in this case. * io.c: Add HAVE_POPEN_H and let pc/config.h deal with the mess. (Can't move everything to config.h because of popen define.) Sun May 9 09:12:33 1999 Darrel Hankerson <ha...@ma...> * Add 1999-04-30 changes from Eli Zaretskii <el...@is...> 1. Makefile (TAGS, tags): New targets. 2. Makefile.tst (regtes): Pass the value of $CMP to the regtest script. Thu Nov 18 03:48:32 1998 Scott Deifik <sc...@am...> * Readme.pc: More LFN-based comments. Thu Nov 12 21:01:24 1998 Darrel Hankerson <ha...@ma...> * mingw32 target added with corresponding minor changes to getid.c, io.c, and config.h. * vcWin32 needed popen defines in config.h which were inadvertently omitted from 3.0.3. * README.pc updated to clarify the procedure for building non-LFN versions on LFN systems, and to note that Windows32 gawk may require Windows32 utilities. * emxbnd target modified to accomodate older versions of emx. Thu Nov 08 09:11:44 1998 Scott Deifik <sc...@am...> * pc/Makefile: Stack reduced again for 16bit MSC versions. * pc/Makefile.tst: Updated to keep in sync with new test/Makefile.in. In addition, made to work in Windows 9x with non-LFN tools. Thu May 15 12:49:08 1997 Arnold D. Robbins <ar...@sk...> * Release 3.0.3: Release tar file made. Tue May 13 20:06:09 1997 Darrel Hankerson <ha...@ma...> * vcWin32 target added. Some new tests for WIN32 in gawkmisc.c io.c, and regex.c. Makefile changes for nmake, which can't expand $($x). * config.h updated for BITOPS and NONDECDATA (also in Makefile). Fri Apr 18 07:55:47 1997 Arnold D. Robbins <ar...@sk...> * BETA Release 3.0.34: Release tar file made. Fri Jan 17 19:20:45 1997 Darrel Hankerson <ha...@ma...> * Makefile: add KUR's emxnt target for emx+RSXNT. Create awk.exe "link" to gawk.exe for djgpp target. (Suggested by Eli Zaretskii. Should be done as part of a smarter install, since awk.exe only works with djgpp gawk.exe.) Separate djgpp-v1 into djgppv1 target. Install awk.exe if present. * install.awk: install awk.exe if present (only for djgpp) * config.h: additional include for emx+RSXNT. Wed Dec 25 11:25:22 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.2: Release tar file made. Tue Dec 10 23:09:26 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.1: Release tar file made. Thu Aug 1 19:46:00 1996 Scott Deifik <sc...@am...> * Makefile: Changes for MSC 8. Wed Jan 10 22:58:55 1996 Arnold D. Robbins <ar...@sk...> * ChangeLog created. --- NEW FILE: gawkmisc.pc --- /* * gawkmisc.c --- miscellaneous gawk routines that are OS specific. */ /* * Copyright (C) 1986, 1988, 1989, 1991 - 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. * * GAWK 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. * * GAWK 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 */ char quote = '\''; char envsep = ';'; # ifdef DEFPATH char *defpath = DEFPATH; # else char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk"; # endif #ifdef __EMX__ #include<io.h> static int _os2_is_abs_path(const char *dirname); static char* _os2_unixroot(const char *path); static const char* _os2_unixroot_path(const char *path); #endif /* gawk_name --- pull out the "gawk" part from how the OS called us */ char * gawk_name(filespec) const char *filespec; { char *p, *q; p = (char *) filespec; /* Sloppy... */ /* OS/2 allows / for directory separator too */ if ((q = strrchr(p, '\\')) != NULL) p = q + 1; if ((q = strrchr(p, '/')) != NULL && (p == NULL || q > p)) /* support mixed d:\foo/bar\gawk.exe */ p = q + 1; if ((q = strchr(p, '.')) != NULL) *q = '\0'; return strlwr(p); } /* * memcpy_long() & memset_ulong() are 32-bit replacements for MSC which * has a 16-bit size_t. */ char * memcpy_ulong (dest, src, l) register char *dest; register const char *src; register unsigned long l; { register char *ret = dest; while (l--) *dest++ = *src++; return ret; } void * memset_ulong(dest, val, l) void *dest; register int val; register unsigned long l; { register char *ret = dest; register char *d = dest; while (l--) *d++ = val; return ((void *) ret); } /* os_arg_fixup --- fixup the command line */ void os_arg_fixup(argcp, argvp) int *argcp; char ***argvp; { #ifdef __EMX__ # ifdef initialize_main initialize_main(argcp, argvp); # else _wildcard(argcp, argvp); _response(argcp, argvp); # endif setvbuf(stdout, NULL, _IOLBF, BUFSIZ); defpath = (char*) _os2_unixroot_path(defpath); #endif /* __EMX__ */ return; } /* os_devopen --- open special per-OS devices */ int os_devopen(name, flag) const char *name; int flag; { #ifdef __EMX__ /* do not use open(name, flag) here !!! */ return -1; #else if (strcmp(name, "/dev/null") == 0) return open("NUL", flag); /* FIXME: */ /* else if (strcmp(name, "/dev/tty") == 0) * return open("???", flag); */ return -1; #endif } /* optimal_bufsize --- determine optimal buffer size */ size_t optimal_bufsize(fd, stb) int fd; struct stat *stb; { /* force all members to zero in case OS doesn't use all of them. */ memset(stb, '\0', sizeof(struct stat)); /* * DOS doesn't have the file system block size in the * stat structure. So we have to make some sort of reasonable * guess. We use stdio's BUFSIZ, since that is what it was * meant for in the first place. */ #define DEFBLKSIZE BUFSIZ if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); if (S_ISREG(stb->st_mode) && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } /* ispath --- return true if path has directory components */ int ispath(file) const char *file; { #ifdef __EMX__ return (strpbrk(file, "/\\") != NULL || (toupper(file[0]) >= 'A' && toupper(file[0]) <= 'Z' && file[1] == ':')); #else for (; *file; file++) { switch (*file) { case '/': case '\\': case ':': return 1; } } return 0; #endif } /* isdirpunct --- return true if char is a directory separator */ int isdirpunct(c) int c; { return (strchr(":\\/", c) != NULL); } /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; const char *name, *what, *dir; { #if ! defined(_MSC_VER) && ! defined(__MINGW32__) # if (defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 4)) || defined __EMX__ if (fd <= 2) /* sanity */ return; if (fcntl(fd, F_SETFD, 1) < 0) warning("%s %s `%s': could not set close-on-exec: %s", what, dir, name, strerror(errno)); # endif #endif } /* os_isdir --- is this an fd on a directory? */ #if ! defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif int os_isdir(fd) int fd; { struct stat sbuf; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } /* os_is_setuid --- true if running setuid root */ int os_is_setuid() { #ifdef __EMX__ long uid, euid; uid = getuid(); euid = geteuid(); return (euid == 0 && euid != uid); #else return 0; #endif } /* os_setbinmode --- set binary mode on file */ #ifdef __DJGPP__ #include <sys/exceptn.h> #endif static int orig_tty_mode = -1; int os_setbinmode(fd, mode) int fd, mode; { int prev_mode = setmode(fd, mode); #ifdef __DJGPP__ if ((mode & O_BINARY) != 0) __djgpp_set_ctrl_c(1); /* allow to interrupt with Ctrl-C */ #endif /* Save the original tty mode as we found it. */ if (orig_tty_mode == -1 && fd >= 0 && fd <= 2) orig_tty_mode = prev_mode; return prev_mode; } /* os_restore_mode --- restore the original mode of the console device */ void os_restore_mode (fd) int fd; { if (orig_tty_mode != -1) { setmode(fd, orig_tty_mode); } } #ifdef __EMX__ # ifndef PATH_SEPARATOR # define PATH_SEPARATOR ';' # endif /* result is 0 if dirname is no absolute path, 1 otherwise */ static int _os2_is_abs_path(const char *dirname) { int result = 0; if (dirname != NULL && dirname[0] != '\0') { /* if dirname contains a valid drive letter like "c:" */ if (((dirname[0] >= 'A' && dirname[0] <= 'Z') || (dirname[0] >= 'a' && dirname[0] <= 'z')) && dirname[1] == ':') dirname += 2; /* remove the drive letter */ if (dirname[0] == '/' || dirname[0] == '\\') result = 1; /* asbolute path */ } return result; } /* path is assumed to be a list of directories separated by PATH_SEPARATOR. This function determines if the first directory of path is on the drive specified by the environment variable UNIXROOT. If it is the case, NULL is returned, otherwise a new directory name is allocated using the drive letter from UNIXROOT and returned as result. If the first directory is a relative path NULL is returned, too. The new directory name is allocated by malloc(). Example (UNIXROOT is set to "e:"): "c:/usr/share" -> "e:/usr/share" "e:/usr/share" -> NULL (already on the $UNIXROOT drive) "/usr/share" -> "e:/usr/share" "." -> NULL (not an absolute path) "usr/share" -> NULL (not an absolute path) "c:usr/share" -> NULL (not an absolute path) "c:/usr/share;d:/etc" -> "e:/usr/share" (only the first directory in path is used) */ static char* _os2_unixroot(const char *path) { static const char *unixroot = NULL; static int unixroot_init = 0; char *result = NULL; if (unixroot_init == 0) { /* get $UNIXROOT only one time */ unixroot = getenv("UNIXROOT"); /* check whether unixroot is valid (must be "x:") */ if (unixroot != NULL) { int drive = toupper(unixroot[0]); if (drive < 'A' || drive > 'Z' || unixroot[1] != ':' || unixroot[2] != '\0') unixroot = NULL; /* unixroot not valid */ } unixroot_init = 1; /* initialized */ } /* note: if unixroot != NULL then it contains a valid drive letter */ if (unixroot != NULL && _os2_is_abs_path(path)) { /* dirname is an absolute path and unixroot is a drive letter, "c:" for example */ size_t old_path_len = strlen(path); /* end points to the first ';' in path or to NULL */ const char *end = strchr(path, PATH_SEPARATOR); /* dir_len is the length of the first directory in path */ size_t dir_len = (end) ? end - path : old_path_len; if (toupper(unixroot[0]) != toupper(path[0]) || path[1] != ':') { /* the first directory of path does not start with the string $UNIXROOT */ if (path[1] == ':') { /* if there is a drive letter remove it */ dir_len -= 2; path += 2; } result = malloc(dir_len + 3); if (result) { /* do nothing if we are out of memory */ result[0] = unixroot[0]; result[1] = unixroot[1]; memcpy(result + 2, path, dir_len); result[dir_len + 2] = '\0'; } } } return result; } /* path is assumed to be a list of directories separated by PATH_SEPARATOR. Every directory is processed. _os2_unixroot() is used to find out whether these directories are on the drive specified by the environment variable UNIXROOT. If this is not the case the same directory on the UNIXROOT drive is added to the end of path. If path is a valid path this function returns a valid path, too. Example ($UNIXROOT is set to "e:"): ".;c:/usr/local;d:/usr/local;d:/etc;e:/etc" -> ".;c:/usr/local;d:/usr/local;d:/etc;e:/etc;e:/usr/local;e:/usr/local;e:/etc" */ static const char* _os2_unixroot_path(const char *path) { char *result = NULL; const char *p = path; unsigned dir_count = 1; if (path == NULL || path[0] == '\0') return NULL; /* empty path */ /* save number of path components in dir_count */ while(*p) { if (*p++ == PATH_SEPARATOR && *p != '\0' && *p != PATH_SEPARATOR) dir_count += 1; } { const char *list[dir_count]; /* list of char pointers */ size_t dir_len[dir_count]; /* the according directory length */ size_t old_path_len = strlen(path); /* the old path length */ size_t total_len; unsigned i = 0; if (path[old_path_len - 1] == PATH_SEPARATOR) /* last character is ';' */ old_path_len--; list[0] = p = path; /* first directory */ while(*p) { if (*p++ == PATH_SEPARATOR && *p != '\0' && *p != PATH_SEPARATOR) list[++i] = p; } /* now list[i] contains the ith directory of path (no 0-terminated strings!!!) */ /* determine the total length for the new path */ total_len = old_path_len; for(i = 0; i < dir_count; i++) { list[i] = _os2_unixroot(list[i]); if (list[i] != NULL) { dir_len[i] = strlen(list[i]); total_len += dir_len[i] + 1; /* one character for ';' or '\0' */ } else dir_len[i] = 0; } /* now list[] contains the according directories on the UNIXROOT drive or NULL total_len contains the total length for the new path */ result = malloc(total_len + 1); if (result) { /* copy the old path and the new directories into the new path */ char *q = result; memcpy(q, path, old_path_len); q += old_path_len; for(i = 0; i < dir_count; i++) { if (dir_len[i] != 0) { *q++ = PATH_SEPARATOR; memcpy(q, list[i], dir_len[i]); q += dir_len[i]; } } *q = '\0'; /* terminating '\0' */ } for(i = 0; i < dir_count; i++) free((void*) list[i]); } return (result) ? (const char*) result : path; } #endif /* __EMX__ */ --- NEW FILE: getid.c --- #if defined(_MSC_VER) || defined(__MINGW32__) #ifdef OS2 # define INCL_DOSPROCESS # include <os2.h> # if _MSC_VER == 510 # define DosGetPID DosGetPid # endif #else # include <process.h> #endif #ifdef OS2 int getpid(void) { PIDINFO PidInfo; DosGetPID(&PidInfo); return(PidInfo.pid); } #endif unsigned int getuid (void) { return (0); /* root! */ } unsigned int geteuid (void) { return (0); } unsigned int getgid (void) { return (0); } unsigned int getegid (void) { return (0); } #endif int getpgrp(void) { return (0); } #if defined(_MSC_VER) || defined(__GO32__) || defined(__MINGW32__) int getppid(void) { #ifdef OS2 PIDINFO PidInfo; DosGetPID(&PidInfo); return(PidInfo.pidParent); #else return(0); #endif } #endif --- NEW FILE: Makefile --- # Makefile for gawk (GNU awk) Dec 2000 # # - for GNU C (djgpp) [32bit executable for DOS] # - for GNU C (emx) [32bit executable for OS/2 or DOS or Windows32] # - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT] # - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT] # - for Microsoft C 7 [16bit ececutable for DOS] # - for Microsoft C 6.00A [16bit executable for OS/2 or DOS] # Tested with GNU make and dmake-3.8 under OS/2 and DOS, and ndmake and # Microsoft nmake under DOS. Compiling with dmake under DOS may require the # DOS-only version of dmake (so that swapping works). nmake requires a # few edits in the configuration section below. default: @echo "Enter $(MAK) target " @echo " where 'target' is chosen from " @echo " djgpp ... DOS 32-bit exe [GNU C, Delorie, v2] " @echo " djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1] " @echo " emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] " @echo " emxnt ... NT exe [emx/gcc with RSXNT] " @echo " emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc] " @echo " mingw32 . Windows32 exe [Mingw32 GNU C] " @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] " @echo " msc6 .... DOS exe [Microsoft C 6.00a] " @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] " @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] " @echo " vcWin32 . Windows32 exe [Microsoft Visual C] " @echo " ----------------------------------------------------- " @echo " test .... Perform tests (see README_d/README.pc) " @echo " install . Install gawk under $(prefix)/ " # Support dropped in 3.0 # - for Microsoft C 5.1 [16bit executable for OS/2 or DOS] # @echo " msc51 DOS exe [Microsoft C 5.1] " # @echo " msc51bnd OS/2 and DOS exe [Microsoft C 5.1] " #======================= Configuration ================================== RSPFILE = gawk.rsp PRSPFILE = pgawk.rsp # # Choose method for passing arguments to the linker. # # If compiling under OS/2 or if make can pass long lines #LDRSP = $(GAWKOBJS) #LNKRSP = $(LDRSP) # # else if make == dmake # Response files for linker: dmake allows the macro expansion # $(macro_name:modifier_list:modifier_list:...) # The macro mktmp creates a temporary file for the linker. # The 't' modifier is for tokenization. #LDRSP = @$(mktmp $(<:t"\n")) #LNKRSP = @$(mktmp $(<:t"+\n") ) # Space before final paren req # # else use brain-dead approach (emxbnd will need 'tr'). RSP = $(RSPFILE) PRSP = $(PRSPFILE) LDRSP = @$(RSP) PLDRSP = @$(PRSP) LNKRSP = $(LDRSP) #------------------------------------------------------------------------ # Some makes do not define MAKE (and ndmake does not allow a define). # Define MAK to be your make command. #MAKE = dmake MAK = $(MAKE) $(MAKEFILE) #MAK = $(MAKE) #MAKEFILE = -f Makefile #MAK = make45 $(MAKEFILE) #------------------------------------------------------------------------ # Define the base directory for the install. "make install" will install # in bin, lib/awk, man, and info under $(prefix)/. Most likely, you should # edit config.h so that $(prefix)/lib/awk appears as part of DEFPATH. #prefix = prefix = c:/gnu # # Define the install method. Method 1 is Unix-like (and requires cat, # cp, mkdir, sed, and sh); method 2 uses gawk and batch files. install = 1 #------------------------------------------------------------------------ # To work around command-line length problems, this makefile assumes # that $($X) can be expanded. If using a make (such as nmake) which # cannot handle such macros, define DO_LNK and DO_BIND for your target # as $(L<target>) and $(B<target>), resp.; e.g., #DO_LNK = $(LvcWin32) #DO_PLNK = $(PLvcWin32) # and then comment the following: DO_LNK = $($(LNK)) DO_BIND= $($(BIND)) DO_PLNK = $($(PLNK)) DO_PBIND= $($(PBIND)) #------------------------------------------------------------------------ # For dynamic extension support, uncomment these lines # pick the appropriate .def file entry for your compiler #DYN_FLAGS=-DDYNAMIC #DYN_EXP=gawk.exp #DYN_OBJ=dlfcn$O $(DYN_EXP) #DYN_MAKEXP=$(DMEvcWin32) #DYN_MAKEXP=$(DMEmingw32) # #======================================================================== # End of general configuration. Some platform-specific configuration # notes appear below. #======================================================================== #========================== DJGPP ======================================= #======================================================================== LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2) PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2) BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk djgpp: $(MAK) all \ CC=gcc O=.o CF=-O2 \ LNK=LDJG PLNK=PLDJG LF=-s LF2=-lm \ BIND=BDJG PBIND='' djgpp-debug: $(MAK) all \ CC=gcc O=.o CF='-O2 -g' \ LNK=LDJG PLNK=PLDJG LF2=-lm \ BIND=BDJG PBIND='' LDJGv1 = $(CC) $(LF) -o gawk $(LDRSP) $(LF2) #BDJGv1 = coff2exe -s /djgpp/bin/go32.exe gawk BDJGv1 = coff2exe gawk djgppv1: $(MAK) all \ CC=gcc O=.o CF=-O \ LNK=LDJGv1 LF=-s LF2=-lm \ BIND=BDJGv1 #======================================================================== #========================== EMX ========================================= #======================================================================== # Link command for OS/2 versions. LEMX = $(CC) $(LF) -o $@ $(GAWKOBJS) gawk.def -lbsd $(LF2) # Link and bind for DOS and OS/2 versions. # emx-09 needs '-p' emx option here or in EMXOPT environ var. # The following works with 0.9a or newer LEMXBND = $(CC) $(LF) -o gawk $(LDRSP) gawk.def -lbsd $(LF2) BEMX = emxbind -bs gawk -p # The following works with 0.9c or newer #LEMXBND = $(CC) $(LF) -o a.out $(LDRSP) gawk.def -lbsd $(LF2) #BEMX = emxbind -bs -o $@ a.out -p #BEMX = emxbind -bs /emx/bin/emx.exe a.out $@ -p BEMXD = emxbind -b -o $@ a.out -p emx: $(MAK) all \ "CC=gcc -Zomf" O=.obj "CF=-O -DOS2" \ LNK=LEMX "LF=-s -Zcrtdll -Zstack 512" RSP= emxnt: $(MAK) all \ "CC=gcc -Zwin32 -Zcrtdll=rsxntcs" O=.o "CF=-O -DOS2" \ LNK=LEMX "LF=-s -Zstack 512" RSP= emxbnd: $(MAK) all \ CC=gcc O=.o "CF=-O -DOS2 -DMSDOS" OBJ=popen.o \ LNK=LEMXBND \ BIND=BEMX "P=|tr \" \" \"\n\"" emxbnd-debug: $(MAK) all \ CC=gcc O=.o "CF=-g -DOS2 -DMSDOS" OBJ=popen.o \ LNK=LEMXBND \ BIND=BEMXD "P=|tr \" \" \"\n\"" #======================================================================== #========================== MINGW32 ===================================== #======================================================================== DMEmingw32 = dlltool -D gawk.exe -d gawkw32.def -e gawk.exp -l libgawk.a LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2) PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2) # The following might work around command-line length limitations: #LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2) mingw32: $(MAK) all \ CC=gcc O=.o CF=-O OBJ=popen.o \ LNK=LMINGW32 PLNK=PLMINGW32 LF=-s RSP= #======================================================================== #========================== MSC ========================================= #======================================================================== # stdargv, glob, and director are from Stewartson's sh. These provide # globbing and enhanced argument-passing. MSC setargv.obj is a # more limited alternative (and it will permit a bound version). #STDARGV = stdargv.obj glob.obj director.obj STDARGV = setargv.obj # Optimization and library options: # Os == optimize for size, Ot == optimize for speed, G2 == 286 or better #MSCOPT = -Gt3600 -Os -G2 # MSC seems to be more stable with -Od than with -Ot, but then regexec.c gives # "code segment too large" error when compiling. Adding -G2y fixes this and # lets us keep the -Od. MSCOPT = -Gt3600 -Od -G2y # Alternate lib, does not use math coprocessor. #MSCLIB = llibca #MSCCL = -FPa # Emulator lib, uses math coprocessor if present. MSCLIB = llibce MSCCL = -FPi #MSCCL = -FPc # If the stack gets much smaller than 3000, the "longwrds" test fails. LMSC = link $(LF) $(LNKRSP) $(STDARGV)/NOE,$@,,/NOD:llibce $(MSCLIB)$(LF2)/STACK:0x2eb0,nul # CLMSC-linking works when building under OS/2 CLMSC = $(CC) -o $@ $(LF) $(GAWKOBJS) $(STDARGV) $(LF2) -link /NOE/NOI/STACK:0x6f00 BMSC = bind $@ /n DOSMAKEPIPE DOSCWAIT # Ugly hack: config.h defines __STDC__ if not defined on command-line. # OS/2 versions can't use -Za in getid.c. MSC7 uses stub headers in pc/ # due to ANSI conflicts. MSC 5.1 defines __STDC__=0 regardless of ANSI flag. # dmake-3.8 runs out of memory under DOS. Request that dmake # swap itself out on these targets. Note that this won't have # any affect on the bound OS/2 and DOS version of dmake-3.8. .SWAP: msc msc-debug msc6 msc6os2 msc6bnd msc51 check msc: $(MAK) all \ "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include $(MSCOPT)" \ OBJ=popen.obj \ LNK=LMSC P=+ Lmsc = $(LMSC) # for broken makes (nmake) which cannot expand $($X) Bmsc = msc-debug: $(MAK) all \ "CC=cl $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include -W2 -Zi -Od" \ OBJ=popen.obj \ LNK=LMSC LF2=/CO P=+ msc6: # $(MAK) builtin.obj \ # "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT) -Od" $(MAK) all \ "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT)" \ OBJ=popen.obj \ LNK=LMSC P=+ Lmsc6 = $(LMSC) # for broken makes (nmake) which cannot expand $($X) Bmsc6 = msc6os2: # $(MAK) builtin.obj \ # "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT) -Od" $(MAK) all \ "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT)" \ LNK=LMSC "LF2=p,gawk.def" P=+ msc6bnd: # $(MAK) builtin.obj \ # "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT) -Od" $(MAK) all \ "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT)" \ OBJ=popen.obj \ LNK=LMSC "LF2=p,gawk.def" P=+ \ BIND=BMSC Lmsc6bnd = $(LMSC) # for broken makes (nmake) which cannot expand $($X) Bmsc6bnd = $(BMSC) # Windows '9x / NT DMEvcWin32 = lib /def:gawkw32.def /name:gawk.exe /out:gawk.lib LvcWin32 = link -nologo -subsystem:console -release -out:$@ $(LNKRSP) PLvcWin32 = link -nologo -subsystem:console -release -out:$@ $(PLDRSP) vcWin32: $(MAK) all \ "CC=cl -nologo" O=.obj "CF=-o2 -DWIN32 -D__STDC__=0" \ OBJ=popen.obj \ LNK=LvcWin32 # Support dropped in 3.0 #msc51: # $(MAK) all \ # "CC=cl $(MSCCL)" O=.obj "CF=-AL -Za -D_MSC_VER=510 $(MSCOPT)" \ # OBJ=popen.obj \ # LNK=LMSC P=+ # #msc51bnd: # $(MAK) all \ # "CC=cl -AL ($MSCCL)" O=.obj "CF=-DOS2 -D_MSC_VER=510 $(MSCOPT)" \ # OBJ=popen.obj \ # LNK=CLMSC "LF=-Lp -Fb" "LF2=gawk.def" #======================================================================== # Define BIND for BINDless compiles, otherwise $($(BIND)) may break. BIND = EMPTY PBIND = EMPTY EMPTY= # bitwise operations (-DBITOPS) and non-decimal input data (-DNONDECDATA) are # undocumented in 3.0.3. They may be enabled in config.h, or added to CFLAGS. CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H $(DYN_FLAGS) # object files AWKOBJS1 = array$O builtin$O eval$O field$O gawkmisc$O io$O main$O AWKOBJS2 = ext$O msg$O node$O profile$O re$O version$O $(DYN_OBJ) PAWKOBJS1 = array$O builtin$O eval_p$O field$O gawkmisc$O io$O main$O PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O version$O $(DYN_OBJ) AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ) # LIBOBJS # GNU and other stuff that gawk uses as library routines. LIBOBJS= getopt$O getopt1$O dfa$O regex$O random$O GAWKOBJS = $(ALLOBJS) $(LIBOBJS) PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ) # clear out suffixes list # .SUFFIXES: .SUFFIXES: .c $O .c$O: $(CC) -c $(CFLAGS) $< # rules to build gawk all : gawk.exe pgawk.exe gawk.exe:: $(GAWKOBJS) $(RSP) $(DO_LNK) $(DO_BIND) pgawk.exe:: $(PGAWKOBJS) $(PRSP) $(DO_PLNK) $(DO_PBIND) $(RSPFILE) : $(GAWKOBJS) echo $(AWKOBJS1)$P > $@ echo $(AWKOBJS2)$P >> $@ echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ $(PRSPFILE) : $(PGAWKOBJS) echo $(PAWKOBJS1)$P > $@ echo $(PAWKOBJS2)$P >> $@ echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ $(ALLOBJS) eval_p$O profile_p$O: awk.h regex.h config.h gawkmisc$O: pc/gawkmisc.pc getopt$O: getopt.h getopt1$O: getopt.h gawk.exp: gawkw32.def $(DYN_MAKEXP) eval_p$O: eval.c profile_p$O: profile.c # A bug in ndmake requires the following rule awkgram$O: awk.h awkgram.c $(CC) -c $(CFLAGS) awkgram.c awkgram.c: awkgram.y bison -o $@ awkgram.y alloca$O: alloca.c install: install$(install) install1: echo extproc sh $(prefix)/bin/igawk.cmd > igawk.cmd echo shift >> igawk.cmd cat pc/awklib/igawk >> igawk.cmd sed "s;igawk;$(prefix)/bin/igawk;" pc/awklib/igawk.bat > igawk.bat sh mkinstal.sh $(prefix)/bin sh mkinstal.sh $(prefix)/lib/awk $(prefix)/man/man1 $(prefix)/info cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin cp awklib/eg/lib/* pc/awklib/igawk.awk $(prefix)/lib/awk cp doc/*.1 $(prefix)/man/man1 cp doc/gawk.info $(prefix)/info # install2 is equivalent to install1, but doesn't require cp, sed, etc. install2: gawk -v prefix=$(prefix) -f install.awk clean: rm -rf gawk pgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DYN_EXP) # cd doc && $(MAKE) clean # cd test && $(MAKE) clean # cd awklib && $(MAKE) clean awklib/eg: doc/gawk.texi rm -fr awklib/eg sh -c "cd awklib && ../gawk -f extract.awk ../doc/gawk.texi" check: @echo "Running the tests requires several unix-like utilities. The" @echo "recommendation is to copy pc/Makefile.tst to test/Makefile. Under" @echo "DOS, it may be necessary to run make from the test directory." # The `-k' option to make should be unnecessary if using pc/Makefile.tst. sh -c "cd test && $(MAK) -k AWK=../gawk.exe" # sh -c "cd test && $(MAK) AWK=../gawk.exe bigtest extra" test: check # for those who have the necessary tools: TAGS: etags awk.h *.y custom.h *.c *.h tags: ctags awk.h *.y custom.h *.c *.h --- NEW FILE: popen.h --- /* ** popen.h -- prototypes for pipe functions */ #if defined (OS2) && !defined(MSDOS) /* OS/2, but not family mode */ # if defined (_MSC_VER) # define popen(c, m) _popen(c, m) # define pclose(f) _pclose(f) # endif #else # if !defined (__GO32__) # if defined (popen) # undef popen # undef pclose # endif # define popen(c, m) os_popen(c, m) # define pclose(f) os_pclose(f) extern FILE *os_popen( char *, const char * ); extern int os_pclose( FILE * ); # endif #endif --- NEW FILE: dlfcn.c --- /* ** dlfcn.c -- limited implementation of posix dynamic loading functions */ /* * Copyright (C) 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include <dlfcn.h> #include <errno.h> #include <windows.h> /* open the library file. We currently ignore flags. */ void *dlopen(const char * libname, int flags) { HMODULE libH; /* if libname is specified, we need to load a library of that name */ if (libname) { libH = LoadLibrary(libname); } /* otherwise, we're supposed to return a handle to global symbol * information, which includes the executable and all libraries loaded * with RTLD_GLOBAL. For our purposes, it doesn't really matter, so * we simply return the handle to the .exe */ else { libH = GetModuleHandle(NULL); } return (void *)libH; } /* don't need the library any more */ int dlclose(void * libH) { int rc; if (FreeLibrary((HMODULE)libH)) { rc = 0; } else { rc = -1; } return rc; } /* find the symbol */ void *dlsym(void * /*restrict*/ libH, const char * /*restrict*/ fnName) { return (void *)GetProcAddress((HMODULE)libH, fnName); } char *dlerror(void) { static char errbuf[1024]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errbuf, sizeof(errbuf), NULL); return errbuf; } --- NEW FILE: mkinstal.sh --- #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman <fri...@pr...> # Created: 1993-05-16 # Last modified: 1994-03-25 # Public domain errstatus=0 for file in ${1+"$@"} ; do #set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` set fnord `echo "$file" | sed 's/\([^:]\)\//\1 /g'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errsta... [truncated message content] |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:36
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/missing_d In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/missing_d Added Files: COPYING.LIB ChangeLog memcmp.c memcpy.c memmove.c memset.c mktime.c strchr.c strerror.c strftime.c strncasecmp.c strtod.c strtoul.c system.c tzset.c Log Message: Update package --- NEW FILE: mktime.c --- /* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert (eg...@tw...). 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Define this to have a standalone program to test this implementation of mktime. */ /* #define DEBUG 1 */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef _LIBC # define HAVE_LIMITS_H 1 # define HAVE_LOCALTIME_R 1 # define STDC_HEADERS 1 #endif /* Assume that leap seconds are possible, unless told otherwise. If the host has a `zic' command with a `-L leapsecondfilename' option, then it supports leap seconds; otherwise it probably doesn't. */ #ifndef LEAP_SECONDS_POSSIBLE #define LEAP_SECONDS_POSSIBLE 1 #endif #ifndef VMS #include <sys/types.h> /* Some systems define `time_t' here. */ #else #include <stddef.h> #endif #include <time.h> #if HAVE_LIMITS_H #include <limits.h> #endif #if DEBUG #include <stdio.h> #if STDC_HEADERS #include <stdlib.h> #endif /* Make it work even if the system's libc has its own mktime routine. */ #define mktime my_mktime #endif /* DEBUG */ #ifndef __P #if defined (__GNUC__) || (defined (__STDC__) && __STDC__) #define __P(args) args #else #define __P(args) () #endif /* GCC. */ #endif /* Not __P. */ #ifndef CHAR_BIT #define CHAR_BIT 8 #endif #ifndef INT_MIN #define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1)) #endif #ifndef INT_MAX #define INT_MAX (~0 - INT_MIN) #endif #ifndef TIME_T_MIN #define TIME_T_MIN (0 < (time_t) -1 ? (time_t) 0 \ : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)) #endif #ifndef TIME_T_MAX #define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN) #endif #define TM_YEAR_BASE 1900 #define EPOCH_YEAR 1970 #ifndef __isleap /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ #define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #endif /* How many days come before each month (0-12). */ const unsigned short int __mon_yday[2][13] = { /* Normal years. */ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *)); time_t __mktime_internal __P ((struct tm *, struct tm *(*) (const time_t *, struct tm *), time_t *)); static struct tm *my_localtime_r __P ((const time_t *, struct tm *)); static struct tm * my_localtime_r (t, tp) const time_t *t; struct tm *tp; { struct tm *l = localtime (t); if (! l) return 0; *tp = *l; return tp; } /* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP), measured in seconds, ignoring leap seconds. YEAR uses the same numbering as TM->tm_year. All values are in range, except possibly YEAR. If overflow occurs, yield the low order bits of the correct answer. */ static time_t ydhms_tm_diff (year, yday, hour, min, sec, tp) int year, yday, hour, min, sec; const struct tm *tp; { /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow. time_t overflow is OK, since only the low order bits of the correct time_t answer are needed. Don't convert to time_t until after all divisions are done, since time_t might be unsigned. */ int a4 = (year >> 2) + (TM_YEAR_BASE >> 2) - ! (year & 3); int b4 = (tp->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (tp->tm_year & 3); int a100 = a4 / 25 - (a4 % 25 < 0); int b100 = b4 / 25 - (b4 % 25 < 0); int a400 = a100 >> 2; int b400 = b100 >> 2; int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); time_t years = year - (time_t) tp->tm_year; time_t days = (365 * years + intervening_leap_days + (yday - tp->tm_yday)); return (60 * (60 * (24 * days + (hour - tp->tm_hour)) + (min - tp->tm_min)) + (sec - tp->tm_sec)); } static time_t localtime_offset; /* Convert *TP to a time_t value. */ time_t mktime (tp) struct tm *tp; { #ifdef _LIBC /* POSIX.1 8.1.1 requires that whenever mktime() is called, the time zone names contained in the external variable `tzname' shall be set as if the tzset() function had been called. */ __tzset (); #endif return __mktime_internal (tp, my_localtime_r, &localtime_offset); } /* Convert *TP to a time_t value, inverting the monotonic and mostly-unit-linear conversion function CONVERT. Use *OFFSET to keep track of a guess at the offset of the result, compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. */ time_t __mktime_internal (tp, convert, offset) struct tm *tp; struct tm *(*convert) __P ((const time_t *, struct tm *)); time_t *offset; { time_t t, dt, t0; struct tm tm; /* The maximum number of probes (calls to CONVERT) should be enough to handle any combinations of time zone rule changes, solar time, and leap seconds. Posix.1 prohibits leap seconds, but some hosts have them anyway. */ int remaining_probes = 4; /* Time requested. Copy it in case CONVERT modifies *TP; this can occur if TP is localtime's returned value and CONVERT is localtime. */ int sec = tp->tm_sec; int min = tp->tm_min; int hour = tp->tm_hour; int mday = tp->tm_mday; int mon = tp->tm_mon; int year_requested = tp->tm_year; int isdst = tp->tm_isdst; /* Ensure that mon is in range, and set year accordingly. */ int mon_remainder = mon % 12; int negative_mon_remainder = mon_remainder < 0; int mon_years = mon / 12 - negative_mon_remainder; int year = year_requested + mon_years; /* The other values need not be in range: the remaining code handles minor overflows correctly, assuming int and time_t arithmetic wraps around. Major overflows are caught at the end. */ /* Calculate day of year from year, month, and day of month. The result need not be in range. */ int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)] [mon_remainder + 12 * negative_mon_remainder]) + mday - 1); #if LEAP_SECONDS_POSSIBLE /* Handle out-of-range seconds specially, since ydhms_tm_diff assumes every minute has 60 seconds. */ int sec_requested = sec; if (sec < 0) sec = 0; if (59 < sec) sec = 59; #endif /* Invert CONVERT by probing. First assume the same offset as last time. Then repeatedly use the error to improve the guess. */ tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE; tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0; t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm); for (t = t0 + *offset; (dt = ydhms_tm_diff (year, yday, hour, min, sec, (*convert) (&t, &tm))); t += dt) if (--remaining_probes == 0) return -1; /* Check whether tm.tm_isdst has the requested value, if any. */ if (0 <= isdst && 0 <= tm.tm_isdst) { int dst_diff = (isdst != 0) - (tm.tm_isdst != 0); if (dst_diff) { /* Move two hours in the direction indicated by the disagreement, probe some more, and switch to a new time if found. The largest known fallback due to daylight savings is two hours: once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */ time_t ot = t - 2 * 60 * 60 * dst_diff; while (--remaining_probes != 0) { struct tm otm; if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec, (*convert) (&ot, &otm)))) { t = ot; tm = otm; break; } if ((ot += dt) == t) break; /* Avoid a redundant probe. */ } } } *offset = t - t0; #if LEAP_SECONDS_POSSIBLE if (sec_requested != tm.tm_sec) { /* Adjust time to reflect the tm_sec requested, not the normalized value. Also, repair any damage from a false match due to a leap second. */ t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60); (*convert) (&t, &tm); } #endif if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) { /* time_t isn't large enough to rule out overflows in ydhms_tm_diff, so check for major overflows. A gross check suffices, since if t has overflowed, it is off by a multiple of TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of the difference that is bounded by a small value. */ double dyear = (double) year_requested + mon_years - tm.tm_year; double dday = 366 * dyear + mday; double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested; if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec)) return -1; } *tp = tm; return t; } #ifdef weak_alias weak_alias (mktime, timelocal) #endif #if DEBUG static int not_equal_tm (a, b) struct tm *a; struct tm *b; { return ((a->tm_sec ^ b->tm_sec) | (a->tm_min ^ b->tm_min) | (a->tm_hour ^ b->tm_hour) | (a->tm_mday ^ b->tm_mday) | (a->tm_mon ^ b->tm_mon) | (a->tm_year ^ b->tm_year) | (a->tm_mday ^ b->tm_mday) | (a->tm_yday ^ b->tm_yday) | (a->tm_isdst ^ b->tm_isdst)); } static void print_tm (tp) struct tm *tp; { printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec, tp->tm_yday, tp->tm_wday, tp->tm_isdst); } static int check_result (tk, tmk, tl, tml) time_t tk; struct tm tmk; time_t tl; struct tm tml; { if (tk != tl || not_equal_tm (&tmk, &tml)) { printf ("mktime ("); print_tm (&tmk); printf (")\nyields ("); print_tm (&tml); printf (") == %ld, should be %ld\n", (long) tl, (long) tk); return 1; } return 0; } int main (argc, argv) int argc; char **argv; { int status = 0; struct tm tm, tmk, tml; time_t tk, tl; char trailer; if ((argc == 3 || argc == 4) && (sscanf (argv[1], "%d-%d-%d%c", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) == 3) && (sscanf (argv[2], "%d:%d:%d%c", &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) == 3)) { tm.tm_year -= TM_YEAR_BASE; tm.tm_mon--; tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); tmk = tm; tl = mktime (&tmk); tml = *localtime (&tl); printf ("mktime returns %ld == ", (long) tl); print_tm (&tmk); printf ("\n"); status = check_result (tl, tmk, tl, tml); } else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) { time_t from = atol (argv[1]); time_t by = atol (argv[2]); time_t to = atol (argv[3]); if (argc == 4) for (tl = from; tl <= to; tl += by) { tml = *localtime (&tl); tmk = tml; tk = mktime (&tmk); status |= check_result (tk, tmk, tl, tml); } else for (tl = from; tl <= to; tl += by) { /* Null benchmark. */ tml = *localtime (&tl); tmk = tml; tk = tl; status |= check_result (tk, tmk, tl, tml); } } else printf ("Usage:\ \t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ \t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ \t%s FROM BY TO - # Do not test those values (for benchmark).\n", argv[0], argv[0], argv[0]); return status; } #endif /* DEBUG */ /* Local Variables: compile-command: "gcc -DDEBUG=1 -Wall -O -g mktime.c -o mktime" End: */ --- NEW FILE: memset.c --- /* * memset --- initialize memory * * We supply this routine for those systems that aren't standard yet. */ void * memset(dest, val, l) void *dest; register int val; register size_t l; { register char *ret = dest; register char *d = dest; while (l--) *d++ = val; return ((void *) ret); } --- NEW FILE: COPYING.LIB --- GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This 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. This 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 this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! --- NEW FILE: strncasecmp.c --- /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcasecmp.c 5.6 (Berkeley) 6/27/88"; #endif /* LIBC_SCCS and not lint */ #ifdef atarist #include <sys/types.h> #else #define u_char unsigned char #endif /* This rather ugly macro is for VMS C */ #ifdef C #undef C #endif #define C(c) ((u_char)c) /* * This array is designed for mapping upper and lower case letter * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ static u_char charmap[] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', C('\200'), C('\201'), C('\202'), C('\203'), C('\204'), C('\205'), C('\206'), C('\207'), C('\210'), C('\211'), C('\212'), C('\213'), C('\214'), C('\215'), C('\216'), C('\217'), C('\220'), C('\221'), C('\222'), C('\223'), C('\224'), C('\225'), C('\226'), C('\227'), C('\230'), C('\231'), C('\232'), C('\233'), C('\234'), C('\235'), C('\236'), C('\237'), C('\240'), C('\241'), C('\242'), C('\243'), C('\244'), C('\245'), C('\246'), C('\247'), C('\250'), C('\251'), C('\252'), C('\253'), C('\254'), C('\255'), C('\256'), C('\257'), C('\260'), C('\261'), C('\262'), C('\263'), C('\264'), C('\265'), C('\266'), C('\267'), C('\270'), C('\271'), C('\272'), C('\273'), C('\274'), C('\275'), C('\276'), C('\277'), C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'), C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'), C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\327'), C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\337'), C('\340'), C('\341'), C('\342'), C('\343'), C('\344'), C('\345'), C('\346'), C('\347'), C('\350'), C('\351'), C('\352'), C('\353'), C('\354'), C('\355'), C('\356'), C('\357'), C('\360'), C('\361'), C('\362'), C('\363'), C('\364'), C('\365'), C('\366'), C('\367'), C('\370'), C('\371'), C('\372'), C('\373'), C('\374'), C('\375'), C('\376'), C('\377'), }; #undef C int strcasecmp(s1, s2) const char *s1, *s2; { register u_char *cm = charmap, *us1 = (u_char *)s1, *us2 = (u_char *)s2; while (cm[*us1] == cm[*us2++]) if (*us1++ == '\0') return(0); return(cm[*us1] - cm[*--us2]); } int strncasecmp(s1, s2, n) const char *s1, *s2; register size_t n; { register u_char *cm = charmap, *us1 = (u_char *)s1, *us2 = (u_char *)s2; while ((long)(--n) >= 0 && cm[*us1] == cm[*us2++]) if (*us1++ == '\0') return(0); return((long)n < 0 ? 0 : cm[*us1] - cm[*--us2]); } --- NEW FILE: system.c --- /* system.c --- replacement system() for systems missing one Copyright (C) 1986, 1988, 1989, 1991 the 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. */ extern void fatal(); int system(s) char *s; { fatal("system() not supported on this system"); return 0; } --- NEW FILE: strtod.c --- /* * gawk wrapper for strtod */ /* * Stupid version of System V strtod(3) library routine. * Does no overflow/underflow checking. * * A real number is defined to be * optional leading white space * optional sign * string of digits with optional decimal point * optional 'e' or 'E' * followed by optional sign or space * followed by an integer * * if ptr is not NULL a pointer to the character terminating the * scan is returned in *ptr. If no number formed, *ptr is set to str * and 0 is returned. * * For speed, we don't do the conversion ourselves. Instead, we find * the end of the number and then call atof() to do the dirty work. * This bought us a 10% speedup on a sample program at uunet.uu.net. * * Fall 2000: Changed to enforce C89 semantics, so that 0x... returns 0. * C99 has hexadecimal floating point numbers. * * Summer 2001. Try to make it smarter, so that a string like "0000" * doesn't look like we failed. Sigh. * * Xmass 2002. Fix a bug in ptr determination, eg. for "0e0". * * Spring 2004. Update for I18N. Oh joy. */ #if 0 #include <ctype.h> #endif extern double atof(); double gawk_strtod(s, ptr) register const char *s; register const char **ptr; { const char *start = s; /* save original start of string */ const char *begin = NULL; /* where the number really begins */ int dig = 0; int dig0 = 0; /* optional white space */ while (isspace(*s)) s++; begin = s; /* optional sign */ if (*s == '+' || *s == '-') s++; /* string of digits with optional decimal point */ while (*s == '0') { s++; dig0++; } while (isdigit(*s)) { s++; dig++; } if ( #if defined(HAVE_LOCALE_H) loc.decimal_point != NULL ? *s == loc.decimal_point[0] : *s == '.' #else *s == '.' #endif ) { s++; while (*s == '0') { s++; dig0++; } while (isdigit(*s)) { s++; dig++; } } dig0 += dig; /* any digit has appeared */ /* * optional 'e' or 'E' * if a digit (or at least zero) was seen * followed by optional sign * followed by an integer */ if (dig0 && (*s == 'e' || *s == 'E') && (isdigit(s[1]) || ((s[1] == '-' || s[1] == '+') && isdigit(s[2])))) { s++; if (*s == '+' || *s == '-') s++; while (isdigit(*s)) s++; } /* In case we haven't found a number, set ptr to start. */ if (ptr) *ptr = (dig0 ? s : start); /* Go for it. */ return (dig ? atof(begin) : 0.0); } #ifdef TEST int main(argc, argv) int argc; char **argv; { double d; char *p; for (argc--, argv++; argc; argc--, argv++) { d = strtod (*argv, & p); printf ("%lf [%s]\n", d, p); } return 0; } #endif --- NEW FILE: strerror.c --- /* strerror.c --- ANSI C compatible system error routine Copyright (C) 1986, 1988, 1989, 1991 the 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. */ #if 0 #include <stdio.h> #endif extern int sys_nerr; extern char *sys_errlist[]; char * strerror(n) int n; { static char mesg[30]; if (n < 0 || n >= sys_nerr) { sprintf(mesg, "Unknown error (%d)", n); return mesg; } else return sys_errlist[n]; } --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Tue Jul 26 21:27:46 2005 Arnold D. Robbins <ar...@sk...> * strtod.c (gawk_strtod) [ENABLE_NLS]: Removed from conditional paralleling change to main.c. * stroul.c (strtoul): Same. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Mon May 3 09:24:21 2004 Arnold D. Robbins <ar...@sk...> * strtoul.c: New file. Sun May 2 18:03:54 2004 Arnold D. Robbins <ar...@sk...> * strtod.c (gawk_strtod): Check for locale's decimal point instead of hard-wiring period. Tue Jan 20 10:38:48 2004 Arnold D. Robbins <ar...@sk...> * memmove.c: New file. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Mon Feb 3 20:37:09 2003 Pat Rankin <ra...@pa...> * strftime.c: Restore use of TIME_T_IN_SYS_TYPES_H to control inclusion of <sys/types.h>. (TYPE_SIGNED): Add workaround to avoid diagnostic from Compaq C V6.4. (my_strftime) [case 's']: Likewise; exclude negative number handling if TIME_T_UNSIGNED is defined. Mon Jan 27 12:09:50 2003 Stepan Kasal <ka...@ma...> * strtod.c (gawk_strtod): Cleanup, changing the logic so that ptr is correct. Fixes the bug that 0e0 is not recognized as numeric. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Tue Dec 4 17:56:46 2001 Arnold D. Robbins <ar...@sk...> * strftime.c: Replaced with glibc version. * strftime.3: Removed Fri Aug 3 09:01:19 2001 Arnold D. Robbins <ar...@sk...> ChangeLog created. * strtod.c (strtod): Fixed test at end for failure to be a little smarter. --- NEW FILE: memmove.c --- /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if 0 #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> #include <string.h> #endif /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES */ typedef int word; /* "word" used for optimal copy speed */ #define wsize sizeof(word) #define wmask (wsize - 1) /* ADR: 1/2004. For gawk, we need memmove(). */ #define MEMMOVE 1 /* * Copy a block of memory, handling overlap. * This is the routine that actually implements * (the portable versions of) bcopy, memcpy, and memmove. */ #ifdef MEMCOPY void * memcpy(dst0, src0, length) #else #ifdef MEMMOVE void * memmove(dst0, src0, length) #else void bcopy(src0, dst0, length) #endif #endif void *dst0; const void *src0; register size_t length; { register char *dst = dst0; register const char *src = src0; register size_t t; if (length == 0 || dst == src) /* nothing to do */ goto done; /* * Macros: loop-t-times; and loop-t-times, t>0 */ #define TLOOP(s) if (t) TLOOP1(s) #define TLOOP1(s) do { s; } while (--t) if ((unsigned long)dst < (unsigned long)src) { /* * Copy forward. */ t = (int)src; /* only need low bits */ if ((t | (int)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ if ((t ^ (int)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); length -= t; TLOOP1(*dst++ = *src++); } /* * Copy whole words, then mop up any trailing bytes. */ t = length / wsize; TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize); t = length & wmask; TLOOP(*dst++ = *src++); } else { /* * Copy backwards. Otherwise essentially the same. * Alignment works as before, except that it takes * (t&wmask) bytes to align, not wsize-(t&wmask). */ src += length; dst += length; t = (int)src; if ((t | (int)dst) & wmask) { if ((t ^ (int)dst) & wmask || length <= wsize) t = length; else t &= wmask; length -= t; TLOOP1(*--dst = *--src); } t = length / wsize; TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src); t = length & wmask; TLOOP(*--dst = *--src); } done: #if defined(MEMCOPY) || defined(MEMMOVE) return (dst0); #else return; #endif } #undef wsize #undef wmask #undef MEMMOVE #undef TLOOP #undef TLOOP1 --- NEW FILE: strftime.c --- /* Copyright (C) 1991-1999, 2000, 2001, 2002, 2003 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 Lesser General Public License as published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ [...1434 lines suppressed...] } #ifdef _LIBC libc_hidden_def (my_strftime) #endif #ifdef emacs /* For Emacs we have a separate interface which corresponds to the normal strftime function and does not have the extra information whether the TP arguments comes from a `gmtime' call or not. */ size_t emacs_strftime (s, maxsize, format, tp) char *s; size_t maxsize; const char *format; const struct tm *tp; { return my_strftime (s, maxsize, format, tp, 0); } #endif --- NEW FILE: tzset.c --- /* * tzset.c * * Quick and dirty emulation of tzset(), tzname[], and daylight * for old BSD systems without it. * * Thanks to Rick Adams, ri...@uu..., for the basics. * * BUGS: * Totally ignores the value of the TZ environment variable. */ #if 0 #include <time.h> #endif #include <sys/time.h> static char tz1[1024]; static char tz2[1024]; /* external variables */ char *tzname[2] = { tz1, tz2 }; int daylight; extern char *timezone(); void tzset() { struct timeval tp; struct timezone tz; (void) gettimeofday(&tp, &tz); (void) strcpy(tz1, timezone(tz.tz_minuteswest, 0)); (void) strcpy(tz2, timezone(tz.tz_minuteswest, 1)); daylight = tz.tz_dsttime; } --- NEW FILE: memcpy.c --- /* * memcpy --- copy strings. * * We supply this routine for those systems that aren't standard yet. */ char * memcpy (dest, src, l) register char *dest, *src; register int l; { register char *ret = dest; while (l--) *dest++ = *src++; return ret; } --- NEW FILE: memcmp.c --- /* * memcmp --- compare strings. * * We use our own routine since it has to act like strcmp() for return * value, and the BSD manual says bcmp() only returns zero/non-zero. */ int memcmp (s1, s2, l) register char *s1, *s2; register int l; { for (; l-- > 0; s1++, s2++) { if (*s1 != *s2) return (*s1 - *s2); } return (0); } --- NEW FILE: strtoul.c --- /* * Very simple implementation of strtoul() for gawk, * for old systems. Descriptive prose from the Linux man page. * * May 2004 */ /* #define TEST 1 */ #ifdef TEST #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <errno.h> #include <limits.h> #define TRUE 1 #define FALSE 0 #define strtoul mystrtoul #endif #ifndef ULONG_MAX #define ULONG_MAX (~ 0UL) #endif unsigned long int strtoul(nptr, endptr, base) const char *nptr; char **endptr; int base; { static char lower[] = "abcdefghijklmnopqrstuvwxyz"; unsigned long result = 0UL; char *nptr_orig = (char *) nptr; int neg = FALSE; char *cp, c; int val; int sawdigs = FALSE; /* * The strtoul() function converts the initial part of the * string in nptr to an unsigned long integer value according * to the given base, which must be between 2 and 36 inclusive, * or be the special value 0. */ if ((base != 0 && (base < 2 || base > 36)) || nptr == NULL) { if (endptr != NULL) *endptr = nptr_orig; errno = EINVAL; return 0; } /* * The string must [sic] begin with an arbitrary amount of white space * (as determined by isspace(3)) followed by a single optional * `+' or `-' sign. */ while (isspace(*nptr)) nptr++; if (*nptr == '+') nptr++; else if (*nptr == '-') { nptr++; neg = TRUE; } /* * If base is zero or 16, the string may then include a `0x' prefix, * and the number will be read in base 16; otherwise, a zero base is * taken as 10 (decimal) unless the next character is `0', in which * case it is taken as 8 (octal). */ if ((base == 0 || base == 16) && nptr[0] == '0' && (nptr[1] == 'x' || nptr[1] == 'X')) { base = 16; /* force it */ nptr += 2; /* skip 0x */ } else if ((base == 0 || base == 8) && nptr[0] == '0') { base = 8; nptr++; } else if (base == 0) base = 10; /* * The remainder of the string is converted to an unsigned long int * value in the obvious manner, stopping at the first character * which is not a valid digit in the given base. (In bases above 10, * the letter `A' in either upper or lower case represents 10, * `B' represents 11, and so forth, with `Z' representing 35.) */ for (; *nptr != '\0'; nptr++) { c = *nptr; #if defined(HAVE_LOCALE_H) if (base == 10 && loc.thousands_sep != NULL && loc.thousands_sep[0] != '\0' && c == loc.thousands_sep[0]) continue; #endif switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': val = c - '0'; if (val >= base) /* even base 2 allowed ... */ goto out; result *= base; result += val; sawdigs = TRUE; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': c += 'a' - 'A'; /* downcase */ /* fall through */ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': cp = strchr(lower, c); val = cp - lower; val += 10; /* 'a' == 10 */ if (val >= base) goto out; result *= base; result += val; sawdigs = TRUE; break; default: goto out; } } out: /* * If endptr is not NULL, strtoul() stores the address of the * first invalid character in *endptr. If there were no digits * at all, strtoul() stores the original value of nptr in *endptr * (and returns 0). In particular, if *nptr is not `\0' but * **endptr is `\0' on return, the entire string is valid. */ if (endptr != NULL) { if (! sawdigs) { *endptr = nptr_orig; return 0; } else *endptr = (char *) nptr; } /* * RETURN VALUE * The strtoul() function returns either the result of the * conversion or, if there was a leading minus sign, the * negation of the result of the conversion, unless the original * (non-negated) value would overflow; in the latter case, * strtoul() returns ULONG_MAX and sets the global variable errno * to... [truncated message content] |
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/m4 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/m4 Added Files: ChangeLog arch.m4 codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 intmax_t.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 socket.m4 stdint_h.m4 strtod.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 Log Message: Update package --- NEW FILE: glibc2.m4 --- # glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 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. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include <features.h> #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) --- NEW FILE: xsize.m4 --- # xsize.m4 serial 3 dnl Copyright (C) 2003-2004 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_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) --- NEW FILE: longdouble.m4 --- # longdouble.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 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 the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) --- NEW FILE: gettext.m4 --- # gettext.m4 serial 37 (gettext-0.14.4) dnl Copyright (C) 1995-2005 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 <dr...@cy...>, 1995-2000. dnl Bruno Haible <ha...@cl...>, 2000-2003. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], [no], [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include <libintl.h> ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include <libintl.h> ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include <libintl.h> ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([bh_C_SIGNED])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gl_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ __fsetlocking]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include <stdio.h>]) gt_CHECK_DECL(_snwprintf, [#include <stdio.h>]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>]) gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>]) gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then gt_LC_MESSAGES fi if test -n "$INTL_MACOSX_LIBS"; then CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" AC_TRY_LINK([#include <CFPreferences.h>], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) --- NEW FILE: nls.m4 --- # nls.m4 serial 2 (gettext-0.14.3) dnl Copyright (C) 1995-2003, 2005 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 <dr...@cy...>, 1995-2000. dnl Bruno Haible <ha...@cl...>, 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) --- NEW FILE: intdiv0.m4 --- # intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 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_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include <stdlib.h> #include <signal.h> static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) --- NEW FILE: intmax_t.m4 --- #serial 6 dnl From Paul Eggert. AC_PREREQ(2.52) # Define intmax_t to long or long long if <inttypes.h> doesn't define. AC_DEFUN([gl_AC_TYPE_INTMAX_T], [ dnl For simplicity, we assume that a header file defines 'intmax_t' if and dnl only if it defines 'uintmax_t'. AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) else AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) # Define uintmax_t to unsigned long or unsigned long long # if <inttypes.h> doesn't define. AC_DEFUN([jm_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) AC_CHECK_TYPE(uintmax_t, , [test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to widest unsigned type if <inttypes.h> doesn't define.])]) ]) --- NEW FILE: intmax.m4 --- # intmax.m4 serial 2 (gettext-0.14.2) dnl Copyright (C) 2002-2005 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 the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include <stddef.h> #include <stdlib.h> #if HAVE_STDINT_H_WITH_UINTMAX #include <stdint.h> #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include <inttypes.h> #endif ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) --- NEW FILE: lcmessage.m4 --- # lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 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 <dr...@cy...>, 1995. # Check whether LC_MESSAGES is available in <locale.h>. AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your <locale.h> file defines LC_MESSAGES.]) fi ]) --- NEW FILE: glibc21.m4 --- # glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 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. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include <features.h> #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) --- NEW FILE: lib-link.m4 --- # lib-link.m4 serial 6 (gettext-0.14.3) dnl Copyright (C) 2001-2005 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.50) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) --- NEW FILE: inttypes_h.m4 --- # inttypes_h.m4 serial 6 dnl Copyright (C) 1997-2004 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_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, # doesn't clash with <sys/types.h>, and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include <sys/types.h> #include <inttypes.h>], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi ]) --- NEW FILE: progtest.m4 --- # progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 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 <dr...@cy...>, 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) --- NEW FILE: stdint_h.m4 --- # stdint_h.m4 serial 5 dnl Copyright (C) 1997-2004 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_STDINT_H_WITH_UINTMAX if <stdint.h> exists, # doesn't clash with <sys/types.h>, and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include <sys/types.h> #include <stdint.h>], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi ]) --- NEW FILE: uintmax_t.m4 --... [truncated message content] |
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/extension In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/extension Added Files: ChangeLog Makefile.pc arrayparm.c dl.c doit filefuncs.c foo.awk fork.c ordchr.c pcext.def readfile.c steps testarg.awk testarg.c testarrayparm.awk testff.awk testfork.awk testordchr.awk xreadlink.c xreadlink.h Log Message: Update package --- NEW FILE: testarg.c --- #include "awk.h" static NODE * do_check_arg(tree) NODE *tree; { int ret = 0, argc; NODE *arg1, *arg2, *arg3; argc = get_curfunc_arg_count(); printf("arg count: defined = %d, supplied = %d\n", tree->param_cnt, argc); arg1 = get_scalar_argument(tree, 0, FALSE); arg2 = get_array_argument(tree, 1, FALSE); arg3 = get_scalar_argument(tree, 2, TRUE); /* optional */ if (argc > 3) { /* try to use an extra arg */ NODE *arg4; arg4 = get_array_argument(tree, 3, TRUE); } if (arg3 != NULL) printf("3rd arg present\n\n"); else printf("no 3rd arg\n\n"); /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* dlload --- load new builtins in this library */ NODE * dlload(tree, dl) NODE *tree; void *dl; { make_builtin("check_arg", do_check_arg, 3); return tmp_number((AWKNUM) 0); } --- NEW FILE: testarg.awk --- BEGIN { extension("./testarg.so", "dlload") check_arg(x, a); check_arg(y, b, z); check_arg(p, q, r, s); } --- NEW FILE: fork.c --- /* * fork.c - Provide fork and waitpid functions for gawk. * * Revised 6/2004 */ /* * Copyright (C) 2001, 2004 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include "awk.h" /* do_fork --- provide dynamically loaded fork() builtin for gawk */ static NODE * do_fork(tree) NODE *tree; { int ret = -1; NODE **aptr; if (do_lint && get_curfunc_arg_count() > 0) lintwarn("fork: called with too many arguments"); ret = fork(); if (ret < 0) update_ERRNO(); else if (ret == 0) { /* update PROCINFO in the child */ aptr = assoc_lookup(PROCINFO_node, tmp_string("pid", 3), FALSE); (*aptr)->numbr = (AWKNUM) getpid(); aptr = assoc_lookup(PROCINFO_node, tmp_string("ppid", 4), FALSE); (*aptr)->numbr = (AWKNUM) getppid(); } /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* do_waitpid --- provide dynamically loaded waitpid() builtin for gawk */ static NODE * do_waitpid(tree) NODE *tree; { NODE *pidnode; int ret = -1; double pidval; pid_t pid; int options = 0; if (do_lint && get_curfunc_arg_count() > 1) lintwarn("waitpid: called with too many arguments"); pidnode = get_argument(tree, 0); if (pidnode != NULL) { pidval = force_number(pidnode); pid = (int) pidval; options = WNOHANG|WUNTRACED; ret = waitpid(pid, NULL, options); if (ret < 0) update_ERRNO(); } else if (do_lint) lintwarn("wait: called with no arguments"); /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* dlload --- load new builtins in this library */ NODE * dlload(tree, dl) NODE *tree; void *dl; { make_builtin("fork", do_fork, 0); make_builtin("waitpid", do_waitpid, 1); return tmp_number((AWKNUM) 0); } --- NEW FILE: testfork.awk --- BEGIN { extension("./fork.so", "dlload") printf "before fork, pid = %d, ppid = %d\n", PROCINFO["pid"], PROCINFO["ppid"] fflush() ret = fork() if (ret < 0) printf("ret = %d, ERRNO = %s\n", ret, ERRNO) else if (ret == 0) printf "child, pid = %d, ppid = %d\n", PROCINFO["pid"], PROCINFO["ppid"] else { system("sleep 3") printf "parent, ret = %d\n", ret printf "parent, pid = %d, ppid = %d\n", PROCINFO["pid"], PROCINFO["ppid"] } } --- NEW FILE: ordchr.c --- /* * ordchr.c - Builtin functions that provide ord() and chr() functions. * * Arnold Robbins * ar...@sk... * 8/2001 * Revised 6/2004 */ /* * Copyright (C) 2001, 2004 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include "awk.h" /* do_ord --- return numeric value of first char of string */ static NODE * do_ord(tree) NODE *tree; { NODE *str; int ret = -1; if (do_lint && get_curfunc_arg_count() > 1) lintwarn("ord: called with too many arguments"); str = get_argument(tree, 0); if (str != NULL) { (void) force_string(str); ret = str->stptr[0]; free_temp(str); } else if (do_lint) lintwarn("ord: called with no arguments"); /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* do_chr --- turn numeric value into a string */ static NODE * do_chr(tree) NODE *tree; { NODE *num; unsigned int ret = 0; AWKNUM val = 0.0; char str[2]; str[0] = str[1] = '\0'; if (do_lint && get_curfunc_arg_count() > 1) lintwarn("chr: called with too many arguments"); num = get_argument(tree, 0); if (num != NULL) { val = force_number(num); ret = val; /* convert to int */ free_temp(num); ret &= 0xff; str[0] = ret; str[1] = '\0'; } else if (do_lint) lintwarn("chr: called with no arguments"); /* Set the return value */ set_value(tmp_string(str, 1)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* dlload --- load new builtins in this library */ NODE * dlload(tree, dl) NODE *tree; void *dl; { make_builtin("ord", do_ord, 1); make_builtin("chr", do_chr, 1); return tmp_number((AWKNUM) 0); } --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Sun Jun 26 09:03:32 2005 Arnold D. Robbins <ar...@sk...> * filefuncs.c (do_stat): Check return value from readlink() for error. Pass in `sizeof(buf) - 1' to leave room for trailing zero byte. From: Glenn Zazulia <gn...@t1...>. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Mon Jun 21 17:02:37 2004 Arnold D. Robbins <ar...@sk...> More from John Haque. * testarg.c, testarg.awk: New files. * arrayparm.c (do_mkarray): Change call of `get_curfunc_parm_count' to `get_curfunc_arg_count'. * filefuncs.c (do_chdir, do_stat): Ditto. * fork.c (do_fork, do_waitpid): Ditto. * ordchr.c (do_ord, do_chr): Ditto. * readfile.c (do_readfile): Ditto. * steps: Updated. Mon Jun 14 14:01:16 2004 Arnold D. Robbins <ar...@sk...> ChangeLog started. Changes from John Haque and ADR to rationalize extension functions. * extension/filefuncs.c: Revised for new functionality. See corresponding entry in main ChangeLog. --- NEW FILE: arrayparm.c --- /* * arrayparm.c --- figure out how to make a parameter be an array * * Arnold Robbins * ar...@sk... * 10/2001 * * Revised 7/2003 * Revised 6/2004 */ /* * Copyright (C) 2001, 2003, 2004 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include "awk.h" /* do_mkarray --- turn a variable into an array */ /* * From awk, call * * mkarray(var, sub, val) */ static NODE * do_mkarray(tree) NODE *tree; { int ret = -1; NODE *var, *sub, *val; NODE **elemval; if (do_lint && get_curfunc_arg_count() > 3) lintwarn("mkarray: called with too many arguments"); var = get_argument(tree, 0); if (var == NULL) var = stack_ptr[0]; var = get_array(var); sub = get_argument(tree, 1); val = get_argument(tree, 2); printf("var->type = %s\n", nodetype2str(var->type)); printf("sub->type = %s\n", nodetype2str(sub->type)); printf("val->type = %s\n", nodetype2str(val->type)); assoc_clear(var); elemval = assoc_lookup(var, sub, 0); *elemval = dupnode(val); ret = 0; /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* dlload --- load new builtins in this library */ NODE * dlload(tree, dl) NODE *tree; void *dl; { make_builtin("mkarray", do_mkarray, 3); return tmp_number((AWKNUM) 0); } --- NEW FILE: Makefile.pc --- # Makefile for gawk extensions Mar 2003 # - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT] # - for Microsoft C 7 [16bit ececutable for DOS] # see README.pc for comments #------------------------------------------------------------------------ # Some makes do not define MAKE (and ndmake does not allow a define). # Define MAK to be your make command. #MAKE = dmake MAK = $(MAKE) $(MAKEFILE) #MAK = $(MAKE) #MAKEFILE = -f Makefile #MAK = make45 $(MAKEFILE) VCCFLAGS=-nologo -O2 -DWIN32 -DWIN32_EXTENSION -D__STDC__=0 -DGAWK -I.. -DHAVE_CONFIG_H -DDYNAMIC VCLDFLAGS=-LD ../gawk.lib VCCC=cl -nologo MWCFLAGS=-O -shared -DWIN32 -DWIN32_EXTENSION -DGAWK -I.. -DHAVE_CONFIG_H -DDYNAMIC MWLDFLAGS=-s -Wl,--enable-stdcall-fixup -L.. -lgawk MWCC=gcc # this DEFFILE will work provided the exported function is always called # dlload DEFFILE=pcext.def default: @echo "Enter $(MAK) target " @echo " where 'target' is chosen from " @echo " mingw32 . Windows32 exe [Mingw32 GNU C] " @echo " vcWin32 . Windows32 exe [Microsoft Visual C] " .SUFFIXES: .c .dll .c.dll: $(CC) $(CFLAGS) $< -o$@ $(LDFLAGS) $(DEFFILE) # dl.c, fork.c, and filefuncs.c don't compile cleanly... all : readfile.dll ordchr.dll arrayparm.dll vcWin32: $(MAK) CFLAGS="$(VCCFLAGS)" LDFLAGS="$(VCLDFLAGS)" CC="$(VCCC)" all mingw32: $(MAK) CFLAGS="$(MWCFLAGS)" LDFLAGS="$(MWLDFLAGS)" CC="$(MWCC)" all clean: -rm *.dll -rm *.o -rm *.obj -rm *.lib --- NEW FILE: filefuncs.c --- /* * filefuncs.c - Builtin functions that provide initial minimal iterface * to the file system. * * Arnold Robbins, update for 3.1, Mon Nov 23 12:53:39 EST 1998 * Arnold Robbins and John Haque, update for 3.1.4, applied Mon Jun 14 13:55:30 IDT 2004 */ /* * Copyright (C) 2001, 2004, 2005 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include "awk.h" #include <sys/sysmacros.h> /* do_chdir --- provide dynamically loaded chdir() builtin for gawk */ static NODE * do_chdir(tree) NODE *tree; { NODE *newdir; int ret = -1; if (do_lint && get_curfunc_arg_count() != 1) lintwarn("chdir: called with incorrect number of arguments"); newdir = get_scalar_argument(tree, 0, FALSE); (void) force_string(newdir); ret = chdir(newdir->stptr); if (ret < 0) update_ERRNO(); free_temp(newdir); /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* format_mode --- turn a stat mode field into something readable */ static char * format_mode(fmode) unsigned long fmode; { static char outbuf[12]; int i; strcpy(outbuf, "----------"); /* first, get the file type */ i = 0; switch (fmode & S_IFMT) { #ifdef S_IFSOCK case S_IFSOCK: outbuf[i] = 's'; break; #endif #ifdef S_IFLNK case S_IFLNK: outbuf[i] = 'l'; break; #endif case S_IFREG: outbuf[i] = '-'; /* redundant */ break; case S_IFBLK: outbuf[i] = 'b'; break; case S_IFDIR: outbuf[i] = 'd'; break; #ifdef S_IFDOOR /* Solaris weirdness */ case S_IFDOOR: outbuf[i] = 'D'; break; #endif /* S_IFDOOR */ case S_IFCHR: outbuf[i] = 'c'; break; #ifdef S_IFIFO case S_IFIFO: outbuf[i] = 'p'; break; #endif } i++; if ((fmode & S_IRUSR) != 0) outbuf[i] = 'r'; i++; if ((fmode & S_IWUSR) != 0) outbuf[i] = 'w'; i++; if ((fmode & S_IXUSR) != 0) outbuf[i] = 'x'; i++; if ((fmode & S_IRGRP) != 0) outbuf[i] = 'r'; i++; if ((fmode & S_IWGRP) != 0) outbuf[i] = 'w'; i++; if ((fmode & S_IXGRP) != 0) outbuf[i] = 'x'; i++; if ((fmode & S_IROTH) != 0) outbuf[i] = 'r'; i++; if ((fmode & S_IWOTH) != 0) outbuf[i] = 'w'; i++; if ((fmode & S_IXOTH) != 0) outbuf[i] = 'x'; i++; outbuf[i] = '\0'; if ((fmode & S_ISUID) != 0) { if (outbuf[3] == 'x') outbuf[3] = 's'; else outbuf[3] = 'S'; } /* setgid without execute == locking */ if ((fmode & S_ISGID) != 0) { if (outbuf[6] == 'x') outbuf[6] = 's'; else outbuf[6] = 'l'; } if ((fmode & S_ISVTX) != 0) { if (outbuf[9] == 'x') outbuf[9] = 't'; else outbuf[9] = 'T'; } return outbuf; } /* do_stat --- provide a stat() function for gawk */ static NODE * do_stat(tree) NODE *tree; { NODE *file, *array; struct stat sbuf; int ret; NODE **aptr; char *pmode; /* printable mode */ char *type = "unknown"; if (do_lint && get_curfunc_arg_count() > 2) lintwarn("stat: called with too many arguments"); /* directory is first arg, array to hold results is second */ file = get_scalar_argument(tree, 0, FALSE); array = get_array_argument(tree, 1, FALSE); /* empty out the array */ assoc_clear(array); /* lstat the file, if error, set ERRNO and return */ (void) force_string(file); ret = lstat(file->stptr, & sbuf); if (ret < 0) { update_ERRNO(); set_value(tmp_number((AWKNUM) ret)); free_temp(file); return tmp_number((AWKNUM) 0); } /* fill in the array */ aptr = assoc_lookup(array, tmp_string("name", 4), FALSE); *aptr = dupnode(file); aptr = assoc_lookup(array, tmp_string("dev", 3), FALSE); *aptr = make_number((AWKNUM) sbuf.st_dev); aptr = assoc_lookup(array, tmp_string("ino", 3), FALSE); *aptr = make_number((AWKNUM) sbuf.st_ino); aptr = assoc_lookup(array, tmp_string("mode", 4), FALSE); *aptr = make_number((AWKNUM) sbuf.st_mode); aptr = assoc_lookup(array, tmp_string("nlink", 5), FALSE); *aptr = make_number((AWKNUM) sbuf.st_nlink); aptr = assoc_lookup(array, tmp_string("uid", 3), FALSE); *aptr = make_number((AWKNUM) sbuf.st_uid); aptr = assoc_lookup(array, tmp_string("gid", 3), FALSE); *aptr = make_number((AWKNUM) sbuf.st_gid); aptr = assoc_lookup(array, tmp_string("size", 4), FALSE); *aptr = make_number((AWKNUM) sbuf.st_size); aptr = assoc_lookup(array, tmp_string("blocks", 6), FALSE); *aptr = make_number((AWKNUM) sbuf.st_blocks); aptr = assoc_lookup(array, tmp_string("atime", 5), FALSE); *aptr = make_number((AWKNUM) sbuf.st_atime); aptr = assoc_lookup(array, tmp_string("mtime", 5), FALSE); *aptr = make_number((AWKNUM) sbuf.st_mtime); aptr = assoc_lookup(array, tmp_string("ctime", 5), FALSE); *aptr = make_number((AWKNUM) sbuf.st_ctime); /* for block and character devices, add rdev, major and minor numbers */ if (S_ISBLK(sbuf.st_mode) || S_ISCHR(sbuf.st_mode)) { aptr = assoc_lookup(array, tmp_string("rdev", 4), FALSE); *aptr = make_number((AWKNUM) sbuf.st_rdev); aptr = assoc_lookup(array, tmp_string("major", 5), FALSE); *aptr = make_number((AWKNUM) major(sbuf.st_rdev)); aptr = assoc_lookup(array, tmp_string("minor", 5), FALSE); *aptr = make_number((AWKNUM) minor(sbuf.st_rdev)); } #ifdef HAVE_ST_BLKSIZE aptr = assoc_lookup(array, tmp_string("blksize", 7), FALSE); *aptr = make_number((AWKNUM) sbuf.st_blksize); #endif /* HAVE_ST_BLKSIZE */ aptr = assoc_lookup(array, tmp_string("pmode", 5), FALSE); pmode = format_mode(sbuf.st_mode); *aptr = make_string(pmode, strlen(pmode)); /* for symbolic links, add a linkval field */ if (S_ISLNK(sbuf.st_mode)) { char buf[BUFSIZ*2]; int linksize; linksize = readlink(file->stptr, buf, sizeof(buf) - 1); if (linksize >= 0) { /* should make this smarter */ if (linksize >= sizeof(buf) - 1) fatal("size of symbolic link too big"); buf[linksize] = '\0'; aptr = assoc_lookup(array, tmp_string("linkval", 7), FALSE); *aptr = make_string(buf, linksize); } } /* add a type field */ switch (sbuf.st_mode & S_IFMT) { #ifdef S_IFSOCK case S_IFSOCK: type = "socket"; break; #endif #ifdef S_IFLNK case S_IFLNK: type = "symlink"; break; #endif case S_IFREG: type = "file"; break; case S_IFBLK: type = "blockdev"; break; case S_IFDIR: type = "directory"; break; #ifdef S_IFDOOR case S_IFDOOR: type = "door"; break; #endif case S_IFCHR: type = "chardev"; break; #ifdef S_IFIFO case S_IFIFO: type = "fifo"; break; #endif } aptr = assoc_lookup(array, tmp_string("type", 4), FALSE); *aptr = make_string(type, strlen(type)); free_temp(file); /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* dlload --- load new builtins in this library */ NODE * dlload(tree, dl) NODE *tree; void *dl; { make_builtin("chdir", do_chdir, 1); make_builtin("stat", do_stat, 2); return tmp_number((AWKNUM) 0); } --- NEW FILE: readfile.c --- /* * readfile.c - Read an entire file into a string. * * Arnold Robbins * Tue Apr 23 17:43:30 IDT 2002 * Revised per Peter Tillier * Mon Jun 9 17:05:11 IDT 2003 * Revised for new dynamic function facilities * Mon Jun 14 14:53:07 IDT 2004 */ /* * Copyright (C) 2002, 2003, 2004 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include "awk.h" #include <fcntl.h> #ifndef O_BINARY #define O_BINARY 0 #endif /* do_readfile --- read a file into memory */ NODE * do_readfile(tree) NODE *tree; { NODE *filename; int ret = -1; struct stat sbuf; char *text; int fd; if (do_lint && get_curfunc_arg_count() > 1) lintwarn("readfile: called with too many arguments"); filename = get_argument(tree, 0); if (filename != NULL) { (void) force_string(filename); ret = stat(filename->stptr, & sbuf); if (ret < 0) { update_ERRNO(); free_temp(filename); goto done; } else if ((sbuf.st_mode & S_IFMT) != S_IFREG) { errno = EINVAL; ret = -1; update_ERRNO(); free_temp(filename); goto done; } if ((fd = open(filename->stptr, O_RDONLY|O_BINARY)) < 0) { ret = -1; update_ERRNO(); free_temp(filename); goto done; } emalloc(text, char *, sbuf.st_size + 2, "do_readfile"); memset(text, '\0', sbuf.st_size + 2); if ((ret = read(fd, text, sbuf.st_size)) != sbuf.st_size) { (void) close(fd); ret = -1; update_ERRNO(); free_temp(filename); goto done; } close(fd); free_temp(filename); set_value(tmp_string(text, sbuf.st_size)); return tmp_number((AWKNUM) 0); } else if (do_lint) lintwarn("filename: called with no arguments"); done: /* Set the return value */ set_value(tmp_number((AWKNUM) ret)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } /* dlload --- load new builtins in this library */ NODE * dlload(tree, dl) NODE *tree; void *dl; { make_builtin("readfile", do_readfile, 1); return tmp_number((AWKNUM) 0); } --- NEW FILE: doit --- ../gawk -f foo.awk --- NEW FILE: pcext.def --- EXPORTS dlload @1 --- NEW FILE: testff.awk --- BEGIN { extension("./filefuncs.so", "dlload") # printf "before: " # fflush() # system("pwd") # # chdir("..") # # printf "after: " # fflush() # system("pwd") chdir(".") data[1] = 1 print "Info for testff.awk" ret = stat("testff.awk", data) print "ret =", ret for (i in data) printf "data[\"%s\"] = %s\n", i, data[i] print "testff.awk modified:", strftime("%m %d %y %H:%M:%S", data["mtime"]) print "\nInfo for JUNK" ret = stat("JUNK", data) print "ret =", ret for (i in data) printf "data[\"%s\"] = %s\n", i, data[i] print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"]) } --- NEW FILE: steps --- # what to do under linux to make dl.so # Tue Nov 24 15:04:14 EST 1998 # Sun Aug 26 16:03:58 IDT 2001 # Sun Apr 28 15:59:57 IDT 2002 # Mon Jun 21 17:03:37 IDT 2004 gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. dl.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. filefuncs.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. fork.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. ordchr.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. arrayparm.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. readfile.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. testarg.c ld -o dl.so -shared dl.o ld -o filefuncs.so -shared filefuncs.o ld -o fork.so -shared fork.o ld -o ordchr.so -shared ordchr.o ld -o arrayparm.so -shared arrayparm.o ld -o readfile.so -shared readfile.o ld -o testarg.so -shared testarg.o --- NEW FILE: xreadlink.h --- /* readlink wrapper to return the link name in malloc'd storage Copyright (C) 2001, 2003, 2004 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; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering <ji...@me...> */ #include <stddef.h> char *xreadlink (char const *, size_t); --- NEW FILE: dl.c --- /* * dl.c - Example of adding a new builtin function to gawk. * * Christos Zoulas, Thu Jun 29 17:40:41 EDT 1995 * Arnold Robbins, update for 3.1, Wed Sep 13 09:38:56 2000 */ /* * Copyright (C) 1995 - 2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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. * * GAWK 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 */ #include "awk.h" #include <dlfcn.h> static void *sdl = NULL; static NODE * zaxxon(tree) NODE *tree; { NODE *obj; int i; int comma = 0; /* * Print the arguments */ printf("External linkage %s(", tree->param); for (i = 0; i < tree->param_cnt; i++) { obj = get_argument(tree, i); if (obj == NULL) break; force_string(obj); printf(comma ? ", %s" : "%s", obj->stptr); free_temp(obj); comma = 1; } printf(");\n"); /* * Do something useful */ obj = get_argument(tree, 0); if (obj != NULL) { force_string(obj); if (strcmp(obj->stptr, "unload") == 0 && sdl) { /* * XXX: How to clean up the function? * I would like the ability to remove a function... */ dlclose(sdl); sdl = NULL; } free_temp(obj); } /* Set the return value */ set_value(tmp_number((AWKNUM) 3.14)); /* Just to make the interpreter happy */ return tmp_number((AWKNUM) 0); } NODE * dlload(tree, dl) NODE *tree; void *dl; { sdl = dl; make_builtin("zaxxon", zaxxon, 4); return tmp_number((AWKNUM) 0); } --- NEW FILE: foo.awk --- BEGIN { extension("./dl.so","dlload") zaxxon("hi there", "this is", "a test", "of argument passing") zaxxon(1) zaxxon(1,2) z = zaxxon(1,2,3,4) z = zaxxon(1,zaxxon(zaxxon("foo")),3,4) print z } --- NEW FILE: testarrayparm.awk --- #! /bin/awk -f BEGIN { extension("./arrayparm.so", "dlload") mkarray(newvar, "hi", "hello") for (i in newvar) printf ("newvar[\"%s\"] = \"%s\"\n", i, newvar[i]) } --- NEW FILE: xreadlink.c --- /* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage Copyright (C) 2001, 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 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; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering <ji...@me...> */ #if HAVE_CONFIG_H # include <config.h> #endif #include "xreadlink.h" #include <stdio.h> #include <errno.h> #include <limits.h> #include <sys/types.h> #include <stdlib.h> #if HAVE_UNISTD_H # include <unistd.h> #endif #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif #define MAXSIZE (SIZE_MAX < SSIZE_MAX ? SIZE_MAX : SSIZE_MAX) #include "xalloc.h" /* Call readlink to get the symbolic link value of FILE. SIZE is a hint as to how long the link is expected to be; typically it is taken from st_size. It need not be correct. Return a pointer to that NUL-terminated string in malloc'd storage. If readlink fails, return NULL (caller may use errno to diagnose). If malloc fails, or if the link value is longer than SSIZE_MAX :-), give a diagnostic and exit. */ char * xreadlink (char const *file, size_t size) { /* The initial buffer size for the link value. A power of 2 detects arithmetic overflow earlier, but is not required. */ size_t buf_size = size < MAXSIZE ? size + 1 : MAXSIZE; while (1) { char *buffer = xmalloc (buf_size); ssize_t r = readlink (file, buffer, buf_size); size_t link_length = r; /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 with errno == ERANGE if the buffer is too small. */ if (r < 0 && errno != ERANGE) { int saved_errno = errno; free (buffer); errno = saved_errno; return NULL; } if (link_length < buf_size) { buffer[link_length] = 0; return buffer; } free (buffer); if (buf_size <= MAXSIZE / 2) buf_size *= 2; else if (buf_size < MAXSIZE) buf_size = MAXSIZE; else xalloc_die (); } } --- NEW FILE: testordchr.awk --- BEGIN { extension("./ordchr.so", "dlload") print "ord(\"a\") is", ord("a") print "chr(65) is", chr(65) } |
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/awklib/eg/network In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/awklib/eg/network Added Files: PostAgent.sh coreserv.awk eliza.awk fingerclient.awk geturl.awk hello-serv.awk maze.awk mobag.awk panic.awk protbase.awk protbase.request protbase.result remconf.awk statist.awk stoxdata.txt stoxpred.awk testserv.awk urlchk.awk webgrab.awk Log Message: Update package --- NEW FILE: statist.awk --- function SetUpServer() { TopHeader = "<HTML><title>Statistics with GAWK</title>" TopDoc = "<BODY>\ <h2>Please choose one of the following actions:</h2>\ <UL>\ <LI><A HREF=" MyPrefix "/AboutServer>About this server</A></LI>\ <LI><A HREF=" MyPrefix "/EnterParameters>Enter Parameters</A></LI>\ </UL>" TopFooter = "</BODY></HTML>" GnuPlot = "gnuplot 2>&1" m1=m2=0; v1=v2=1; n1=n2=10 } function HandleGET() { if(MENU[2] == "AboutServer") { Document = "This is a GUI for a statistical computation.\ It compares means and variances of two distributions.\ It is implemented as one GAWK script and uses GNUPLOT." } else if (MENU[2] == "EnterParameters") { Document = "" if ("m1" in GETARG) { # are there parameters to compare? Document = Document "<SCRIPT LANGUAGE=\"JavaScript\">\ setTimeout(\"window.open(\\\"" MyPrefix "/Image" systime()\ "\\\",\\\"dist\\\", \\\"status=no\\\");\", 1000); </SCRIPT>" m1 = GETARG["m1"]; v1 = GETARG["v1"]; n1 = GETARG["n1"] m2 = GETARG["m2"]; v2 = GETARG["v2"]; n2 = GETARG["n2"] t = (m1-m2)/sqrt(v1/n1+v2/n2) df = (v1/n1+v2/n2)*(v1/n1+v2/n2)/((v1/n1)*(v1/n1)/(n1-1) \ + (v2/n2)*(v2/n2) /(n2-1)) if (v1>v2) { f = v1/v2 df1 = n1 - 1 df2 = n2 - 1 } else { f = v2/v1 df1 = n2 - 1 df2 = n1 - 1 } print "pt=ibeta(" df/2 ",0.5," df/(df+t*t) ")" |& GnuPlot print "pF=2.0*ibeta(" df2/2 "," df1/2 "," \ df2/(df2+df1*f) ")" |& GnuPlot print "print pt, pF" |& GnuPlot RS="\n"; GnuPlot |& getline; RS="\r\n" # $1 is pt, $2 is pF print "invsqrt2pi=1.0/sqrt(2.0*pi)" |& GnuPlot print "nd(x)=invsqrt2pi/sd*exp(-0.5*((x-mu)/sd)**2)" |& GnuPlot print "set term png small color" |& GnuPlot #print "set term postscript color" |& GnuPlot #print "set term gif medium size 320,240" |& GnuPlot print "set yrange[-0.3:]" |& GnuPlot print "set label 'p(m1=m2) =" $1 "' at 0,-0.1 left" |& GnuPlot print "set label 'p(v1=v2) =" $2 "' at 0,-0.2 left" |& GnuPlot print "plot mu=" m1 ",sd=" sqrt(v1) ", nd(x) title 'sample 1',\ mu=" m2 ",sd=" sqrt(v2) ", nd(x) title 'sample 2'" |& GnuPlot print "quit" |& GnuPlot GnuPlot |& getline Image while ((GnuPlot |& getline) > 0) Image = Image RS $0 close(GnuPlot) } Document = Document "\ <h3>Do these samples have the same Gaussian distribution?</h3>\ <FORM METHOD=GET> <TABLE BORDER CELLPADDING=5>\ <TR>\ <TD>1. Mean </TD> <TD><input type=text name=m1 value=" m1 " size=8></TD>\ <TD>1. Variance</TD> <TD><input type=text name=v1 value=" v1 " size=8></TD>\ <TD>1. Count </TD> <TD><input type=text name=n1 value=" n1 " size=8></TD>\ </TR><TR>\ <TD>2. Mean </TD> <TD><input type=text name=m2 value=" m2 " size=8></TD>\ <TD>2. Variance</TD> <TD><input type=text name=v2 value=" v2 " size=8></TD>\ <TD>2. Count </TD> <TD><input type=text name=n2 value=" n2 " size=8></TD>\ </TR> <input type=submit value=\"Compute\">\ </TABLE></FORM><BR>" } else if (MENU[2] ~ "Image") { Reason = "OK" ORS "Content-type: image/png" #Reason = "OK" ORS "Content-type: application/x-postscript" #Reason = "OK" ORS "Content-type: image/gif" Header = Footer = "" Document = Image } } --- NEW FILE: protbase.awk --- { request = request "\n" $0 } END { BLASTService = "/inet/tcp/0/www.ncbi.nlm.nih.gov/80" printf "POST /cgi-bin/BLAST/nph-blast_report HTTP/1.0\n" |& BLASTService printf "Content-Length: " length(request) "\n\n" |& BLASTService printf request |& BLASTService while ((BLASTService |& getline) > 0) print $0 close(BLASTService) } --- NEW FILE: stoxdata.txt --- Date,Open,High,Low,Close,Volume 9-Oct-00,22.75,22.75,21.375,22.375,7888500 6-Oct-00,23.8125,24.9375,21.5625,22,10701100 5-Oct-00,24.4375,24.625,23.125,23.50,5810300 --- NEW FILE: fingerclient.awk --- BEGIN { NetService = "/inet/tcp/0/localhost/finger" print "var{name}" |& NetService while ((NetService |& getline) > 0) print $0 close(NetService) } --- NEW FILE: stoxpred.awk --- function ReadQuotes() { # Retrieve historical data for each ticker symbol FS = "," for (stock = 1; stock <= StockCount; stock++) { URL = "http://chart.yahoo.com/table.csv?s=" name[stock] \ "&a=" month "&b=" day "&c=" year-1 \ "&d=" month "&e=" day "&f=" year \ "g=d&q=q&y=0&z=" name[stock] "&x=.csv" printf("GET " URL " HTTP/1.0\r\n\r\n") |& YahooData while ((YahooData |& getline) > 0) { if (NF == 6 && $1 ~ /Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/) { if (stock == 1) days[++daycount] = $1; quote[$1, stock] = $5 } } close(YahooData) } FS = " " } function CleanUp() { # clean up time series; eliminate incomplete data sets for (d = 1; d <= daycount; d++) { for (stock = 1; stock <= StockCount; stock++) if (! ((days[d], stock) in quote)) stock = StockCount + 10 if (stock > StockCount + 1) continue datacount++ for (stock = 1; stock <= StockCount; stock++) data[datacount, stock] = int(0.5 + quote[days[d], stock]) } delete quote delete days } function Prediction() { # Predict each ticker symbol by prolonging yesterday's trend for (stock = 1; stock <= StockCount; stock++) { if (data[1, stock] > data[2, stock]) { predict[stock] = "up" } else if (data[1, stock] < data[2, stock]) { predict[stock] = "down" } else { predict[stock] = "neutral" } if ((data[1, stock] > data[2, stock]) && (data[2, stock] > data[3, stock])) hot[stock] = 1 if ((data[1, stock] < data[2, stock]) && (data[2, stock] < data[3, stock])) avoid[stock] = 1 } # Do a plausibility check: how many predictions proved correct? for (s = 1; s <= StockCount; s++) { for (d = 1; d <= datacount-2; d++) { if (data[d+1, s] > data[d+2, s]) { UpCount++ } else if (data[d+1, s] < data[d+2, s]) { DownCount++ } else { NeutralCount++ } if (((data[d, s] > data[d+1, s]) && (data[d+1, s] > data[d+2, s])) || ((data[d, s] < data[d+1, s]) && (data[d+1, s] < data[d+2, s])) || ((data[d, s] == data[d+1, s]) && (data[d+1, s] == data[d+2, s]))) CorrectCount++ } } } function Report() { # Generate report report = "\nThis is your daily " report = report "stock market report for "strftime("%A, %B %d, %Y")".\n" report = report "Here are the predictions for today:\n\n" for (stock = 1; stock <= StockCount; stock++) report = report "\t" name[stock] "\t" predict[stock] "\n" for (stock in hot) { if (HotCount++ == 0) report = report "\nThe most promising shares for today are these:\n\n" report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \ tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n" } for (stock in avoid) { if (AvoidCount++ == 0) report = report "\nThe stock shares to avoid today are these:\n\n" report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \ tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n" } report = report "\nThis sums up to " HotCount+0 " winners and " AvoidCount+0 report = report " losers. When using this kind\nof prediction scheme for" report = report " the 12 months which lie behind us,\nwe get " UpCount report = report " 'ups' and " DownCount " 'downs' and " NeutralCount report = report " 'neutrals'. Of all\nthese " UpCount+DownCount+NeutralCount report = report " predictions " CorrectCount " proved correct next day.\n" report = report "A success rate of "\ int(100*CorrectCount/(UpCount+DownCount+NeutralCount)) "%.\n" report = report "Random choice would have produced a 33% success rate.\n" report = report "Disclaimer: Like every other prediction of the stock\n" report = report "market, this report is, of course, complete nonsense.\n" report = report "If you are stupid enough to believe these predictions\n" report = report "you should visit a doctor who can treat your ailment." } function SendMail() { # send report to customers customer["unc...@du..."] = "Uncle Scrooge" customer["mo...@ut..." ] = "Sir Thomas More" customer["sp...@de..." ] = "Baruch de Spinoza" customer["ma...@hi..." ] = "Karl Marx" customer["ke...@th..." ] = "John Maynard Keynes" customer["bi...@de..." ] = "Ambrose Bierce" customer["la...@pa..." ] = "Pierre Simon de Laplace" for (c in customer) { MailPipe = "mail -s 'Daily Stock Prediction Newsletter'" c print "Good morning " customer[c] "," | MailPipe print report "\n.\n" | MailPipe close(MailPipe) } } --- NEW FILE: PostAgent.sh --- #!/bin/sh MobAg=/tmp/MobileAgent.$$ # direct script to mobile agent file cat > $MobAg # execute agent concurrently gawk -f $MobAg $MobAg > /dev/null & # HTTP header, terminator and body gawk 'BEGIN { print "\r\nAgent started" }' rm $MobAg # delete script file of agent --- NEW FILE: urlchk.awk --- BEGIN { if (ARGC != 2) { print "URLCHK - check if URLs have changed" print "IN:\n the file with URLs as a command-line parameter" print " file contains URL, old length, new length" print "PARAMS:\n -v Proxy=MyProxy -v ProxyPort=8080" print "OUT:\n same as file with URLs" print "JK 02.03.1998" exit } URLfile = ARGV[1]; ARGV[1] = "" if (Proxy != "") Proxy = " -v Proxy=" Proxy if (ProxyPort != "") ProxyPort = " -v ProxyPort=" ProxyPort while ((getline < URLfile) > 0) Length[$1] = $3 + 0 close(URLfile) # now, URLfile is read in and can be updated GetHeader = "gawk " Proxy ProxyPort " -v Method=\"HEAD\" -f geturl.awk " for (i in Length) { GetThisHeader = GetHeader i " 2>&1" while ((GetThisHeader | getline) > 0) if (toupper($0) ~ /CONTENT-LENGTH/) NewLength = $2 + 0 close(GetThisHeader) print i, Length[i], NewLength > URLfile if (Length[i] != NewLength) # report only changed URLs print i, Length[i], NewLength } close(URLfile) } --- NEW FILE: mobag.awk --- BEGIN { if (ARGC != 2) { print "MOBAG - a simple mobile agent" print "CALL:\n gawk -f mobag.awk mobag.awk" print "IN:\n the name of this script as a command-line parameter" print "PARAM:\n -v MyOrigin=myhost.com" print "OUT:\n the result on stdout" print "JK 29.03.1998 01.04.1998" exit } if (MyOrigin == "") { "uname -n" | getline MyOrigin close("uname -n") } } #ReadMySelf /^function / { FUNC = $2 } /^END/ || /^#ReadMySelf/ { FUNC = $1 } FUNC != "" { MOBFUN[FUNC] = MOBFUN[FUNC] RS $0 } (FUNC != "") && (/^}/ || /^#EndOfMySelf/) \ { FUNC = "" } #EndOfMySelf function migrate(Destination, MobCode, Label) { MOBVAR["Label"] = Label MOBVAR["Destination"] = Destination RS = ORS = "\r\n" HttpService = "/inet/tcp/0/" Destination for (i in MOBFUN) MobCode = (MobCode "\n" MOBFUN[i]) MobCode = MobCode "\n\nBEGIN {" for (i in MOBVAR) MobCode = (MobCode "\n MOBVAR[\"" i "\"] = \"" MOBVAR[i] "\"") MobCode = MobCode "\n}\n" print "POST /cgi-bin/PostAgent.sh HTTP/1.0" |& HttpService print "Content-length:", length(MobCode) ORS |& HttpService printf "%s", MobCode |& HttpService while ((HttpService |& getline) > 0) print $0 close(HttpService) } END { if (ARGC != 2) exit # stop when called with wrong parameters if (MyOrigin != "") # is this the originating host? MyInit() # if so, initialize the application else # we are on a host with migrated data MyJob() # so we do our job } function MyInit() { MOBVAR["MyOrigin"] = MyOrigin MOBVAR["Machines"] = "localhost/80 max/80 moritz/80 castor/80" split(MOBVAR["Machines"], Machines) # which host is the first? migrate(Machines[1], "", "") # go to the first host while (("/inet/tcp/8080/0/0" |& getline) > 0) # wait for result print $0 # print result close("/inet/tcp/8080/0/0") } function MyJob() { # forget this host sub(MOBVAR["Destination"], "", MOBVAR["Machines"]) MOBVAR["Result"]=MOBVAR["Result"] SUBSEP SUBSEP MOBVAR["Destination"] ":" while (("who" | getline) > 0) # who is logged in? MOBVAR["Result"] = MOBVAR["Result"] SUBSEP $0 close("who") if (index(MOBVAR["Machines"], "/") > 0) { # any more machines to visit? split(MOBVAR["Machines"], Machines) # which host is next? migrate(Machines[1], "", "") # go there } else { # no more machines gsub(SUBSEP, "\n", MOBVAR["Result"]) # send result to origin print MOBVAR["Result"] |& "/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080" close("/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080") } } --- NEW FILE: remconf.awk --- function SetUpServer() { TopHeader = "<HTML><title>Remote Configuration</title>" TopDoc = "<BODY>\ <h2>Please choose one of the following actions:</h2>\ <UL>\ <LI><A HREF=" MyPrefix "/AboutServer>About this server</A></LI>\ <LI><A HREF=" MyPrefix "/ReadConfig>Read Configuration</A></LI>\ <LI><A HREF=" MyPrefix "/CheckConfig>Check Configuration</A></LI>\ <LI><A HREF=" MyPrefix "/ChangeConfig>Change Configuration</A></LI>\ <LI><A HREF=" MyPrefix "/SaveConfig>Save Configuration</A></LI>\ </UL>" TopFooter = "</BODY></HTML>" if (ConfigFile == "") ConfigFile = "config.asc" } function HandleGET() { if(MENU[2] == "AboutServer") { Document = "This is a GUI for remote configuration of an\ embedded system. It is is implemented as one GAWK script." } else if (MENU[2] == "ReadConfig") { RS = "\n" while ((getline < ConfigFile) > 0) config[$1] = $2; close(ConfigFile) RS = "\r\n" Document = "Configuration has been read." } else if (MENU[2] == "CheckConfig") { Document = "<TABLE BORDER=1 CELLPADDING=5>" for (i in config) Document = Document "<TR><TD>" i "</TD>" \ "<TD>" config[i] "</TD></TR>" Document = Document "</TABLE>" } else if (MENU[2] == "ChangeConfig") { if ("Param" in GETARG) { # any parameter to set? if (GETARG["Param"] in config) { # is parameter valid? config[GETARG["Param"]] = GETARG["Value"] Document = (GETARG["Param"] " = " GETARG["Value"] ".") } else { Document = "Parameter <b>" GETARG["Param"] "</b> is invalid." } } else { Document = "<FORM method=GET><h4>Change one parameter</h4>\ <TABLE BORDER CELLPADDING=5>\ <TR><TD>Parameter</TD><TD>Value</TD></TR>\ <TR><TD><input type=text name=Param value=\"\" size=20></TD>\ <TD><input type=text name=Value value=\"\" size=40></TD>\ </TR></TABLE><input type=submit value=\"Set\"></FORM>" } } else if (MENU[2] == "SaveConfig") { for (i in config) printf("%s %s\n", i, config[i]) > ConfigFile close(ConfigFile) Document = "Configuration has been saved." } } --- NEW FILE: hello-serv.awk --- BEGIN { RS = ORS = "\r\n" HttpService = "/inet/tcp/8080/0/0" Hello = "<HTML><HEAD>" \ "<TITLE>A Famous Greeting</TITLE></HEAD>" \ "<BODY><H1>Hello, world</H1></BODY></HTML>" Len = length(Hello) + length(ORS) print "HTTP/1.0 200 OK" |& HttpService print "Content-Length: " Len ORS |& HttpService print Hello |& HttpService while ((HttpService |& getline) > 0) continue; close(HttpService) } --- NEW FILE: geturl.awk --- BEGIN { if (ARGC != 2) { print "GETURL - retrieve Web page via HTTP 1.0" print "IN:\n the URL as a command-line parameter" print "PARAM(S):\n -v Proxy=MyProxy" print "OUT:\n the page content on stdout" print " the page header on stderr" print "JK 16.05.1997" print "ADR 13.08.2000" exit } URL = ARGV[1]; ARGV[1] = "" if (Proxy == "") Proxy = "127.0.0.1" if (ProxyPort == 0) ProxyPort = 80 if (Method == "") Method = "GET" HttpService = "/inet/tcp/0/" Proxy "/" ProxyPort ORS = RS = "\r\n\r\n" print Method " " URL " HTTP/1.0" |& HttpService HttpService |& getline Header print Header > "/dev/stderr" while ((HttpService |& getline) > 0) printf "%s", $0 close(HttpService) } --- NEW FILE: testserv.awk --- BEGIN { CGI_setup("GET", "http://www.gnu.org/cgi-bin/foo?p1=stuff&p2=stuff%26junk" \ "&percent=a %25 sign", "1.0") for (i in MENU) printf "MENU[\"%s\"] = %s\n", i, MENU[i] for (i in PARAM) printf "PARAM[\"%s\"] = %s\n", i, PARAM[i] for (i in GETARG) printf "GETARG[\"%s\"] = %s\n", i, GETARG[i] } --- NEW FILE: webgrab.awk --- BEGIN { RS = "http://[#%&\\+\\-\\./0-9\\:;\\?A-Z_a-z\\~]*" } RT != "" { command = ("gawk -v Proxy=MyProxy -f geturl.awk " RT \ " > doc" NR ".html") print command } --- NEW FILE: maze.awk --- function SetUpServer() { TopHeader = "<HTML><title>Walk through a maze</title>" TopDoc = "\ <h2>Please choose one of the following actions:</h2>\ <UL>\ <LI><A HREF=" MyPrefix "/AboutServer>About this server</A>\ <LI><A HREF=" MyPrefix "/VRMLtest>Watch a simple VRML scene</A>\ </UL>" TopFooter = "</HTML>" srand() } function HandleGET() { if (MENU[2] == "AboutServer") { Document = "If your browser has a VRML 2 plugin,\ this server shows you a simple VRML scene." } else if (MENU[2] == "VRMLtest") { XSIZE = YSIZE = 11 # initially, everything is wall for (y = 0; y < YSIZE; y++) for (x = 0; x < XSIZE; x++) Maze[x, y] = "#" delete Maze[0, 1] # entry is not wall delete Maze[XSIZE-1, YSIZE-2] # exit is not wall MakeMaze(1, 1) Document = "\ #VRML V2.0 utf8\n\ Group {\n\ children [\n\ PointLight {\n\ ambientIntensity 0.2\n\ color 0.7 0.7 0.7\n\ location 0.0 8.0 10.0\n\ }\n\ DEF B1 Background {\n\ skyColor [0 0 0, 1.0 1.0 1.0 ]\n\ skyAngle 1.6\n\ groundColor [1 1 1, 0.8 0.8 0.8, 0.2 0.2 0.2 ]\n\ groundAngle [ 1.2 1.57 ]\n\ }\n\ DEF Wall Shape {\n\ geometry Box {size 1 1 1}\n\ appearance Appearance { material Material { diffuseColor 0 0 1 } }\n\ }\n\ DEF Entry Viewpoint {\n\ position 0.5 1.0 5.0\n\ orientation 0.0 0.0 -1.0 0.52\n\ }\n" for (i in Maze) { split(i, t, SUBSEP) Document = Document " Transform { translation " Document = Document t[1] " 0 -" t[2] " children USE Wall }\n" } Document = Document " ] # end of group for world\n}" Reason = "OK" ORS "Content-type: model/vrml" Header = Footer = "" } } function MakeMaze(x, y) { delete Maze[x, y] # here we are, we have no wall here p = 0 # count unvisited fields in all directions if (x-2 SUBSEP y in Maze) d[p++] = "-x" if (x SUBSEP y-2 in Maze) d[p++] = "-y" if (x+2 SUBSEP y in Maze) d[p++] = "+x" if (x SUBSEP y+2 in Maze) d[p++] = "+y" if (p>0) { # if there are univisited fields, go there p = int(p*rand()) # choose one unvisited field at random if (d[p] == "-x") { delete Maze[x - 1, y]; MakeMaze(x - 2, y) } else if (d[p] == "-y") { delete Maze[x, y - 1]; MakeMaze(x, y - 2) } else if (d[p] == "+x") { delete Maze[x + 1, y]; MakeMaze(x + 2, y) } else if (d[p] == "+y") { delete Maze[x, y + 1]; MakeMaze(x, y + 2) } # we are back from recursion MakeMaze(x, y); # try again while there are unvisited fields } } --- NEW FILE: coreserv.awk --- # CGI Library and core of a web server # # Juergen Kahrs, Jue...@vr... # with Arnold Robbins, ar...@gn... # September 2000 # Global arrays # GETARG --- arguments to CGI GET command # MENU --- menu items (path names) # PARAM --- parameters of form x=y # Optional variable MyHost contains host address # Optional variable MyPort contains port number # Needs TopHeader, TopDoc, TopFooter # Sets MyPrefix, HttpService, Status, Reason BEGIN { if (MyHost == "") { "uname -n" | getline MyHost close("uname -n") } if (MyPort == 0) MyPort = 8080 HttpService = "/inet/tcp/" MyPort "/0/0" MyPrefix = "http://" MyHost ":" MyPort SetUpServer() while ("awk" != "complex") { # header lines are terminated this way RS = ORS = "\r\n" Status = 200 # this means OK Reason = "OK" Header = TopHeader Document = TopDoc Footer = TopFooter if (GETARG["Method"] == "GET") { HandleGET() } else if (GETARG["Method"] == "HEAD") { # not yet implemented } else if (GETARG["Method"] != "") { print "bad method", GETARG["Method"] } Prompt = Header Document Footer print "HTTP/1.0", Status, Reason |& HttpService print "Connection: Close" |& HttpService print "Pragma: no-cache" |& HttpService len = length(Prompt) + length(ORS) print "Content-length:", len |& HttpService print ORS Prompt |& HttpService # ignore all the header lines while ((HttpService |& getline) > 0) continue # stop talking to this client close(HttpService) # wait for new client request HttpService |& getline # do some logging print systime(), strftime(), $0 CGI_setup($1, $2, $3) } } function CGI_setup( method, uri, version, i) { delete GETARG delete MENU delete PARAM GETARG["Method"] = method GETARG["URI"] = uri GETARG["Version"] = version i = index(uri, "?") if (i > 0) { # is there a "?" indicating a CGI request? split(substr(uri, 1, i-1), MENU, "[/:]") split(substr(uri, i+1), PARAM, "&") for (i in PARAM) { PARAM[i] = _CGI_decode(PARAM[i]) j = index(PARAM[i], "=") GETARG[substr(PARAM[i], 1, j-1)] = \ substr(PARAM[i], j+1) } } else { # there is no "?", no need for splitting PARAMs split(uri, MENU, "[/:]") } for (i in MENU) # decode characters in path if (i > 4) # but not those in host name MENU[i] = _CGI_decode(MENU[i]) } function _CGI_decode(str, hexdigs, i, pre, code1, code2, val, result) { hexdigs = "123456789abcdef" i = index(str, "%") if (i == 0) # no work to do return str do { pre = substr(str, 1, i-1) # part before %xx code1 = substr(str, i+1, 1) # first hex digit code2 = substr(str, i+2, 1) # second hex digit str = substr(str, i+3) # rest of string code1 = tolower(code1) code2 = tolower(code2) val = index(hexdigs, code1) * 16 \ + index(hexdigs, code2) result = result pre sprintf("%c", val) i = index(str, "%") } while (i != 0) if (length(str) > 0) result = result str return result } --- NEW FILE: eliza.awk --- function SetUpServer() { SetUpEliza() TopHeader = \ "<HTML><title>An HTTP-based System with GAWK</title>\ <HEAD><META HTTP-EQUIV=\"Content-Type\"\ CONTENT=\"text/html; charset=iso-8859-1\"></HEAD>\ <BODY BGCOLOR=\"#ffffff\" TEXT=\"#000000\"\ LINK=\"#0000ff\" VLINK=\"#0000ff\"\ ALINK=\"#0000ff\"> <A NAME=\"top\">" TopDoc = "\ <h2>Please choose one of the following actions:</h2>\ <UL>\ <LI>\ <A HREF=" MyPrefix "/AboutServer>About this server</A>\ </LI><LI>\ <A HREF=" MyPrefix "/AboutELIZA>About Eliza</A></LI>\ <LI>\ <A HREF=" MyPrefix \ "/StartELIZA>Start talking to Eliza</A></LI></UL>" TopFooter = "</BODY></HTML>" } function HandleGET() { # A real HTTP server would treat some parts of the URI as a file name. # We take parts of the URI as menu choices and go on accordingly. if(MENU[2] == "AboutServer") { Document = "This is not a CGI script.\ This is an httpd, an HTML file, and a CGI script all \ in one GAWK script. It needs no separate www-server, \ no installation, and no root privileges.\ <p>To run it, do this:</p><ul>\ <li> start this script with \"gawk -f httpserver.awk\",</li>\ <li> and on the same host let your www browser open location\ \"http://localhost:8080\"</li>\ </ul>\<p>\ Details of HTTP come from:</p><ul>\ <li>Hethmon: Illustrated Guide to HTTP</p>\ <li>RFC 2068</li></ul><p>JK 14.9.1997</p>" } else if (MENU[2] == "AboutELIZA") { Document = "This is an implementation of the famous ELIZA\ program by Joseph Weizenbaum. It is written in GAWK and\ /bin/sh: expad: command not found } else if (MENU[2] == "StartELIZA") { gsub(/\+/, " ", GETARG["YouSay"]) # Here we also have to substitute coded special characters Document = "<form method=GET>" \ "<h3>" ElizaSays(GETARG["YouSay"]) "</h3>\ <p><input type=text name=YouSay value=\"\" size=60>\ <br><input type=submit value=\"Tell her about it\"></p></form>" } } function ElizaSays(YouSay) { if (YouSay == "") { cost = 0 answer = "HI, IM ELIZA, TELL ME YOUR PROBLEM" } else { q = toupper(YouSay) gsub("'", "", q) if(q == qold) { answer = "PLEASE DONT REPEAT YOURSELF !" } else { if (index(q, "SHUT UP") > 0) { answer = "WELL, PLEASE PAY YOUR BILL. ITS EXACTLY ... $"\ int(100*rand()+30+cost/100) } else { qold = q w = "-" # no keyword recognized yet for (i in k) { # search for keywords if (index(q, i) > 0) { w = i break } } if (w == "-") { # no keyword, take old subject w = wold subj = subjold } else { # find subject subj = substr(q, index(q, w) + length(w)+1) wold = w subjold = subj # remember keyword and subject } for (i in conj) gsub(i, conj[i], q) # conjugation # from all answers to this keyword, select one randomly answer = r[indices[int(split(k[w], indices) * rand()) + 1]] # insert subject into answer gsub("_", subj, answer) } } } cost += length(answer) # for later payment : 1 cent per character return answer } function SetUpEliza() { srand() wold = "-" subjold = " " # table for conjugation conj[" ARE " ] = " AM " conj["WERE " ] = "WAS " conj[" YOU " ] = " I " conj["YOUR " ] = "MY " conj[" IVE " ] =\ conj[" I HAVE " ] = " YOU HAVE " conj[" YOUVE " ] =\ conj[" YOU HAVE "] = " I HAVE " conj[" IM " ] =\ conj[" I AM " ] = " YOU ARE " conj[" YOURE " ] =\ conj[" YOU ARE " ] = " I AM " # table of all answers r[1] = "DONT YOU BELIEVE THAT I CAN _" r[2] = "PERHAPS YOU WOULD LIKE TO BE ABLE TO _ ?" r[3] = "YOU WANT ME TO BE ABLE TO _ ?" r[4] = "PERHAPS YOU DONT WANT TO _ " r[5] = "DO YOU WANT TO BE ABLE TO _ ?" r[6] = "WHAT MAKES YOU THINK I AM _ ?" r[7] = "DOES IT PLEASE YOU TO BELIEVE I AM _ ?" r[8] = "PERHAPS YOU WOULD LIKE TO BE _ ?" r[9] = "DO YOU SOMETIMES WISH YOU WERE _ ?" r[10] = "DONT YOU REALLY _ ?" r[11] = "WHY DONT YOU _ ?" r[12] = "DO YOU WISH TO BE ABLE TO _ ?" r[13] = "DOES THAT TROUBLE YOU ?" r[14] = "TELL ME MORE ABOUT SUCH FEELINGS" r[15] = "DO YOU OFTEN FEEL _ ?" r[16] = "DO YOU ENJOY FEELING _ ?" r[17] = "DO YOU REALLY BELIEVE I DONT _ ?" r[18] = "PERHAPS IN GOOD TIME I WILL _ " r[19] = "DO YOU WANT ME TO _ ?" r[20] = "DO YOU THINK YOU SHOULD BE ABLE TO _ ?" r[21] = "WHY CANT YOU _ ?" r[22] = "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM _ ?" r[23] = "WOULD YOU PREFER IF I WERE NOT _ ?" r[24] = "PERHAPS IN YOUR FANTASIES I AM _ " r[25] = "HOW DO YOU KNOW YOU CANT _ ?" r[26] = "HAVE YOU TRIED ?" r[27] = "PERHAPS YOU CAN NOW _ " r[28] = "DID YOU COME TO ME BECAUSE YOU ARE _ ?" r[29] = "HOW LONG HAVE YOU BEEN _ ?" r[30] = "DO YOU BELIEVE ITS NORMAL TO BE _ ?" r[31] = "DO YOU ENJOY BEING _ ?" r[32] = "WE WERE DISCUSSING YOU -- NOT ME" r[33] = "Oh, I _" r[34] = "YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU ?" r[35] = "WHAT WOULD IT MEAN TO YOU, IF YOU GOT _ ?" r[36] = "WHY DO YOU WANT _ ?" r[37] = "SUPPOSE YOU SOON GOT _" r[38] = "WHAT IF YOU NEVER GOT _ ?" r[39] = "I SOMETIMES ALSO WANT _" r[40] = "WHY DO YOU ASK ?" r[41] = "DOES THAT QUESTION INTEREST YOU ?" r[42] = "WHAT ANSWER WOULD PLEASE YOU THE MOST ?" r[43] = "WHAT DO YOU THINK ?" r[44] = "ARE SUCH QUESTIONS IN YOUR MIND OFTEN ?" r[45] = "WHAT IS IT THAT YOU REALLY WANT TO KNOW ?" r[46] = "HAVE YOU ASKED ANYONE ELSE ?" r[47] = "HAVE YOU ASKED SUCH QUESTIONS BEFORE ?" r[48] = "WHAT ELSE COMES TO MIND WHEN YOU ASK THAT ?" r[49] = "NAMES DON'T INTEREST ME" r[50] = "I DONT CARE ABOUT NAMES -- PLEASE GO ON" r[51] = "IS THAT THE REAL REASON ?" r[52] = "DONT ANY OTHER REASONS COME TO MIND ?" r[53] = "DOES THAT REASON EXPLAIN ANYTHING ELSE ?" r[54] = "WHAT OTHER REASONS MIGHT THERE BE ?" r[55] = "PLEASE DON'T APOLOGIZE !" r[56] = "APOLOGIES ARE NOT NECESSARY" r[57] = "WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE ?" r[58] = "DON'T BE SO DEFENSIVE" r[59] = "WHAT DOES THAT DREAM SUGGEST TO YOU ?" r[60] = "DO YOU DREAM OFTEN ?" r[61] = "WHAT PERSONS APPEAR IN YOUR DREAMS ?" r[62] = "ARE YOU DISTURBED BY YOUR DREAMS ?" r[63] = "HOW DO YOU DO ... PLEASE STATE YOUR PROBLEM" r[64] = "YOU DON'T SEEM QUITE CERTAIN" r[65] = "WHY THE UNCERTAIN TONE ?" r[66] = "CAN'T YOU BE MORE POSITIVE ?" r[67] = "YOU AREN'T SURE ?" r[68] = "DON'T YOU KNOW ?" r[69] = "WHY NO _ ?" r[70] = "DON'T SAY NO, IT'S ALWAYS SO NEGATIVE" r[71] = "WHY NOT ?" r[72] = "ARE YOU SURE ?" r[73] = "WHY NO ?" r[74] = "WHY ARE YOU CONCERNED ABOUT MY _ ?" r[75] = "WHAT ABOUT YOUR OWN _ ?" r[76] = "CAN'T YOU THINK ABOUT A SPECIFIC EXAMPLE ?" r[77] = "WHEN ?" r[78] = "WHAT ARE YOU THINKING OF ?" r[79] = "REALLY, ALWAYS ?" r[80] = "DO YOU REALLY THINK SO ?" r[81] = "BUT YOU ARE NOT SURE YOU _ " r[82] = "DO YOU DOUBT YOU _ ?" r[83] = "IN WHAT WAY ?" r[84] = "WHAT RESEMBLANCE DO YOU SEE ?" r[85] = "WHAT DOES THE SIMILARITY SUGGEST TO YOU ?" r[86] = "WHAT OTHER CONNECTION DO YOU SEE ?" r[87] = "COULD THERE REALLY BE SOME CONNECTIONS ?" r[88] = "HOW ?" r[89] = "YOU SEEM QUITE POSITIVE" r[90] = "ARE YOU SURE ?" r[91] = "I SEE" r[92] = "I UNDERSTAND" r[93] = "WHY DO YOU BRING UP THE TOPIC OF FRIENDS ?" r[94] = "DO YOUR FRIENDS WORRY YOU ?" r[95] = "DO YOUR FRIENDS PICK ON YOU ?" r[96] = "ARE YOU SURE YOU HAVE ANY FRIENDS ?" r[97] = "DO YOU IMPOSE ON YOUR FRIENDS ?" r[98] = "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU" r[99] = "DO COMPUTERS WORRY YOU ?" r[100] = "ARE YOU TALKING ABOUT ME IN PARTICULAR ?" r[101] = "ARE YOU FRIGHTENED BY MACHINES ?" r[102] = "WHY DO YOU MENTION COMPUTERS ?" r[103] = "WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEMS ?" r[104] = "DON'T YOU THINK COMPUTERS CAN HELP PEOPLE ?" r[105] = "WHAT IS IT ABOUT MACHINES THAT WORRIES YOU ?" r[106] = "SAY, DO YOU HAVE ANY PSYCHOLOGICAL PROBLEMS ?" r[107] = "WHAT DOES THAT SUGGEST TO YOU ?" r[108] = "I SEE" r[109] = "IM NOT SURE I UNDERSTAND YOU FULLY" r[110] = "COME COME ELUCIDATE YOUR THOUGHTS" r[111] = "CAN YOU ELABORATE ON THAT ?" r[112] = "THAT IS QUITE INTERESTING" r[113] = "WHY DO YOU HAVE PROBLEMS WITH MONEY ?" r[114] = "DO YOU THINK MONEY IS EVERYTHING ?" r[115] = "ARE YOU SURE THAT MONEY IS THE PROBLEM ?" r[116] = "I THINK WE WANT TO TALK ABOUT YOU, NOT ABOUT ME" r[117] = "WHAT'S ABOUT ME ?" r[118] = "WHY DO YOU ALWAYS BRING UP MY NAME ?" # table for looking up answers that # fit to a certain keyword k["CAN YOU"] = "1 2 3" k["CAN I"] = "4 5" k["YOU ARE"] =\ k["YOURE"] = "6 7 8 9" k["I DONT"] = "10 11 12 13" k["I FEEL"] = "14 15 16" k["WHY DONT YOU"] = "17 18 19" k["WHY CANT I"] = "20 21" k["ARE YOU"] = "22 23 24" k["I CANT"] = "25 26 27" k["I AM"] =\ k["IM "] = "28 29 30 31" k["YOU "] = "32 33 34" k["I WANT"] = "35 36 37 38 39" k["WHAT"] =\ k["HOW"] =\ k["WHO"] =\ k["WHERE"] =\ k["WHEN"] =\ k["WHY"] = "40 41 42 43 44 45 46 47 48" k["NAME"] = "49 50" k["CAUSE"] = "51 52 53 54" k["SORRY"] = "55 56 57 58" k["DREAM"] = "59 60 61 62" k["HELLO"] =\ k["HI "] = "63" k["MAYBE"] = "64 65 66 67 68" k[" NO "] = "69 70 71 72 73" k["YOUR"] = "74 75" k["ALWAYS"] = "76 77 78 79" k["THINK"] = "80 81 82" k["LIKE"] = "83 84 85 86 87 88 89" k["YES"] = "90 91 92" k["FRIEND"] = "93 94 95 96 97 98" k["COMPUTER"] = "99 100 101 102 103 104 105" k["-"] = "106 107 108 109 110 111 112" k["MONEY"] = "113 114 115" k["ELIZA"] = "116 117 118" } --- NEW FILE: protbase.request --- PROGRAM blastn DATALIB month EXPECT 0.75 BEGIN >GAWK310 the gawking gene GNU AWK tgcttggctgaggagccataggacgagagcttcctggtgaagtgtgtttcttgaaatcat caccaccatggacagcaaa --- NEW FILE: protbase.result --- Sequences producing significant alignments: (bits) Value gb|AC021182.14|AC021182 Homo sapiens chromosome 7 clone RP11-733... 38 0.20 gb|AC021056.12|AC021056 Homo sapiens chromosome 3 clone RP11-115... 38 0.20 emb|AL160278.10|AL160278 Homo sapiens chromosome 9 clone RP11-57... 38 0.20 emb|AL391139.11|AL391139 Homo sapiens chromosome X clone RP11-35... 38 0.20 emb|AL365192.6|AL365192 Homo sapiens chromosome 6 clone RP3-421H... 38 0.20 emb|AL138812.9|AL138812 Homo sapiens chromosome 11 clone RP1-276... 38 0.20 gb|AC073881.3|AC073881 Homo sapiens chromosome 15 clone CTD-2169... 38 0.20 --- NEW FILE: panic.awk --- BEGIN { RS = ORS = "\r\n" if (MyPort == 0) MyPort = 8080 HttpService = "/inet/tcp/" MyPort "/0/0" Hello = "<HTML><HEAD><TITLE>Out Of Service</TITLE>" \ "</HEAD><BODY><H1>" \ "This site is temporarily out of service." \ "</H1></BODY></HTML>" Len = length(Hello) + length(ORS) while ("awk" != "complex") { print "HTTP/1.0 200 OK" |& HttpService print "Content-Length: " Len ORS |& HttpService print Hello |& HttpService while ((HttpService |& getline) > 0) continue; close(HttpService) } } |
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/doc In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/doc Added Files: ChangeLog Makefile.am Makefile.in README.card ad.block awkcard.in awkforai.txt cardfonts colors gawk.1 gawk.info gawk.texi gawkinet.info gawkinet.texi igawk.1 lflashlight.eps macros no.colors rflashlight.eps setter.outline statist.eps statist.jpg texinfo.tex Log Message: Update package --- NEW FILE: Makefile.in --- # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # # doc/Makefile.am --- automake input file for gawk # # Copyright (C) 2000, 2001, 2002, 2004, 2005 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. # # GAWK 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. # # GAWK 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 # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \ texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/socket.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strtod.m4 \ $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.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 = INFO_DEPS = $(srcdir)/gawk.info $(srcdir)/gawkinet.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = gawk.dvi gawkinet.dvi PDFS = gawk.pdf gawkinet.pdf PSS = gawk.ps gawkinet.ps HTMLS = gawk.html gawkinet.html TEXINFOS = gawk.texi gawkinet.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ --no-split --force MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ STRIP = @STRIP@ U = @U@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ 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@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ info_TEXINFOS = gawk.texi gawkinet.texi man_MANS = gawk.1 igawk.1 EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ awkcard.in awkforai.txt texinfo.tex cardfonts \ macros colors no.colors $(man_MANS) \ lflashlight.eps rflashlight.eps \ statist.jpg statist.eps TROFF = groff -t -Tps -U SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \ -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/" CARDSRC = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/colors awkcard.tr CARDSRC_N = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/no.colors awkcard.tr CARDFILES = $(CARDSRC) ad.block awkcard.in setter.outline # Use this if your troff can correctly handle macros from 'colors' file AWKCARD = awkcard.ps # Uncomment the following definition of AWKCARD if your troff can produce # Postscript but still has troubles with macros from 'colors'. As this # is not groff you will have to change TROFF macro as well. Do not forget # to ensure that awkcard.tr is processed by tbl. #AWKCARD = awkcard.nc # The following is patterned after the main Makefile.am. The point is to # make pgawk.1 a link to gawk.1 in the installed man directory. # We want hard links for install-data-hook, below LN = ln 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 .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ 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; \ 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)/gawk.info: gawk.texi gawk.dvi: gawk.texi gawk.pdf: gawk.texi gawk.html: gawk.texi $(srcdir)/gawkinet.info: gawkinet.texi gawkinet.dvi: gawkinet.texi gawkinet.pdf: gawkinet.texi gawkinet.html: gawkinet.texi .dvi.ps: $(DVIPS) -o $@ $< uninstall-info-am: @$(PRE_UNINSTALL) @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)' --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 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 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; \ for file in $$d/$$base*; do \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f $(distdir)/$$relfile || \ cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: -rm -rf gawk.aux gawk.cp gawk.cps gawk.fn gawk.ky gawk.kys gawk.log gawk.pg \ gawk.pgs gawk.tmp gawk.toc gawk.tp gawk.tps gawk.vr gawk.dvi \ gawk.pdf gawk.ps gawk.html gawkinet.aux gawkinet.cp \ gawkinet.cps gawkinet.fn gawkinet.ky gawkinet.kys \ gawkinet.log gawkinet.pg gawkinet.pgs gawkinet.tmp \ gawkinet.toc gawkinet.tp gawkinet.tps gawkinet.vr \ gawkinet.dvi gawkinet.pdf gawkinet.ps gawkinet.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)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ 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-am: clean-generic 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 @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: 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 installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-info-am uninstall-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 .PHONY: all all-am check check-am clean clean-generic dist-info \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-data-hook install-exec install-exec-am install-info \ install-info-am install-man install-man1 install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-hook uninstall-info-am \ uninstall-man uninstall-man1 # Link gawk.1 to pgawk.1 install-data-hook: (cd $(DESTDIR)$(man1dir); \ $(LN) gawk.1 pgawk.1 2>/dev/null ; \ exit 0) # Undo the above when uninstalling uninstall-hook: cd $(DESTDIR)$(man1dir); rm -f pgawk.1 ; exit 0 postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD) gawk.ps: gawk.dvi dvips -o gawk.ps gawk.dvi gawkinet.ps: gawkinet.dvi dvips -o gawkinet.ps gawkinet.dvi gawk.1.ps: gawk.1 -groff -man $(srcdir)/gawk.1 > gawk.1.ps igawk.1.ps: igawk.1 -groff -man $(srcdir)/igawk.1 > igawk.1.ps awkcard.tr: awkcard.in sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr awkcard.ps: $(CARDFILES) $(TROFF) $(CARDSRC) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps awkcard.nc: $(CARDFILES) $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc clean: rm -f *.ps *~ awkcard.nc awkcard.tr *.html # 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: --- NEW FILE: statist.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: colors --- .\" AWK Reference Card --- Arnold Robbins, ar...@sk... .\" This file sets the colors to use. .\" .\" Copyright (C) 1996,97,99 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission .\" notice are preserved on all copies. .\" .\" Permission is granted to process this file through troff 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 reference card). .\" .\" Permission is granted to copy and distribute modified versions of this .\" reference card 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 .\" reference card into another language, under the above conditions for .\" modified versions, except that this permission notice may be stated in .\" a translation approved by the Foundation. .\" .ig Strings for inline color change. CR - color red CG - color green CL - color light blue CB - color blue CD - color dark, i.e. black CX - color boX, i.e. for the surrounding boxes (red for now) .. .ds CR \X'ps: exec 0 .96 .65 0 setcmykcolor' .ds CG \X'ps: exec 1.0 0 .51 .43 setcmykcolor' .ds CL \X'ps: exec .69 .34 0 0 setcmykcolor' .ds CB \X'ps: exec 1 .72 0 .06 setcmykcolor' .ds CD \X'ps: exec 1 1 1 1 setcmykcolor' .ds CX \*(CG --- NEW FILE: no.colors --- .\" AWK Reference Card --- Arnold Robbins, ar...@sk... .\" This file is for troff which does not know what to do .\" with literal Poscript and cannot use the macros from 'colors'. .\" .\" Copyright (C) 1996 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission .\" notice are preserved on all copies. .\" .\" Permission is granted to process this file through troff 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 reference card). .\" .\" Permission is granted to copy and distribute modified versions of this .\" reference card 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 .\" reference card into another language, under the above conditions for .\" modified versions, except that this permission notice may be stated in .\" a translation approved by the Foundation. .\" .ds CR .ds CG .ds CL .ds CB .ds CD .ds CX --- NEW FILE: ad.block --- .\" AWK Reference Card --- Arnold Robbins, ar...@sk... .\" This file is the Ad block (included in cover) .\" .\" Copyright (C) 1996, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission .\" notice are preserved on all copies. .\" .\" Permission is granted to process this file through troff 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 reference card). .\" .\" Permission is granted to copy and distribute modified versions of this .\" reference card 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 .\" reference card into another language, under the above conditions for .\" modified versions, except that this permission notice may be stated in .\" a translation approved by the Foundation. .\" .ft HB .ps 10 .vs 12 .ES .nf .ce 7 \*(CBFree Software Foundation, Inc. .ft H 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA Phone: +1-617-542-5942 Fax (including Japan): +1-617-542-2652 E-mail: gn...@gn... URL: http://www.gnu.org .ce 5 .ft HB \*(CGSource Distributions on CD-ROM .\" Deluxe Distributions Emacs, Make and GDB Manuals Emacs and GDB References\*(CX .EB "\f(HBOTHER FSF PRODUCTS:\*(FR" .ps .vs --- NEW FILE: Makefile.am --- # # doc/Makefile.am --- automake input file for gawk # # Copyright (C) 2000, 2001, 2002, 2004, 2005 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. # # GAWK 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. # # GAWK 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 # ## process this file with automake to produce Makefile.in info_TEXINFOS = gawk.texi gawkinet.texi man_MANS = gawk.1 igawk.1 EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ awkcard.in awkforai.txt texinfo.tex cardfonts \ macros colors no.colors $(man_MANS) \ lflashlight.eps rflashlight.eps \ statist.jpg statist.eps MAKEINFO = @MAKEINFO@ --no-split --force TROFF = groff -t -Tps -U SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \ -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/" CARDSRC = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/colors awkcard.tr CARDSRC_N = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/no.colors awkcard.tr CARDFILES= $(CARDSRC) ad.block awkcard.in setter.outline # Use this if your troff can correctly handle macros from 'colors' file AWKCARD = awkcard.ps # Uncomment the following definition of AWKCARD if your troff can produce # Postscript but still has troubles with macros from 'colors'. As this # is not groff you will have to change TROFF macro as well. Do not forget # to ensure that awkcard.tr is processed by tbl. #AWKCARD = awkcard.nc # The following is patterned after the main Makefile.am. The point is to # make pgawk.1 a link to gawk.1 in the installed man directory. # We want hard links for install-data-hook, below LN= ln # Link gawk.1 to pgawk.1 install-data-hook: (cd $(DESTDIR)$(man1dir); \ $(LN) gawk.1 pgawk.1 2>/dev/null ; \ exit 0) # Undo the above when uninstalling uninstall-hook: cd $(DESTDIR)$(man1dir); rm -f pgawk.1 ; exit 0 postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD) gawk.ps: gawk.dvi dvips -o gawk.ps gawk.dvi gawkinet.ps: gawkinet.dvi dvips -o gawkinet.ps gawkinet.dvi gawk.1.ps: gawk.1 -groff -man $(srcdir)/gawk.1 > gawk.1.ps igawk.1.ps: igawk.1 -groff -man $(srcdir)/igawk.1 > igawk.1.ps awkcard.tr: awkcard.in sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr awkcard.ps: $(CARDFILES) $(TROFF) $(CARDSRC) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps awkcard.nc: $(CARDFILES) $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc clean: rm -f *.ps *~ awkcard.nc awkcard.tr *.html --- NEW FILE: awkforai.txt --- Draft for ACM SIGPLAN Patterns (Language Trends) 1996 Why GAWK for AI? Ronald P. Loui Most people are surprised when I tell them what language we use in our undergraduate AI programming class. That's understandable. We use GAWK. GAWK, Gnu's version of Aho, Weinberger, and Kernighan's old pattern scanning language isn't even viewed as a programming language by most people. Like PERL and TCL, most prefer to view it as a "scripting language." It has no objects; it is not functional; it does no built-in logic programming. Their surprise turns to puzzlement when I confide that (a) while the students are allowed to use any language they want; (b) with a single exception, the best work consistently results from those working in GAWK. (footnote: The exception was a PASCAL programmer who is now an NSF graduate fellow getting a Ph.D. in mathematics at Harvard.) Programmers in C, C++, and LISP haven't even been close (we have not seen work in PROLOG or JAVA). Why GAWK? There are some quick answers that have to do with the pragmatics of undergraduate programming. Then there are more instructive answers that might be valuable to those who debate programming paradigms or to those who study the history of AI languages. And there are some deep philosophical answers that expose the nature of reasoning and symbolic AI. I think the answers, especially the last ones, can be even more surprising than the observed effectiveness of GAWK for AI. First it must be confessed that PERL programmers can cobble together AI projects well, too. Most of GAWK's attractiveness is reproduced in PERL, and the success of PERL forebodes some of the success of GAWK. Both are powerful string-processing languages that allow the programmer to exploit many of the features of a UNIX environment. Both provide powerful constructions for manipulating a wide variety of data in reasonably efficient ways. Both are interpreted, which can reduce development time. Both have short learning curves. The GAWK manual can be consumed in a single lab session and the language can be mastered by the next morning by the average student. GAWK's automatic initialization, implicit coercion, I/O support and lack of pointers forgive many of the mistakes that young programmers are likely to make. Those who have seen C but not mastered it are happy to see that GAWK retains some of the same sensibilities while adding what must be regarded as spoonsful of syntactic sugar. Some will argue that PERL has superior functionality, but for quick AI applications, the additional functionality is rarely missed. In fact, PERL's terse syntax is not friendly when regular expressions begin to proliferate and strings contain fragments of HTML, WWW addresses, or shell commands. PERL provides new ways of doing things, but not necessarily ways of doing new things. In the end, despite minor difference, both PERL and GAWK minimize programmer time. Neither really provides the programmer the setting in which to worry about minimizing run-time. There are further simple answers. Probably the best is the fact that increasingly, undergraduate AI programming is involving the Web. Oren Etzioni (University of Washington, Seattle) has for a while been arguing that the "softbot" is replacing the mechanical engineers' robot as the most glamorous AI testbed. If the artifact whose behavior needs to be controlled in an intelligent way is the software agent, then a language that is well-suited to controlling the software environment is the appropriate language. That would imply a scripting language. If the robot is KAREL, then the right language is "turn left; turn right." If the robot is Netscape, then the right language is something that can generate "netscape -remote 'openURL(http://cs.wustl.edu/~loui)'" with elan. Of course, there are deeper answers. Jon Bentley found two pearls in GAWK: its regular expressions and its associative arrays. GAWK asks the programmer to use the file system for data organization and the operating system for debugging tools and subroutine libraries. There is no issue of user-interface. This forces the programmer to return to the question of what the program does, not how it looks. There is no time spent programming a binsort when the data can be shipped to /bin/sort in no time. (footnote: I am reminded of my IBM colleague Ben Grosof's advice for Palo Alto: Don't worry about whether it's highway 101 or 280. Don't worry if you have to head south for an entrance to go north. Just get on the highway as quickly as possible.) There are some similarities between GAWK and LISP that are illuminating. Both provided a powerful uniform data structure (the associative array implemented as a hash table for GAWK and the S-expression, or list of lists, for LISP). Both were well-supported in their environments (GAWK being a child of UNIX, and LISP being the heart of lisp machines). Both have trivial syntax and find their power in the programmer's willingness to use the simple blocks to build a complex approach. Deeper still, is the nature of AI programming. AI is about functionality and exploratory programming. It is about bottom-up design and the building of ambitions as greater behaviors can be demonstrated. Woe be to the top-down AI programmer who finds that the bottom-level refinements, "this subroutine parses the sentence," cannot actually be implemented. Woe be to the programmer who perfects the data structures for that heapsort when the whole approach to the high-level problem needs to be rethought, and the code is sent to the junkheap the next day. AI programming requires high-level thinking. There have always been a few gifted programmers who can write high-level programs in assembly language. Most however need the ambient abstraction to have a higher floor. Now for the surprising philosophical answers. First, AI has discovered that brute-force combinatorics, as an approach to generating intelligent behavior, does not often provide the solution. Chess, neural nets, and genetic programming show the limits of brute computation. The alternative is clever program organization. (footnote: One might add that the former are the AI approaches that work, but that is easily dismissed: those are the AI approaches that work in general, precisely because cleverness is problem-specific.) So AI programmers always want to maximize the content of their program, not optimize the efficiency of an approach. They want minds, not insects. Instead of enumerating large search spaces, they define ways of reducing search, ways of bringing different knowledge to the task. A language that maximizes what the programmer can attempt rather than one that provides tremendous control over how to attempt it, will be the AI choice in the end. Second, inference is merely the expansion of notation. No matter whether the logic that underlies an AI program is fuzzy, probabilistic, deontic, defeasible, or deductive, the logic merely defines how strings can be transformed into other strings. A language that provides the best support for string processing in the end provides the best support for logic, for the exploration of various logics, and for most forms of symbolic processing that AI might choose to call "reasoning" instead of "logic." The implication is that PROLOG, which saves the AI programmer from having to write a unifier, saves perhaps two dozen lines of GAWK code at the expense of strongly biasing the logic and representational expressiveness of any approach. I view these last two points as news not only to the programming language community, but also to much of the AI community that has not reflected on the past decade's lessons. In the puny language, GAWK, which Aho, Weinberger, and Kernighan thought not much more important than grep or sed, I find lessons in AI's trends, AI's history, and the foundations of AI. What I have found not only surprising but also hopeful, is that when I have approached the AI people who still enjoy programming, some of them are not the least bit surprised. R. Loui (lo...@ai...) is Associate Professor of Computer Science, at Washington University in St. Louis. He has published in AI Journal, Computational Intelligence, ACM SIGART, AI Magazine, AI and Law, the ACM Computing Surveys Symposium on AI, Cognitive Science, Minds and Machines, Journal of Philosophy, and is on this year's program committees for AAAI (National AI conference) and KR (Knowledge Representation and Reasoning). --- NEW FILE: cardfonts --- .\" AWK Reference Card --- Arnold Robbins, ar...@sk... .\" cardfonts --- this file sets the fonts to use for the reference card .\" .\" Copyright (C) 1996 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission .\" notice are preserved on all copies. .\" .\" Permission is granted to process this file through troff 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 reference card). .\" .\" Permission is granted to copy and distribute modified versions of this .\" reference card 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 .\" reference card into another language, under the above conditions for .\" modified versions, except that this permission notice may be stated in .\" a translation approved by the Foundation. .\" .ig Strings for inline font change. FR - font roman FI - font italic FC - font courier .. .ds FR \fR .ds FI \fI .ds FC \f(CB .ds RN Times Roman .ds IN Times Italic .ds CN Courier Bold .ds AM \fIGAWK: Effective AWK Programming\fP --- NEW FILE: lflashlight.eps --- %! %%Creator: arnold@skeeve (Aharon Robbins) %%Title: rflashlight.small.xpic (xpic) %%CreationDate: Tue Dec 12 09:51:27 2000 %%Pages: 1 %%BoundingBox: 0 0 72 28.8 % (in inches) at 0 0, width 1, height 0.4 %%EndComments % Prolog for xpic to PostScript converter % Author: Mark Moraes % $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp % %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH % %s F - change font to fontname % %d S - change size (font size in points) % (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE) % (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE) % (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE) % %d %d l - lineto % %d %d m - moveto % %d %d s - spline segment % x - flush line, spline % <wid> <ht> <x> <y> b - box % <wid> <ht> <x> <y> e - ellipse % %d ss - setscale % %d W - change linewidth % getpagesize - gets the values of PAGEHEIGHT and PAGEWIDTH % %d %d flip - translate by %d, PAGEHEIGHT - %d (this % transforms to X windows coordinates) save 50 dict begin /xpic exch def /StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def % Set defaults /fontname /Times-Roman def /ptsize 12 def % halign has the values for MIDLINE, TOPLINE, BOTLINE /halign 3 array def /s {rcurveto} def /x {stroke} def /l {lineto} def /m {moveto} def /b { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto urx lly lineto urx ury lineto llx ury lineto llx lly lineto stroke } def /mtrx matrix def /e { /yc exch def /xc exch def /yrad exch def /xrad exch def xc xrad add yc moveto /savematrix mtrx currentmatrix def xc yc translate xrad yrad scale 0 0 1 0 360 arc savematrix setmatrix stroke } def % The next three take the text string, and moveto the right horiz. position % leaving the string on the stack. /lj {} def /rj {dup stringwidth pop neg 0 rmoveto} def /ce {dup stringwidth pop 2 div neg 0 rmoveto} def % And this is invoked after one of the three above, and % computes the vert. pos, and then displays the string. /t {halign exch get 0 exch rmoveto show newpath} def % Store an array of patterns in /styles - a pattern is an array consisting % of an array and an offset. Corresp to xpic patterns % solid, dotted, short-dashed, long-dashed, dot-dashed /styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ] 5 array astore def % change style to arg. /D {stroke styles exch get aload pop setdash newpath} def /W {stroke 0.5 mul setlinewidth newpath} def % fontbox takes a fontname off the stack, and returns an array % containing the values of the bottom line of the bounding box, the % mid line of the bounding box, and the top line of the bounding box % of that font, taken from the baseline, scaled to a font of size 1 /fontbox { findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop /ytop exch def pop /ybot exch def pop /ymid ytop ybot sub 2 div def 0 ybot fm dtransform exch pop % botline dup neg exch % midline - this works better than (ytop-ybot)/2! 0 ytop fm dtransform exch pop exch %topline % now in the order midline, topline, botline. 3 array astore } def % select font /F { dup /fontname exch def fontbox /thisfontbox exch def SF } def % set point size /S {/ptsize exch def SF} def % actually set font /SF { fontname findfont ptsize curscale div scalefont setfont thisfontbox aload pop 1 1 3 { pop ptsize mul curscale div neg 3 1 roll } for halign astore pop } def % sets the scale to 72 / n, where n is on the stack, and stores the value % in curscale for font scaling /curscale 1 def /getpagesize{newpath clippath pathbbox /pageheight exch def /pagewidth exch def pop pop newpath} def /flip{pageheight exch sub translate} def /ss {/curscale exch 72 exch div dup dup scale def} def /land {90 rotate} def StartXpic %%EndProlog 80 ss 0.5 W 0 D 80 32 m 64 24 l x 32 24 m 56 32 l x 32 8 m 56 0 l x 8 16 56 16 e 0 24 32 8 b 64 16 m 80 16 l x 64 8 m 80 0 l x %%Trailer showpage % Trailer for xpic to PostScript converter % $Header: /cvsroot/mingw/msys/packages/gawk/3.1.5/doc/lflashlight.eps,v 1.1 2006/08/14 17:32:28 earnie Exp $ xpic end restore --- NEW FILE: macros --- .\" SSC Reference card macros .\" .\" Copyright (C) 1996, Specialized System Consultants Inc. (SSC) .\" .\" These macros are free software; you can redistribute them and/or modify .\" them 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. .\" .\" These macros are 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 .\" .\" Generic SSC "card" macros .\" based on lots of other macros .\" Last update: 4-25-91 ph .\" attempting to get margins in the boxes Aug 3 09:43:48 PDT 1994 .ll 3i \" length of text line .lt 3.2i \" length of title line .de BT \" bottom of page trap .sp |8.2i \" go to where we put footer .ie \\n(CL=1 \{\ . nr CL 2 .tl ''\\*(CD\\n+(PN'' \" footer is just page number . po 4i \" go to second column .TP \" print header if any \} .el \{\ . nr CL 1 .tl ''\\*(CD\\n+(PN'' \" footer is just page number . po .5i \" go to first column . bp \" force a new page (which will force header) . TP \} .. .de TP \" top of page .\" .sp |.2i .sp |0 .\" put page header stuff here .\" for example: .tl ''WOW!'' .\".sp .. .\" .wh 8.1i BT \" set bottom of column trap .nf \" don't fill lines .nh \" no hyphenation .nr CL 1 \" start with column = 1 .po .5i \" offset for first column .vs 9 \" line spacing .ps 8 \" point size .de ST \" set tabs to normal places .ta .2i .78i 1.2i 1.7i \" set tabs .. .ig From: br...@ch... (Bryan Glennon) Box macro. Do a .mk z where the box is to start, and a .eb where it is to end. Optional argument is a title to be centered within the top box line. Usage: .mk z Text, etc to be boxed... .eb "Optional title goes here" ~or~ .mk z Text, etc to be boxed... .eb Some explanation: The macro name is eb <.de eb>. First thing we do is to go up on line <.sp -1> and turn off fill mode <.nf>. Now it gets interesting: the .ie is the if/else construct. We check the number of arguments provided to the macro <\\n(.$> and if it is greater than 0 (meaning we have a title), we do the rest of the .ie line, as follows: \h'-.5n' - move left one-half of an n \L'|\\nzu-1' - draw a vertical line <\L> to the absolute position (|) given by \\nzu-1, which is the position set with the .mk command into register z <\\nz> in base units <u> minus 1. \l'(\\n(.lu+1n-\w'\\$1'u/2u)\(ul' - Draw a horizontal line <\l> with length equal to the current line length <\\n(.l> in base units <u> plus the space required for an 'n' <1n>, minus the width <\w> of the title string <\\$1> in base units <u> divided by 2 <in base units <u>>. Draw the line using the underline character, <\(ul>. \v'.3m'\|\\$1\|\v'-.3m' - Move down the page 3/10 of an m, <\v'.3m'>, output a 1/6 of an m space <\|>, output the title <\\$1>, another 1/6 of an m space <\|>, and then move up the page 3/10 of an m <\v'-.3m'>. \l'...\(ul' - Draw the second part of the line, just like the corresponding left half done before. \L'-|\\nzu+1' - Draw a verticle line <\L> going down the absolute distance <-|> from where the macro was given to where the start point was marked <\\nz> in base units <u> plus one line <+1> \l'|0u-.5n\(ul' - Draw a horizontal line to the absolute position (|0) when the macro was invoked, minus half an n <-.5n> using the underline character <\(ul>. The .el beings the else part, which is identical to the above, except the string dosen't get printed. This makes the printing of the top line much easier: just draw a line <\l> with width equal to the current line plus the witdh of an n <\\n(.l+1n> using the underline character <.\(ul>. .. .de ES \" start "text in a box" .mk z .in +.5n .ll -.5n .sp 1.3 .. .de EB \" end "text in a box" -- optional box title as argument .sp -.6 .nf .in -.5n .ll +.5n .ie \\n(.$\ \L'|\\nzu'\ \l'(\\n(.lu-\w'\\$1'u)/2u-.33m\(ul'\ \v'.3m'\|\\$1\|\v'-.3m'\ \l'(\\n(.lu-\w'\\$1'u)/2u\(ul'\ \L'-|\\nzu'\ \l'|0u\(ul' .el \h'-.5n'\L'|\\nzu-1'\l'\\n(.lu+1n\(ul'\L'-|\\nzu+1'\l'|0u-.5n\(ul' .in 0 .. .de SL \" draw single line (works in non-fill mode only) .sp -.8 .ti 0 \l'\\n(.lu\(ul' .. .de Hl \" draw horizontal line .br .ti 0 \l'\\n(.lu-\\n(.iu' .br .. .de DL \" draw double line (works in non-fill mode only) .sp -.8 .ti 0 \l'\\n(.lu\(ul' .sp -.8 .ti 0 \l'\\n(.lu\(ul' .. .ST .nr PN 0 1 \" sets starting page number and auto-increment .\" must define page header (if any) before here .TP .ds 3) \|\v'3p'\s+5\z\(sq\s0\v'-3p'\h'1.25p'\v'-.5p'3\v'.5p'\h'2p' .\" old one .ds 2) \h'-1.5p'\v'1p'\s+4\z\(ci\s0\v'-1p'\h'3.25p'2 .ds 2) \|\v'-2.4p'\D'c.095id'\h'-5.15p'\v'2.4p'2\h'1.9p' .ds dC \v'1p'\s+5\(bu\s0\v'-1p'\" for development commands .ds tC \s+2\(dm\s0\" (for DWB) should be a triangle .ds tP \s+2\(dm\s0\" (for other text processing) should be a triangle .\" various trademark symbols .ds Tm \v'-0.5m'\s8TM\s0\v'0.5m' .ds Ts \v'-0.5m'\s4TM\s0\v'0.5m' .ig ++ .\" mount Serifa fonts .fp 5 SR .fp 6 SB .fp 4 Si .++ .\" other assorted junk .lg 0 .\" Fl requires extended version of troff .de Fl \" draw fat horizontal line .br .ti 0 .ruw 1.5p \l'\\n(.lu-\\n(.iu' .br .ruw .. .de Bx \" box for keys in text \\$3\&\|\&\c \s-3\(br\|\fH\v'.18n'\\$1\v'-.18n\fP\|\(br\l'|0\(rn'\l'|0\(ul'\&\s0\|\\$2 .. .de Fn \" function name - left justified, gray background .\" bold with gray for function name .ns .br \ .ns .br \!! gsave ( ) stringwidth neg 0 rmoveto \!! /Serifa-Bold findfont 8 scalefont setfont \!! (\\$1) dup stringwidth pop 6 gsave dup 0 exch rlineto neg exch 0 rlineto \!! 0 exch rlineto closepath .9 setgray fill grestore show \!! grestore .nf .rs .. .rs --- NEW FILE: rflashlight.eps --- %! %%Creator: arnold@skeeve (Aharon Robbins) %%Title: flashlight.small.xpic (xpic) %%CreationDate: Tue Oct 24 14:41:28 2000 %%Pages: 1 %%BoundingBox: 0 0 72 28.8 % (in inches) at 0 0, width 1, height 0.4 %%EndComments % Prolog for xpic to PostScript converter % Author: Mark Moraes % $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp % %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH % %s F - change font to fontname % %d S - change size (font size in points) % (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE) % (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE) % (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE) % %d %d l - lineto % %d %d m - moveto % %d %d s - spline segment % x - flush line, spline % <wid> <ht> <x> <y> b - box % <wid> <ht> <x> <y> e - ellipse % %d ss - setscale % %d W - change linewidth % getpagesize - gets the values of PAGEHEIGHT and PAGEWIDTH % %d %d flip - translate by %d, PAGEHEIGHT - %d (this % transforms to X windows coordinates) save 50 dict begin /xpic exch def /StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def % Set defaults /fontname /Times-Roman def /ptsize 12 def % halign has the values for MIDLINE, TOPLINE, BOTLINE /halign 3 array def /s {rcurveto} def /x {stroke} def /l {lineto} def /m {moveto} def /b { /ury exch def /urx exch def /lly exch def /llx exch def llx lly moveto urx lly lineto urx ury lineto llx ury lineto llx lly lineto stroke } def /mtrx matrix def /e { /yc exch def /xc exch def /yrad exch def /xrad exch def xc xrad add yc moveto /savematrix mtrx currentmatrix def xc yc translate xrad yrad scale 0 0 1 0 360 arc savematrix setmatrix stroke } def % The next three take the text string, and moveto the right horiz. position % leaving the string on the stack. /lj {} def /rj {dup stringwidth pop neg 0 rmoveto} def /ce {dup stringwidth pop 2 div neg 0 rmoveto} def % And this is invoked after one of the three above, and % computes the vert. pos, and then displays the string. /t {halign exch get 0 exch rmoveto show newpath} def % Store an array of patterns in /styles - a pattern is an array consisting % of an array and an offset. Corresp to xpic patterns % solid, dotted, short-dashed, long-dashed, dot-dashed /styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ] 5 array astore def % change style to arg. /D {stroke styles exch get aload pop setdash newpath} def /W {stroke 0.5 mul setlinewidth newpath} def % fontbox takes a fontname off the stack, and returns an array % containing the values of the bottom line of the bounding box, the % mid line of the bounding box, and the top line of the bounding box % of that font, taken from the baseline, scaled to a font of size 1 /fontbox { findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop /ytop exch def pop /ybot exch def pop /ymid ytop ybot sub 2 div def 0 ybot fm dtransform exch pop % botline dup neg exch % midline - this works better than (ytop-ybot)/2! 0 ytop fm dtransform exch pop exch %topline % now in the order midline, topline, botline. 3 array astore } def % select font /F { dup /fontname exch def fontbox /thisfontbox exch def SF } def % set point size /S {/ptsize exch def SF} def % actually set font /SF { fontname findfont ptsize curscale div scalefont setfont thisfontbox aload pop 1 1 3 { pop ptsize mul curscale div neg 3 1 roll } for halign astore pop } def % sets the scale to 72 / n, where n is on the stack, and stores the value % in curscale for font scaling /curscale 1 def /getpagesize{newpath clippath pathbbox /pageheight exch def /pagewidth exch def pop pop newpath} def /flip{pageheight exch sub translate} def /ss {/curscale exch 72 exch div dup dup scale def} def /land {90 rotate} def StartXpic %%EndProlog 80 ss 0.5 W 0 D 8 16 24 16 e 24 32 m 48 24 l x 24 0 m 48 8 l x 48 24 m 0 0 0 -5.33333 0 -16 s x 48 24 80 8 b 0 8 m 0 8 l x 0 0 m 16 8 l x 0 16 m 16 16 l x 16 24 m 0 32 l x %%Trailer showpage % Trailer for xpic to PostScript converter % $Header: /cvsroot/mingw/msys/packages/gawk/3.1.5/doc/rflashlight.eps,v 1.1 2006/08/14 17:32:28 earnie Exp $ xpic end restore --- NEW FILE: gawk.texi --- \input texinfo @c -*-texinfo-*- @c %**start of header (This is for running Texinfo on a region.) @setfilename gawk.info @settitle The GNU Awk User's Guide @c %**end of header (This is for running Texinfo on a region.) @dircategory Text creation and manipulation @direntry * Gawk: (gawk). A text scanning and processing language. @end direntry @dircategory Individual utilities @direntry * awk: (gawk)Invoking gawk. Text scanning and processing. @end direntry @set xref-automatic-section-title @c The following information should be updated here only! @c This sets the edition of the document, the version of gawk it [...28591 lines suppressed...] % - Truth Values and Conditions % + True and False in Awk % + Boolean Expressions % + Conditional Expressions % - Function Calls % - Operator Precedence % %Chapter 7: % - Array Basics % + Introduction to Arrays % + Referring to an Array Element % + Assigning Array Elements % + Basic Array Example % + Scanning All Elements of an Array % - The delete Statement % - Using Numbers to Subscript Arrays % - Using Uninitialized Variables as Subscripts % - Multidimensional Arrays % + Scanning Multidimensional Arrays % - Sorting Array Values and Indices with gawk --- NEW FILE: README.card --- Mon Dec 9 12:45:48 EST 1996 The AWK reference card included here requires a modern version of troff (ditroff). GNU Troff (groff) is known to work. If your troff is able to produce Postscript but does not know how to properly use the macros from `colors' file then try to uncomment in Makefile the defintion which sets AWKCARD to awkcard.nc (no colors). This will definitely require changes to the TROFF macro and you have to ensure that the tbl preprocessor is called. For example, the following modifications on NeXT: TROFF = tbl SEDME = ptroff -t | sed -e \ "s/^level0 restore/level0 restore flashme 100 72 moveto\ (Copyright `date`, FSF, Inc. (all)) show/" \ -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/" will produce a correctly formatted, albeit monochromatic, reference card. --- NEW FILE: setter.outline --- %!PS-Adobe-3.0 % SSC Reference card typesetter outline / cut marks % % Copyright (C) 1996, Specialized System Consultants Inc. (SSC) % % 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 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, write to the Free Software % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA % %! page cut marks and stuff for Pocket References - 10-26-88 - ph %! modified to move the cut marks onto the page %! center a string /inch {72 mul} def /cshow % stk: string % center string in space (space us variable) { dup stringwidth pop % get length of string space exch sub 2 div % compute initial space needed 0 rmoveto % move over show } def /flashme { /space 612 def 0 0 0 setrgbcolor % always print this stuff /Helvetica findfont 12 scalefont setfont gsave % for groff (I hope) -6 -6 translate 0.2 setlinewidth 0.25 inch 10.5 inch moveto 0.5 inch 10.5 inch lineto .75 inch 10.75 inch moveto .75 inch 11 inch lineto stroke 0.25 inch 2 inch moveto 0.5 inch 2 inch lineto .75 inch 1.75 inch moveto .75 inch 1.50 inch lineto stroke 4.25 inch 11 inch moveto 4.25 inch 10.75 inch lineto stroke 4.25 inch 1.75 inch moveto 4.25 inch 1.5 inch lineto stroke 7.75 inch 1.5 inch moveto 7.75 inch 1.75 inch lineto 8 inch 2 inch moveto 8.25 inch 2 inch lineto stroke 7.75 inch 11 inch moveto 7.75 inch 10.75 inch lineto 8 inch 10.5 inch moveto 8.25 inch 10.5 inch lineto stroke grestore } def % actually do something --- NEW FILE: texinfo.tex --- % 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{2005-01-30.17} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 2, 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 [...7047 lines suppressed...] % 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 --- NEW FILE: gawkinet.info --- This is gawkinet.info, produced by makeinfo version 4.6 from gawkinet.texi. INFO-DIR-SECTION Network applications START-INFO-DIR-ENTRY * Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'. END-INFO-DIR-ENTRY This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the 3.1.4 (or later) version of the GNU implementation of AWK. Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being "GNU General Public License", the Front-Cover [...4388 lines suppressed...] Node: Caveats78073 Node: Challenges79213 Node: Some Applications and Techniques87874 Node: PANIC90322 Node: GETURL92034 Node: REMCONF94650 Node: URLCHK100114 Node: WEBGRAB103937 Node: STATIST108367 Ref: STATIST-Footnote-1120029 Node: MAZE120471 Node: MOBAGWHO126646 Ref: MOBAGWHO-Footnote-1140547 Node: STOXPRED140599 Node: PROTBASE154809 Node: Links167844 Node: GNU Free Documentation License171278 Node: Index193671 End Tag Table --- NEW FILE: gawkinet.texi --- \input texinfo @c -*-texinfo-*- @c %**start of header (This is for running Texinfo on a region.) @setfilename gawkinet.info @settitle TCP/IP Internetworking With @command{gawk} @c %**end of header (This i... [truncated message content] |
|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:30
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/awklib/eg/prog In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/awklib/eg/prog Added Files: alarm.awk awksed.awk cut.awk dupword.awk egrep.awk extract.awk guide.awk histsort.awk id.awk igawk.sh labels.awk split.awk tee.awk testbits.awk translate.awk uniq.awk wc.awk wordfreq.awk Log Message: Update package --- NEW FILE: id.awk --- # id.awk --- implement id in awk # # Requires user and group library functions # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # Revised February 1996 # output is: # uid=12(foo) euid=34(bar) gid=3(baz) \ # egid=5(blat) groups=9(nine),2(two),1(one) BEGIN \ { uid = PROCINFO["uid"] euid = PROCINFO["euid"] gid = PROCINFO["gid"] egid = PROCINFO["egid"] printf("uid=%d", uid) pw = getpwuid(uid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } if (euid != uid) { printf(" euid=%d", euid) pw = getpwuid(euid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } } printf(" gid=%d", gid) pw = getgrgid(gid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } if (egid != gid) { printf(" egid=%d", egid) pw = getgrgid(egid) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } } for (i = 1; ("group" i) in PROCINFO; i++) { if (i == 1) printf(" groups=") group = PROCINFO["group" i] printf("%d", group) pw = getgrgid(group) if (pw != "") { split(pw, a, ":") printf("(%s)", a[1]) } if (("group" (i+1)) in PROCINFO) printf(",") } print "" } --- NEW FILE: translate.awk --- # translate.awk --- do tr-like stuff # # Arnold Robbins, ar...@gn..., Public Domain # August 1989 # Bugs: does not handle things like: tr A-Z a-z, it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. function stranslate(from, to, target, lf, lt, t_ar, i, c) { lf = length(from) lt = length(to) for (i = 1; i <= lt; i++) t_ar[substr(from, i, 1)] = substr(to, i, 1) if (lt < lf) for (; i <= lf; i++) t_ar[substr(from, i, 1)] = substr(to, lt, 1) for (i = 1; i <= lf; i++) { c = substr(from, i, 1) if (index(target, c) > 0) gsub(c, t_ar[c], target) } return target } function translate(from, to) { return $0 = stranslate(from, to, $0) } # main program BEGIN { if (ARGC < 3) { print "usage: translate from to" > "/dev/stderr" exit } FROM = ARGV[1] TO = ARGV[2] ARGC = 2 ARGV[1] = "-" } { translate(FROM, TO) print } --- NEW FILE: awksed.awk --- # awksed.awk --- do s/foo/bar/g using just print # Thanks to Michael Brennan for the idea # # Arnold Robbins, ar...@gn..., Public Domain # August 1995 function usage() { print "usage: awksed pat repl [files...]" > "/dev/stderr" exit 1 } BEGIN { # validate arguments if (ARGC < 3) usage() RS = ARGV[1] ORS = ARGV[2] # don't use arguments as files ARGV[1] = ARGV[2] = "" } # look ma, no hands! { if (RT == "") printf "%s", $0 else print } --- NEW FILE: wordfreq.awk --- # wordfreq.awk --- print list of word frequencies { $0 = tolower($0) # remove case distinctions # remove punctuation gsub(/[^[:alnum:]_[:blank:]]/, "", $0) for (i = 1; i <= NF; i++) freq[$i]++ } END { for (word in freq) printf "%s\t%d\n", word, freq[word] } END { sort = "sort -k 2nr" for (word in freq) printf "%s\t%d\n", word, freq[word] | sort close(sort) } --- NEW FILE: guide.awk --- BEGIN { TEXTDOMAIN = "guide" bindtextdomain(".") # for testing print _"Don't Panic" print _"The Answer Is", 42 print "Pardon me, Zaphod who?" } --- NEW FILE: extract.awk --- # extract.awk --- extract files and run programs # from texinfo files # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # Revised September 2000 BEGIN { IGNORECASE = 1 } /^@c(omment)?[ \t]+system/ \ { if (NF < 3) { e = (FILENAME ":" FNR) e = (e ": badly formed `system' line") print e > "/dev/stderr" next } $1 = "" $2 = "" stat = system($0) if (stat != 0) { e = (FILENAME ":" FNR) e = (e ": warning: system returned " stat) print e > "/dev/stderr" } } /^@c(omment)?[ \t]+file/ \ { if (NF != 3) { e = (FILENAME ":" FNR ": badly formed `file' line") print e > "/dev/stderr" next } if ($3 != curfile) { if (curfile != "") close(curfile) curfile = $3 } for (;;) { if ((getline line) <= 0) unexpected_eof() if (line ~ /^@c(omment)?[ \t]+endfile/) break else if (line ~ /^@(end[ \t]+)?group/) continue else if (line ~ /^@c(omment+)?[ \t]+/) continue if (index(line, "@") == 0) { print line > curfile continue } n = split(line, a, "@") # if a[1] == "", means leading @, # don't add one back in. for (i = 2; i <= n; i++) { if (a[i] == "") { # was an @@ a[i] = "@" if (a[i+1] == "") i++ } } print join(a, 1, n, SUBSEP) > curfile } } function unexpected_eof() { printf("%s:%d: unexpected EOF or error\n", FILENAME, FNR) > "/dev/stderr" exit 1 } END { if (curfile) close(curfile) } --- NEW FILE: labels.awk --- # labels.awk --- print mailing labels # # Arnold Robbins, ar...@gn..., Public Domain # June 1992 # Each label is 5 lines of data that may have blank lines. # The label sheets have 2 blank lines at the top and 2 at # the bottom. BEGIN { RS = "" ; MAXLINES = 100 } function printpage( i, j) { if (Nlines <= 0) return printf "\n\n" # header for (i = 1; i <= Nlines; i += 10) { if (i == 21 || i == 61) print "" for (j = 0; j < 5; j++) { if (i + j > MAXLINES) break printf " %-41s %s\n", line[i+j], line[i+j+5] } print "" } printf "\n\n" # footer for (i in line) line[i] = "" } # main rule { if (Count >= 20) { printpage() Count = 0 Nlines = 0 } n = split($0, a, "\n") for (i = 1; i <= n; i++) line[++Nlines] = a[i] for (; i <= 5; i++) line[++Nlines] = "" Count++ } END \ { printpage() } --- NEW FILE: igawk.sh --- #! /bin/sh # igawk --- like gawk but do @include processing # # Arnold Robbins, ar...@gn..., Public Domain # July 1993 if [ "$1" = debug ] then set -x shift fi # A literal newline, so that program text is formmatted correctly n=' ' # Initialize variables to empty program= opts= while [ $# -ne 0 ] # loop over arguments do case $1 in --) shift; break;; -W) shift # The ${x?'message here'} construct prints a # diagnostic if $x is the null string set -- -W"${@?'missing operand'}" continue;; -[vF]) opts="$opts $1 '${2?'missing operand'}'" shift;; -[vF]*) opts="$opts '$1'" ;; -f) program="$program$n@include ${2?'missing operand'}" shift;; -f*) f=`expr "$1" : '-f\(.*\)'` program="$program$n@include $f";; -[W-]file=*) f=`expr "$1" : '-.file=\(.*\)'` program="$program$n@include $f";; -[W-]file) program="$program$n@include ${2?'missing operand'}" shift;; -[W-]source=*) t=`expr "$1" : '-.source=\(.*\)'` program="$program$n$t";; -[W-]source) program="$program$n${2?'missing operand'}" shift;; -[W-]version) echo igawk: version 2.0 1>&2 gawk --version exit 0 ;; -[W-]*) opts="$opts '$1'" ;; *) break;; esac shift done if [ -z "$program" ] then program=${1?'missing program'} shift fi # At this point, `program' has the program. expand_prog=' function pathto(file, i, t, junk) { if (index(file, "/") != 0) return file for (i = 1; i <= ndirs; i++) { t = (pathlist[i] "/" file) if ((getline junk < t) > 0) { # found it close(t) return t } } return "" } BEGIN { path = ENVIRON["AWKPATH"] ndirs = split(path, pathlist, ":") for (i = 1; i <= ndirs; i++) { if (pathlist[i] == "") pathlist[i] = "." } stackptr = 0 input[stackptr] = ARGV[1] # ARGV[1] is first file for (; stackptr >= 0; stackptr--) { while ((getline < input[stackptr]) > 0) { if (tolower($1) != "@include") { print continue } fpath = pathto($2) if (fpath == "") { printf("igawk:%s:%d: cannot find %s\n", input[stackptr], FNR, $2) > "/dev/stderr" continue } if (! (fpath in processed)) { processed[fpath] = input[stackptr] input[++stackptr] = fpath # push onto stack } else print $2, "included in", input[stackptr], "already included in", processed[fpath] > "/dev/stderr" } close(input[stackptr]) } }' # close quote ends `expand_prog' variable processed_program=`gawk -- "$expand_prog" /dev/stdin <<EOF $program EOF ` eval gawk $opts -- '"$processed_program"' '"$@"' --- NEW FILE: cut.awk --- # cut.awk --- implement cut in awk # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # Options: # -f list Cut fields # -d c Field delimiter character # -c list Cut characters # # -s Suppress lines without the delimiter # # Requires getopt and join library functions function usage( e1, e2) { e1 = "usage: cut [-f list] [-d c] [-s] [files...]" e2 = "usage: cut [-c list] [files...]" print e1 > "/dev/stderr" print e2 > "/dev/stderr" exit 1 } BEGIN \ { FS = "\t" # default OFS = FS while ((c = getopt(ARGC, ARGV, "sf:c:d:")) != -1) { if (c == "f") { by_fields = 1 fieldlist = Optarg } else if (c == "c") { by_chars = 1 fieldlist = Optarg OFS = "" } else if (c == "d") { if (length(Optarg) > 1) { printf("Using first character of %s" \ " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) } FS = Optarg OFS = FS if (FS == " ") # defeat awk semantics FS = "[ ]" } else if (c == "s") suppress++ else usage() } for (i = 1; i < Optind; i++) ARGV[i] = "" if (by_fields && by_chars) usage() if (by_fields == 0 && by_chars == 0) by_fields = 1 # default if (fieldlist == "") { print "cut: needs list for -c or -f" > "/dev/stderr" exit 1 } if (by_fields) set_fieldlist() else set_charlist() } function set_fieldlist( n, m, i, j, k, f, g) { n = split(fieldlist, f, ",") j = 1 # index in flist for (i = 1; i <= n; i++) { if (index(f[i], "-") != 0) { # a range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) { printf("bad field list: %s\n", f[i]) > "/dev/stderr" exit 1 } for (k = g[1]; k <= g[2]; k++) flist[j++] = k } else flist[j++] = f[i] } nfields = j - 1 } function set_charlist( field, i, j, f, g, t, filler, last, len) { field = 1 # count total fields n = split(fieldlist, f, ",") j = 1 # index in flist for (i = 1; i <= n; i++) { if (index(f[i], "-") != 0) { # range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) { printf("bad character list: %s\n", f[i]) > "/dev/stderr" exit 1 } len = g[2] - g[1] + 1 if (g[1] > 1) # compute length of filler filler = g[1] - last - 1 else filler = 0 if (filler) t[field++] = filler t[field++] = len # length of field last = g[2] flist[j++] = field - 1 } else { if (f[i] > 1) filler = f[i] - last - 1 else filler = 0 if (filler) t[field++] = filler t[field++] = 1 last = f[i] flist[j++] = field - 1 } } FIELDWIDTHS = join(t, 1, field - 1) nfields = j - 1 } { if (by_fields && suppress && index($0, FS) != 0) next for (i = 1; i <= nfields; i++) { if ($flist[i] != "") { printf "%s", $flist[i] if (i < nfields && $flist[i+1] != "") printf "%s", OFS } } print "" } --- NEW FILE: egrep.awk --- # egrep.awk --- simulate egrep in awk # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # Options: # -c count of lines # -s silent - use exit value # -v invert test, success if no match # -i ignore case # -l print filenames only # -e argument is pattern # # Requires getopt and file transition library functions BEGIN { while ((c = getopt(ARGC, ARGV, "ce:svil")) != -1) { if (c == "c") count_only++ else if (c == "s") no_print++ else if (c == "v") invert++ else if (c == "i") IGNORECASE = 1 else if (c == "l") filenames_only++ else if (c == "e") pattern = Optarg else usage() } if (pattern == "") pattern = ARGV[Optind++] for (i = 1; i < Optind; i++) ARGV[i] = "" if (Optind >= ARGC) { ARGV[1] = "-" ARGC = 2 } else if (ARGC - Optind > 1) do_filenames++ # if (IGNORECASE) # pattern = tolower(pattern) } #{ # if (IGNORECASE) # $0 = tolower($0) #} function beginfile(junk) { fcount = 0 } function endfile(file) { if (! no_print && count_only) if (do_filenames) print file ":" fcount else print fcount total += fcount } { matches = ($0 ~ pattern) if (invert) matches = ! matches fcount += matches # 1 or 0 if (! matches) next if (! count_only) { if (no_print) nextfile if (filenames_only) { print FILENAME nextfile } if (do_filenames) print FILENAME ":" $0 else print } } END \ { if (total == 0) exit 1 exit 0 } function usage( e) { e = "Usage: egrep [-csvil] [-e pat] [files ...]" e = e "\n\tegrep [-csvil] pat [files ...]" print e > "/dev/stderr" exit 1 } --- NEW FILE: split.awk --- # split.awk --- do split in awk # # Requires ord and chr library functions # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # usage: split [-num] [file] [outname] BEGIN { outfile = "x" # default count = 1000 if (ARGC > 4) usage() i = 1 if (ARGV[i] ~ /^-[0-9]+$/) { count = -ARGV[i] ARGV[i] = "" i++ } # test argv in case reading from stdin instead of file if (i in ARGV) i++ # skip data file name if (i in ARGV) { outfile = ARGV[i] ARGV[i] = "" } s1 = s2 = "a" out = (outfile s1 s2) } { if (++tcount > count) { close(out) if (s2 == "z") { if (s1 == "z") { printf("split: %s is too large to split\n", FILENAME) > "/dev/stderr" exit 1 } s1 = chr(ord(s1) + 1) s2 = "a" } else s2 = chr(ord(s2) + 1) out = (outfile s1 s2) tcount = 1 } print > out } function usage( e) { e = "usage: split [-num] [file] [outname]" print e > "/dev/stderr" exit 1 } --- NEW FILE: wc.awk --- # wc.awk --- count lines, words, characters # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # Options: # -l only count lines # -w only count words # -c only count characters # # Default is to count lines, words, characters # # Requires getopt and file transition library functions BEGIN { # let getopt print a message about # invalid options. we ignore them while ((c = getopt(ARGC, ARGV, "lwc")) != -1) { if (c == "l") do_lines = 1 else if (c == "w") do_words = 1 else if (c == "c") do_chars = 1 } for (i = 1; i < Optind; i++) ARGV[i] = "" # if no options, do all if (! do_lines && ! do_words && ! do_chars) do_lines = do_words = do_chars = 1 print_total = (ARGC - i > 2) } function beginfile(file) { chars = lines = words = 0 fname = FILENAME } function endfile(file) { tchars += chars tlines += lines twords += words if (do_lines) printf "\t%d", lines if (do_words) printf "\t%d", words if (do_chars) printf "\t%d", chars printf "\t%s\n", fname } # do per line { chars += length($0) + 1 # get newline lines++ words += NF } END { if (print_total) { if (do_lines) printf "\t%d", tlines if (do_words) printf "\t%d", twords if (do_chars) printf "\t%d", tchars print "\ttotal" } } --- NEW FILE: dupword.awk --- # dupword.awk --- find duplicate words in text # # Arnold Robbins, ar...@gn..., Public Domain # December 1991 # Revised October 2000 { $0 = tolower($0) gsub(/[^[:alnum:][:blank:]]/, " "); $0 = $0 # re-split if (NF == 0) next if ($1 == prev) printf("%s:%d: duplicate %s\n", FILENAME, FNR, $1) for (i = 2; i <= NF; i++) if ($i == $(i-1)) printf("%s:%d: duplicate %s\n", FILENAME, FNR, $i) prev = $NF } --- NEW FILE: testbits.awk --- # bits2str --- turn a byte into readable 1's and 0's function bits2str(bits, data, mask) { if (bits == 0) return "0" mask = 1 for (; bits != 0; bits = rshift(bits, 1)) data = (and(bits, mask) ? "1" : "0") data while ((length(data) % 8) != 0) data = "0" data return data } BEGIN { printf "123 = %s\n", bits2str(123) printf "0123 = %s\n", bits2str(0123) printf "0x99 = %s\n", bits2str(0x99) comp = compl(0x99) printf "compl(0x99) = %#x = %s\n", comp, bits2str(comp) shift = lshift(0x99, 2) printf "lshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift) shift = rshift(0x99, 2) printf "rshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift) } --- NEW FILE: alarm.awk --- # alarm.awk --- set an alarm # # Requires gettimeofday library function # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # usage: alarm time [ "message" [ count [ delay ] ] ] BEGIN \ { # Initial argument sanity checking usage1 = "usage: alarm time ['message' [count [delay]]]" usage2 = sprintf("\t(%s) time ::= hh:mm", ARGV[1]) if (ARGC < 2) { print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 } else if (ARGC == 5) { delay = ARGV[4] + 0 count = ARGV[3] + 0 message = ARGV[2] } else if (ARGC == 4) { count = ARGV[3] + 0 message = ARGV[2] } else if (ARGC == 3) { message = ARGV[2] } else if (ARGV[1] !~ /[0-9]?[0-9]:[0-9][0-9]/) { print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 } # set defaults for once we reach the desired time if (delay == 0) delay = 180 # 3 minutes if (count == 0) count = 5 if (message == "") message = sprintf("\aIt is now %s!\a", ARGV[1]) else if (index(message, "\a") == 0) message = "\a" message "\a" # split up alarm time split(ARGV[1], atime, ":") hour = atime[1] + 0 # force numeric minute = atime[2] + 0 # force numeric # get current broken down time gettimeofday(now) # if time given is 12-hour hours and it's after that # hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m., # then add 12 to real hour if (hour < 12 && now["hour"] > hour) hour += 12 # set target time in seconds since midnight target = (hour * 60 * 60) + (minute * 60) # get current time in seconds since midnight current = (now["hour"] * 60 * 60) + \ (now["minute"] * 60) + now["second"] # how long to sleep for naptime = target - current if (naptime <= 0) { print "time is in the past!" > "/dev/stderr" exit 1 } # zzzzzz..... go away if interrupted if (system(sprintf("sleep %d", naptime)) != 0) exit 1 # time to notify! command = sprintf("sleep %d", delay) for (i = 1; i <= count; i++) { print message # if sleep command interrupted, go away if (system(command) != 0) break } exit 0 } --- NEW FILE: tee.awk --- # tee.awk --- tee in awk # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 # Revised December 1995 BEGIN \ { for (i = 1; i < ARGC; i++) copy[i] = ARGV[i] if (ARGV[1] == "-a") { append = 1 delete ARGV[1] delete copy[1] ARGC-- } if (ARGC < 2) { print "usage: tee [-a] file ..." > "/dev/stderr" exit 1 } ARGV[1] = "-" ARGC = 2 } { # moving the if outside the loop makes it run faster if (append) for (i in copy) print >> copy[i] else for (i in copy) print > copy[i] print } END \ { for (i in copy) close(copy[i]) } --- NEW FILE: histsort.awk --- # histsort.awk --- compact a shell history file # Thanks to Byron Rakitzis for the general idea # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 { if (data[$0]++ == 0) lines[++count] = $0 } END { for (i = 1; i <= count; i++) print lines[i] } --- NEW FILE: uniq.awk --- # uniq.awk --- do uniq in awk # # Requires getopt and join library functions # # Arnold Robbins, ar...@gn..., Public Domain # May 1993 function usage( e) { e = "Usage: uniq [-udc [-n]] [+n] [ in [ out ]]" print e > "/dev/stderr" exit 1 } # -c count lines. overrides -d and -u # -d only repeated lines # -u only non-repeated lines # -n skip n fields # +n skip n characters, skip fields first BEGIN \ { count = 1 outputfile = "/dev/stdout" opts = "udc0:1:2:3:4:5:6:7:8:9:" while ((c = getopt(ARGC, ARGV, opts)) != -1) { if (c == "u") non_repeated_only++ else if (c == "d") repeated_only++ else if (c == "c") do_count++ else if (index("0123456789", c) != 0) { # getopt requires args to options # this messes us up for things like -5 if (Optarg ~ /^[0-9]+$/) fcount = (c Optarg) + 0 else { fcount = c + 0 Optind-- } } else usage() } if (ARGV[Optind] ~ /^\+[0-9]+$/) { charcount = substr(ARGV[Optind], 2) + 0 Optind++ } for (i = 1; i < Optind; i++) ARGV[i] = "" if (repeated_only == 0 && non_repeated_only == 0) repeated_only = non_repeated_only = 1 if (ARGC - Optind == 2) { outputfile = ARGV[ARGC - 1] ARGV[ARGC - 1] = "" } } function are_equal( n, m, clast, cline, alast, aline) { if (fcount == 0 && charcount == 0) return (last == $0) if (fcount > 0) { n = split(last, alast) m = split($0, aline) clast = join(alast, fcount+1, n) cline = join(aline, fcount+1, m) } else { clast = last cline = $0 } if (charcount) { clast = substr(clast, charcount + 1) cline = substr(cline, charcount + 1) } return (clast == cline) } NR == 1 { last = $0 next } { equal = are_equal() if (do_count) { # overrides -d and -u if (equal) count++ else { printf("%4d %s\n", count, last) > outputfile last = $0 count = 1 # reset } next } if (equal) count++ else { if ((repeated_only && count > 1) || (non_repeated_only && count == 1)) print last > outputfile last = $0 count = 1 } } END { if (do_count) printf("%4d %s\n", count, last) > outputfile else if ((repeated_only && count > 1) || (non_repeated_only && count == 1)) print last > outputfile } |