mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-29 20:04:57 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94bb9d5814 |
No files matched your search
@@ -1,286 +0,0 @@
|
||||
# Makefile for GNU Awk.
|
||||
#
|
||||
# Copyright (C) 1986, 1988-2000 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
CC = @CC@
|
||||
YACC = @YACC@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
|
||||
ALLOCA = @ALLOCA@
|
||||
|
||||
LN = ln
|
||||
LN_S = @LN_S@
|
||||
|
||||
exec_prefix = @exec_prefix@
|
||||
prefix = @prefix@
|
||||
binprefix =
|
||||
manprefix =
|
||||
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
manexta = 1
|
||||
mandir = @mandir@/man$(manexta)
|
||||
manext = .$(manexta)
|
||||
infodir = @infodir@
|
||||
datadir = @datadir@/awk
|
||||
libexecdir = @libexecdir@/awk
|
||||
|
||||
DEFPATH = ".:$(datadir)"
|
||||
|
||||
SHELL = /bin/sh
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPFLAGS = -DGAWK -I. -I$(srcdir) $(CPPFLAGS) @DEFS@ $(CFLAGS)
|
||||
|
||||
# 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= 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 doc/all
|
||||
|
||||
# stuff to make sure that configure has been run.
|
||||
$(srcdir)/configure: configure.in aclocal.m4
|
||||
cd $(srcdir) && autoconf
|
||||
|
||||
# autoheader might not change confh.in, so touch a stamp file
|
||||
$(srcdir)/configh.in: stamp-h.in
|
||||
$(srcdir)/stamp-h.in: configure.in aclocal.m4 acconfig.h
|
||||
cd $(srcdir) && autoheader
|
||||
date > $(srcdir)/stamp-h.in
|
||||
|
||||
config.h: stamp-h
|
||||
stamp-h: configh.in config.status
|
||||
$(SHELL) ./config.status
|
||||
|
||||
Makefile: $(MAKEFILEIN) config.status
|
||||
$(SHELL) ./config.status
|
||||
|
||||
config.status: configure
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
# Note: if you need something at both compile time and link time, like -pg,
|
||||
# you will have to edit the Makefile manually to set LDFLAGS.
|
||||
gawk: $(ALLOBJS) $(LIBOBJS) $(REOBJS)
|
||||
$(CC) -o gawk $(CFLAGS) $(LDFLAGS) $(ALLOBJS) $(LIBOBJS) $(REOBJS) $(LIBS)
|
||||
|
||||
$(ALLOBJS): awk.h dfa.h regex.h config.h custom.h
|
||||
|
||||
$(LIBOBJS): config.h custom.h
|
||||
|
||||
# SunOS make's (at least) VPATH doesn't do subdirectories...
|
||||
# Solaris make doesn't allow $< in the actual rule
|
||||
gawkmisc.o: $(srcdir)/atari/gawkmisc.atr \
|
||||
$(srcdir)/pc/gawkmisc.pc $(srcdir)/posix/gawkmisc.c \
|
||||
$(srcdir)/vms/gawkmisc.vms
|
||||
$(CC) -c $(COMPFLAGS) -DDEFPATH='$(DEFPATH)' $(srcdir)/gawkmisc.c
|
||||
|
||||
getopt.o: getopt.h
|
||||
|
||||
getopt1.o: getopt.h
|
||||
|
||||
builtin.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
|
||||
-rm -f $(bindir)/gawk
|
||||
fullname=gawk-$(REL).`./gawk '{print $$3}' $(srcdir)/patchlevel.h` ; \
|
||||
$(INSTALL_PROGRAM) gawk $(bindir)/$$fullname ; \
|
||||
(cd $(bindir); $(LN) $$fullname gawk)
|
||||
(cd $(bindir); \
|
||||
if [ ! -f awk ]; \
|
||||
then $(LN_S) gawk awk; \
|
||||
fi; exit 0)
|
||||
cd doc && $(MAKE) install
|
||||
cd awklib && $(MAKE) install
|
||||
|
||||
installdirs: mkinstalldirs
|
||||
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
|
||||
$(libdir) $(infodir) $(mandir) $(libexecdir)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
|
||||
uninstall:
|
||||
(cd $(bindir); \
|
||||
if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi)
|
||||
(fullname=gawk-$(REL).`gawk '{print $$3}' $(srcdir)/patchlevel.h` ; \
|
||||
cd $(bindir); \
|
||||
if cmp gawk $$fullname; then rm -f gawk; fi ; \
|
||||
rm -f $(bindir)/$$fullname)
|
||||
cd doc && $(MAKE) uninstall
|
||||
cd awklib && $(MAKE) uninstall
|
||||
-rmdir $(datadir) $(libexecdir)
|
||||
|
||||
# auxiliary rules for release maintenance
|
||||
lint: $(ALLSRC)
|
||||
lint -hcbax $(COMPFLAGS) $(ALLSRC)
|
||||
|
||||
xref:
|
||||
cxref -c $(COMPFLAGS) $(ALLSRC) | grep -v ' /' >xref
|
||||
|
||||
mostlyclean:
|
||||
: mostly clean does nothing for gawk
|
||||
: use "make clean" to really clean things out
|
||||
|
||||
clean:
|
||||
rm -rf gawk *.o core */core y.output
|
||||
cd doc && $(MAKE) clean
|
||||
cd test && $(MAKE) clean
|
||||
cd awklib && $(MAKE) 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 tags TAGS *~
|
||||
|
||||
distclean: clean local-distclean
|
||||
cd doc && $(MAKE) distclean
|
||||
cd awklib && $(MAKE) distclean
|
||||
cd test && $(MAKE) 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
|
||||
cd doc && $(MAKE) maintainer-clean
|
||||
cd test && $(MAKE) maintainer-clean
|
||||
cd awklib && $(MAKE) maintainer-clean
|
||||
|
||||
clobber: maintainer-clean
|
||||
|
||||
TAGS:
|
||||
etags $(AWKSRC)
|
||||
|
||||
tags:
|
||||
ctags $(AWKSRC)
|
||||
|
||||
dvi: $(srcdir)/doc/gawk.texi
|
||||
cd doc && $(MAKE) dvi
|
||||
|
||||
info: $(srcdir)/doc/gawk.texi
|
||||
cd doc && $(MAKE) info
|
||||
|
||||
doc/all:
|
||||
cd doc && $(MAKE) all
|
||||
|
||||
awklib/all: gawk
|
||||
cd awklib && $(MAKE) CFLAGS="$(CFLAGS)" all
|
||||
|
||||
dist: $(AWKSRC) $(LIBSRC) $(DOCS) $(MISC) $(COPIES) awklib/stamp-eg info distclean
|
||||
-rm -rf gawk-$(REL)*
|
||||
dir=gawk-$(REL).`gawk '{print $$3}' patchlevel.h` && \
|
||||
mkdir $$dir && \
|
||||
cp -pr $(AWKSRC) $(LIBSRC) $(MISC) $$dir && \
|
||||
mkdir $$dir/missing && \
|
||||
cp -p $(COPIES) $$dir/missing && \
|
||||
for i in $(OTHERS); \
|
||||
do \
|
||||
cp -pr $$i $$dir ; \
|
||||
done && \
|
||||
cp -pr test $$dir && \
|
||||
find $$dir -type d -exec chmod 777 {} ';' && \
|
||||
find $$dir -print | doschk && \
|
||||
tar -cf - $$dir | gzip > $$dir.tar.gz && \
|
||||
rm -fr $$dir
|
||||
|
||||
awklib/stamp-eg:
|
||||
cd awklib ; $(MAKE) stamp-eg
|
||||
|
||||
check: gawk
|
||||
cd test; $(MAKE) -k
|
||||
|
||||
test: check
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
Date: Sat, 22 Apr 2000 06:07:06 -0600 (MDT)
|
||||
From: "Nelson H. F. Beebe" <[email protected]>
|
||||
To: [email protected]
|
||||
Cc: [email protected], [email protected], [email protected]
|
||||
Subject: gawk-3.0.4 and a GNU/Linux gotcha
|
||||
|
||||
Yesterday, I was assisting a colleague install some software on his
|
||||
GNU/Linux machine for which uname -r reports 2.2.14.
|
||||
|
||||
A (mis)feature of this system, which I've never encountered before,
|
||||
broke the build of one of my programs, and also of gawk-3.0.4.
|
||||
|
||||
Namely, the kernel will not execute anything that resides in /tmp,
|
||||
though it will if the same script is in /usr/tmp!
|
||||
|
||||
% cat /tmp/foo.sh
|
||||
#! /bin/sh
|
||||
echo hello
|
||||
|
||||
ls -l /tmp/foo.sh
|
||||
-rwxr-xr-x 1 othmer math 22 Apr 21 10:34 /tmp/foo.sh*
|
||||
|
||||
% /tmp/foo.sh
|
||||
bash: /tmp/foo.sh: Permission denied
|
||||
|
||||
% cp /tmp/foo.sh /usr/tmp
|
||||
|
||||
% /usr/tmp/foo.sh
|
||||
hello
|
||||
|
||||
Thus, programs that do a temporary install in /tmp, as some of mine do
|
||||
in order to run the validation suite, will fail.
|
||||
|
||||
gawk-3.0.4, and likely other gawk versions, hits this problem too. It
|
||||
fails because test/poundbang starts with
|
||||
|
||||
#! /tmp/gawk -f
|
||||
|
||||
I tracked down where it comes from:
|
||||
|
||||
% grep /tmp /etc/fstab
|
||||
/dev/hda3 /tmp ext2 rw,nosuid,noexec,nouser,auto,async,nodev 1 1
|
||||
!!!!!!
|
||||
|
||||
Since this is done via a mount command, potentially ANY directory tree
|
||||
could be mounted with noexec.
|
||||
Vendored
-129
@@ -1,129 +0,0 @@
|
||||
dnl
|
||||
dnl aclocal.m4 --- autoconf input file for gawk
|
||||
dnl
|
||||
dnl Copyright (C) 1995, 1996, 1998, 1999, 2000 the Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This file is part of GAWK, the GNU implementation of the
|
||||
dnl AWK Progamming Language.
|
||||
dnl
|
||||
dnl GAWK is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl GAWK is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
dnl
|
||||
|
||||
dnl gawk-specific macros for autoconf. one day hopefully part of autoconf
|
||||
|
||||
AC_DEFUN(GAWK_AC_C_STRINGIZE, [
|
||||
AC_REQUIRE([AC_PROG_CPP])
|
||||
AC_MSG_CHECKING([for ANSI stringizing capability])
|
||||
AC_CACHE_VAL(gawk_cv_c_stringize,
|
||||
AC_EGREP_CPP([#teststring],[
|
||||
#define x(y) #y
|
||||
|
||||
char *s = x(teststring);
|
||||
], gawk_cv_c_stringize=no, gawk_cv_c_stringize=yes))
|
||||
if test "${gawk_cv_c_stringize}" = yes
|
||||
then
|
||||
AC_DEFINE(HAVE_STRINGIZE)
|
||||
fi
|
||||
AC_MSG_RESULT([${gawk_cv_c_stringize}])
|
||||
])dnl
|
||||
|
||||
|
||||
dnl By default, many hosts won't let programs access large files;
|
||||
dnl one must use special compiler options to get large-file access to work.
|
||||
dnl For more details about this brain damage please see:
|
||||
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||
|
||||
dnl Written by Paul Eggert <[email protected]>.
|
||||
|
||||
dnl Internal subroutine of GAWK_AC_SYS_LARGEFILE.
|
||||
dnl GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||
AC_DEFUN(GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES,
|
||||
[[#include <sys/types.h>
|
||||
int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
|
||||
]])
|
||||
|
||||
dnl Internal subroutine of GAWK_AC_SYS_LARGEFILE.
|
||||
dnl GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
|
||||
AC_DEFUN(GAWK_AC_SYS_LARGEFILE_MACRO_VALUE,
|
||||
[AC_CACHE_CHECK([for $1 value needed for large files], $3,
|
||||
[$3=no
|
||||
AC_TRY_COMPILE(GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||
$5
|
||||
,
|
||||
[$6],
|
||||
,
|
||||
[AC_TRY_COMPILE([#define $1 $2]
|
||||
GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||
$5
|
||||
,
|
||||
[$6],
|
||||
[$3=$2])])])
|
||||
if test "[$]$3" != no; then
|
||||
AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
|
||||
fi])
|
||||
|
||||
AC_DEFUN(GAWK_AC_SYS_LARGEFILE,
|
||||
[AC_ARG_ENABLE(largefile,
|
||||
[ --disable-largefile omit support for large files])
|
||||
if test "$enable_largefile" != no; then
|
||||
|
||||
AC_CACHE_CHECK([for special C compiler options needed for large files],
|
||||
gawk_cv_sys_largefile_CC,
|
||||
[gawk_cv_sys_largefile_CC=no
|
||||
if test "$GCC" != yes; then
|
||||
# IRIX 6.2 and later do not support large files by default,
|
||||
# so use the C compiler's -n32 option if that helps.
|
||||
AC_TRY_COMPILE(GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
|
||||
[ac_save_CC="$CC"
|
||||
CC="$CC -n32"
|
||||
AC_TRY_COMPILE(GAWK_AC_SYS_LARGEFILE_TEST_INCLUDES, ,
|
||||
gawk_cv_sys_largefile_CC=' -n32')
|
||||
CC="$ac_save_CC"])
|
||||
fi])
|
||||
if test "$gawk_cv_sys_largefile_CC" != no; then
|
||||
CC="$CC$gawk_cv_sys_largefile_CC"
|
||||
fi
|
||||
|
||||
GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
|
||||
gawk_cv_sys_file_offset_bits,
|
||||
[Number of bits in a file offset, on hosts where this is settable.])
|
||||
GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
|
||||
gawk_cv_sys_largefile_source,
|
||||
[Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
|
||||
[#include <stdio.h>], [return !ftello;])
|
||||
GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
|
||||
gawk_cv_sys_large_files,
|
||||
[Define for large files, on AIX-style hosts.])
|
||||
GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
|
||||
gawk_cv_sys_xopen_source,
|
||||
[Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
|
||||
[#include <stdio.h>], [return !ftello;])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Check for AIX and add _XOPEN_SOURCE_EXTENDED
|
||||
AC_DEFUN(GAWK_AC_AIX_TWEAK, [
|
||||
AC_MSG_CHECKING([for AIX compilation hacks])
|
||||
AC_CACHE_VAL(gawk_cv_aix_hack, [
|
||||
if test -d /lpp/bos
|
||||
then
|
||||
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
|
||||
gawk_cv_aix_hack=yes
|
||||
else
|
||||
gawk_cv_aix_hack=no
|
||||
fi
|
||||
])dnl
|
||||
AC_MSG_RESULT([${gawk_cv_aix_hack}])
|
||||
])dnl
|
||||
@@ -1,496 +0,0 @@
|
||||
/* alloca.c -- allocate automatically reclaimed memory
|
||||
(Mostly) portable public-domain implementation -- D A Gwyn
|
||||
|
||||
This implementation of the PWB library alloca function,
|
||||
which is used to allocate space off the run-time stack so
|
||||
that it is automatically reclaimed upon procedure exit,
|
||||
was inspired by discussions with J. Q. Johnson of Cornell.
|
||||
J.Otto Tennant <[email protected]> contributed the Cray support.
|
||||
|
||||
There are some preprocessor constants that can
|
||||
be defined when compiling for your specific system, for
|
||||
improved efficiency; however, the defaults should be okay.
|
||||
|
||||
The general concept of this implementation is to keep
|
||||
track of all alloca-allocated blocks, and reclaim any
|
||||
that are found to be deeper in the stack than the current
|
||||
invocation. This heuristic does not reclaim storage as
|
||||
soon as it becomes invalid, but it will do so eventually.
|
||||
|
||||
As a special case, alloca(0) reclaims storage without
|
||||
allocating any. It is a good idea to use alloca(0) in
|
||||
your main control loop, etc. to force garbage collection. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "blockinput.h"
|
||||
#endif
|
||||
|
||||
/* If compiling with GCC 2, this file's not needed. */
|
||||
#if !defined (__GNUC__) || __GNUC__ < 2
|
||||
|
||||
/* If someone has defined alloca as a macro,
|
||||
there must be some other way alloca is supposed to work. */
|
||||
#ifndef alloca
|
||||
|
||||
#ifdef emacs
|
||||
#ifdef static
|
||||
/* actually, only want this if static is defined as ""
|
||||
-- this is for usg, in which emacs must undefine static
|
||||
in order to make unexec workable
|
||||
*/
|
||||
#ifndef STACK_DIRECTION
|
||||
you
|
||||
lose
|
||||
-- must know STACK_DIRECTION at compile-time
|
||||
#endif /* STACK_DIRECTION undefined */
|
||||
#endif /* static */
|
||||
#endif /* emacs */
|
||||
|
||||
/* If your stack is a linked list of frames, you have to
|
||||
provide an "address metric" ADDRESS_FUNCTION macro. */
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
long i00afunc ();
|
||||
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||
#else
|
||||
#define ADDRESS_FUNCTION(arg) &(arg)
|
||||
#endif
|
||||
|
||||
#if __STDC__
|
||||
typedef void *pointer;
|
||||
#else
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifndef malloc
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
ordinary malloc isn't protected from input signals. On the other
|
||||
hand, the utilities in lib-src need alloca to call malloc; some of
|
||||
them are very simple, and don't have an xmalloc routine.
|
||||
|
||||
Non-Emacs programs expect this to call xmalloc.
|
||||
|
||||
Callers below should use malloc. */
|
||||
|
||||
#ifndef emacs
|
||||
#define malloc xmalloc
|
||||
#endif
|
||||
extern pointer malloc ();
|
||||
#endif /* malloc */
|
||||
|
||||
/* Define STACK_DIRECTION 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 */
|
||||
|
||||
#ifndef STACK_DIRECTION
|
||||
#define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
#endif
|
||||
|
||||
#if STACK_DIRECTION != 0
|
||||
|
||||
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
|
||||
#else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
|
||||
static int stack_dir; /* 1 or -1 once known. */
|
||||
#define STACK_DIR stack_dir
|
||||
|
||||
static void
|
||||
find_stack_direction ()
|
||||
{
|
||||
static char *addr = NULL; /* Address of first `dummy', once known. */
|
||||
auto char dummy; /* To get stack address. */
|
||||
|
||||
if (addr == NULL)
|
||||
{ /* Initial entry. */
|
||||
addr = ADDRESS_FUNCTION (dummy);
|
||||
|
||||
find_stack_direction (); /* Recurse once. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second entry. */
|
||||
if (ADDRESS_FUNCTION (dummy) > addr)
|
||||
stack_dir = 1; /* Stack grew upward. */
|
||||
else
|
||||
stack_dir = -1; /* Stack grew downward. */
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* STACK_DIRECTION == 0 */
|
||||
|
||||
/* An "alloca header" is used to:
|
||||
(a) chain together all alloca'ed blocks;
|
||||
(b) keep track of stack depth.
|
||||
|
||||
It is very important that sizeof(header) agree with malloc
|
||||
alignment chunk size. The following default should work okay. */
|
||||
|
||||
#ifndef ALIGN_SIZE
|
||||
#define ALIGN_SIZE sizeof(double)
|
||||
#endif
|
||||
|
||||
typedef union hdr
|
||||
{
|
||||
char align[ALIGN_SIZE]; /* To force sizeof(header). */
|
||||
struct
|
||||
{
|
||||
union hdr *next; /* For chaining headers. */
|
||||
char *deep; /* For stack depth measure. */
|
||||
} h;
|
||||
} header;
|
||||
|
||||
static header *last_alloca_header = NULL; /* -> last alloca header. */
|
||||
|
||||
/* Return a pointer to at least SIZE bytes of storage,
|
||||
which will be automatically reclaimed upon exit from
|
||||
the procedure that called alloca. Originally, this space
|
||||
was supposed to be taken from the current stack frame of the
|
||||
caller, but that method cannot be made to work for some
|
||||
implementations of C, for example under Gould's UTX/32. */
|
||||
|
||||
pointer
|
||||
alloca (size)
|
||||
unsigned size;
|
||||
{
|
||||
auto char probe; /* Probes stack depth: */
|
||||
register char *depth = ADDRESS_FUNCTION (probe);
|
||||
|
||||
#if STACK_DIRECTION == 0
|
||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||
find_stack_direction ();
|
||||
#endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
|
||||
#ifdef emacs
|
||||
BLOCK_INPUT;
|
||||
#endif
|
||||
|
||||
for (hp = last_alloca_header; hp != NULL;)
|
||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||
|| (STACK_DIR < 0 && hp->h.deep < depth))
|
||||
{
|
||||
register header *np = hp->h.next;
|
||||
|
||||
free ((pointer) hp); /* Collect garbage. */
|
||||
|
||||
hp = np; /* -> next header. */
|
||||
}
|
||||
else
|
||||
break; /* Rest are not deeper. */
|
||||
|
||||
last_alloca_header = hp; /* -> last valid storage. */
|
||||
|
||||
#ifdef emacs
|
||||
UNBLOCK_INPUT;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
return NULL; /* No allocation required. */
|
||||
|
||||
/* Allocate combined header + user data storage. */
|
||||
|
||||
{
|
||||
register pointer new = malloc (sizeof (header) + size);
|
||||
/* Address of header. */
|
||||
|
||||
((header *) new)->h.next = last_alloca_header;
|
||||
((header *) new)->h.deep = depth;
|
||||
|
||||
last_alloca_header = (header *) new;
|
||||
|
||||
/* User storage begins just after header. */
|
||||
|
||||
return (pointer) ((char *) new + sizeof (header));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifndef CRAY_STACK
|
||||
#define CRAY_STACK
|
||||
#ifndef CRAY2
|
||||
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
||||
struct stack_control_header
|
||||
{
|
||||
long shgrow:32; /* Number of times stack has grown. */
|
||||
long shaseg:32; /* Size of increments to stack. */
|
||||
long shhwm:32; /* High water mark of stack. */
|
||||
long shsize:32; /* Current size of stack (all segments). */
|
||||
};
|
||||
|
||||
/* The stack segment linkage control information occurs at
|
||||
the high-address end of a stack segment. (The stack
|
||||
grows from low addresses to high addresses.) The initial
|
||||
part of the stack segment linkage control information is
|
||||
0200 (octal) words. This provides for register storage
|
||||
for the routine which overflows the stack. */
|
||||
|
||||
struct stack_segment_linkage
|
||||
{
|
||||
long ss[0200]; /* 0200 overflow words. */
|
||||
long sssize:32; /* Number of words in this segment. */
|
||||
long ssbase:32; /* Offset to stack base. */
|
||||
long:32;
|
||||
long sspseg:32; /* Offset to linkage control of previous
|
||||
segment of stack. */
|
||||
long:32;
|
||||
long sstcpt:32; /* Pointer to task common address block. */
|
||||
long sscsnm; /* Private control structure number for
|
||||
microtasking. */
|
||||
long ssusr1; /* Reserved for user. */
|
||||
long ssusr2; /* Reserved for user. */
|
||||
long sstpid; /* Process ID for pid based multi-tasking. */
|
||||
long ssgvup; /* Pointer to multitasking thread giveup. */
|
||||
long sscray[7]; /* Reserved for Cray Research. */
|
||||
long ssa0;
|
||||
long ssa1;
|
||||
long ssa2;
|
||||
long ssa3;
|
||||
long ssa4;
|
||||
long ssa5;
|
||||
long ssa6;
|
||||
long ssa7;
|
||||
long sss0;
|
||||
long sss1;
|
||||
long sss2;
|
||||
long sss3;
|
||||
long sss4;
|
||||
long sss5;
|
||||
long sss6;
|
||||
long sss7;
|
||||
};
|
||||
|
||||
#else /* CRAY2 */
|
||||
/* The following structure defines the vector of words
|
||||
returned by the STKSTAT library routine. */
|
||||
struct stk_stat
|
||||
{
|
||||
long now; /* Current total stack size. */
|
||||
long maxc; /* Amount of contiguous space which would
|
||||
be required to satisfy the maximum
|
||||
stack demand to date. */
|
||||
long high_water; /* Stack high-water mark. */
|
||||
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
|
||||
long hits; /* Number of internal buffer hits. */
|
||||
long extends; /* Number of block extensions. */
|
||||
long stko_mallocs; /* Block allocations by $STKOFEN. */
|
||||
long underflows; /* Number of stack underflow calls ($STKRETN). */
|
||||
long stko_free; /* Number of deallocations by $STKRETN. */
|
||||
long stkm_free; /* Number of deallocations by $STKMRET. */
|
||||
long segments; /* Current number of stack segments. */
|
||||
long maxs; /* Maximum number of stack segments so far. */
|
||||
long pad_size; /* Stack pad size. */
|
||||
long current_address; /* Current stack segment address. */
|
||||
long current_size; /* Current stack segment size. This
|
||||
number is actually corrupted by STKSTAT to
|
||||
include the fifteen word trailer area. */
|
||||
long initial_address; /* Address of initial segment. */
|
||||
long initial_size; /* Size of initial segment. */
|
||||
};
|
||||
|
||||
/* The following structure describes the data structure which trails
|
||||
any stack segment. I think that the description in 'asdef' is
|
||||
out of date. I only describe the parts that I am sure about. */
|
||||
|
||||
struct stk_trailer
|
||||
{
|
||||
long this_address; /* Address of this block. */
|
||||
long this_size; /* Size of this block (does not include
|
||||
this trailer). */
|
||||
long unknown2;
|
||||
long unknown3;
|
||||
long link; /* Address of trailer block of previous
|
||||
segment. */
|
||||
long unknown5;
|
||||
long unknown6;
|
||||
long unknown7;
|
||||
long unknown8;
|
||||
long unknown9;
|
||||
long unknown10;
|
||||
long unknown11;
|
||||
long unknown12;
|
||||
long unknown13;
|
||||
long unknown14;
|
||||
};
|
||||
|
||||
#endif /* CRAY2 */
|
||||
#endif /* not CRAY_STACK */
|
||||
|
||||
#ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
{
|
||||
struct stk_stat status;
|
||||
struct stk_trailer *trailer;
|
||||
long *block, size;
|
||||
long result = 0;
|
||||
|
||||
/* We want to iterate through all of the segments. The first
|
||||
step is to get the stack status structure. We could do this
|
||||
more quickly and more directly, perhaps, by referencing the
|
||||
$LM00 common block, but I know that this works. */
|
||||
|
||||
STKSTAT (&status);
|
||||
|
||||
/* Set up the iteration. */
|
||||
|
||||
trailer = (struct stk_trailer *) (status.current_address
|
||||
+ status.current_size
|
||||
- 15);
|
||||
|
||||
/* There must be at least one stack segment. Therefore it is
|
||||
a fatal error if "trailer" is null. */
|
||||
|
||||
if (trailer == 0)
|
||||
abort ();
|
||||
|
||||
/* Discard segments that do not contain our argument address. */
|
||||
|
||||
while (trailer != 0)
|
||||
{
|
||||
block = (long *) trailer->this_address;
|
||||
size = trailer->this_size;
|
||||
if (block == 0 || size == 0)
|
||||
abort ();
|
||||
trailer = (struct stk_trailer *) trailer->link;
|
||||
if ((block <= address) && (address < (block + size)))
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set the result to the offset in this segment and add the sizes
|
||||
of all predecessor segments. */
|
||||
|
||||
result = address - block;
|
||||
|
||||
if (trailer == 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (trailer->this_size <= 0)
|
||||
abort ();
|
||||
result += trailer->this_size;
|
||||
trailer = (struct stk_trailer *) trailer->link;
|
||||
}
|
||||
while (trailer != 0);
|
||||
|
||||
/* We are done. Note that if you present a bogus address (one
|
||||
not in any segment), you will get a different number back, formed
|
||||
from subtracting the address of the first block. This is probably
|
||||
not what you want. */
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
#else /* not CRAY2 */
|
||||
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
||||
Determine the number of the cell within the stack,
|
||||
given the address of the cell. The purpose of this
|
||||
routine is to linearize, in some sense, stack addresses
|
||||
for alloca. */
|
||||
|
||||
static long
|
||||
i00afunc (long address)
|
||||
{
|
||||
long stkl = 0;
|
||||
|
||||
long size, pseg, this_segment, stack;
|
||||
long result = 0;
|
||||
|
||||
struct stack_segment_linkage *ssptr;
|
||||
|
||||
/* Register B67 contains the address of the end of the
|
||||
current stack segment. If you (as a subprogram) store
|
||||
your registers on the stack and find that you are past
|
||||
the contents of B67, you have overflowed the segment.
|
||||
|
||||
B67 also points to the stack segment linkage control
|
||||
area, which is what we are really interested in. */
|
||||
|
||||
stkl = CRAY_STACKSEG_END ();
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
|
||||
/* If one subtracts 'size' from the end of the segment,
|
||||
one has the address of the first word of the segment.
|
||||
|
||||
If this is not the first segment, 'pseg' will be
|
||||
nonzero. */
|
||||
|
||||
pseg = ssptr->sspseg;
|
||||
size = ssptr->sssize;
|
||||
|
||||
this_segment = stkl - size;
|
||||
|
||||
/* It is possible that calling this routine itself caused
|
||||
a stack overflow. Discard stack segments which do not
|
||||
contain the target address. */
|
||||
|
||||
while (!(this_segment <= address && address <= stkl))
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
||||
#endif
|
||||
if (pseg == 0)
|
||||
break;
|
||||
stkl = stkl - pseg;
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
size = ssptr->sssize;
|
||||
pseg = ssptr->sspseg;
|
||||
this_segment = stkl - size;
|
||||
}
|
||||
|
||||
result = address - this_segment;
|
||||
|
||||
/* If you subtract pseg from the current end of the stack,
|
||||
you get the address of the previous stack segment's end.
|
||||
This seems a little convoluted to me, but I'll bet you save
|
||||
a cycle somewhere. */
|
||||
|
||||
while (pseg != 0)
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o\n", pseg, size);
|
||||
#endif
|
||||
stkl = stkl - pseg;
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
size = ssptr->sssize;
|
||||
pseg = ssptr->sspseg;
|
||||
result += size;
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
#endif /* not CRAY2 */
|
||||
#endif /* CRAY */
|
||||
|
||||
#endif /* no alloca */
|
||||
#endif /* not GCC version 2 */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,225 +0,0 @@
|
||||
/* configh.in. Generated automatically from configure.in by autoheader. */
|
||||
/*
|
||||
* acconfig.h -- configuration definitions for gawk.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995-2000 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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'. */
|
||||
#undef GETGROUPS_T
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
#undef GETPGRP_VOID
|
||||
|
||||
/* 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 you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if you have the ANSI # stringizing operator in cpp. */
|
||||
#undef HAVE_STRINGIZE
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_TZNAME
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* 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). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* 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. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* 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
|
||||
|
||||
#undef HAVE_STRINGIZE /* can use ANSI # operator in cpp */
|
||||
#undef REGEX_MALLOC /* use malloc instead of alloca in regex.c */
|
||||
#undef SPRINTF_RET /* return type of sprintf */
|
||||
#undef BITOPS /* bitwise ops (undocumented feature) */
|
||||
#undef NONDECDATA /* non-decimal input data (undocumented feature) */
|
||||
#undef _FILE_OFFSET_BITS /* bits in a file offset, where this matters */
|
||||
#undef _LARGEFILE_SOURCE /* makes fseeko etc. visible on some hosts */
|
||||
#undef _LARGE_FILES /* emables large files on AIX-style hosts */
|
||||
|
||||
/* Define if you have the fmod function. */
|
||||
#undef HAVE_FMOD
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the madvise function. */
|
||||
#undef HAVE_MADVISE
|
||||
|
||||
/* Define if you have the memcmp function. */
|
||||
#undef HAVE_MEMCMP
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the memset function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
#undef HAVE_STRNCASECMP
|
||||
|
||||
/* Define if you have the strtod function. */
|
||||
#undef HAVE_STRTOD
|
||||
|
||||
/* Define if you have the system function. */
|
||||
#undef HAVE_SYSTEM
|
||||
|
||||
/* Define if you have the tzset function. */
|
||||
#undef HAVE_TZSET
|
||||
|
||||
/* 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. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <signum.h> header file. */
|
||||
#undef HAVE_SIGNUM_H
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* 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
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* 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
|
||||
|
||||
|
||||
#include <custom.h> /* overrides for stuff autoconf can't deal with */
|
||||
Vendored
-3685
File diff suppressed because it is too large.
Load diff
@@ -1,165 +0,0 @@
|
||||
dnl
|
||||
dnl configure.in --- autoconf input file for gawk
|
||||
dnl
|
||||
dnl Copyright (C) 1995-2000 the Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This file is part of GAWK, the GNU implementation of the
|
||||
dnl AWK Programming Language.
|
||||
dnl
|
||||
dnl GAWK is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl GAWK is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
dnl
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
dnl this makes sure that the local install-sh gets found
|
||||
dnl define(AC_CONFIG_AUX_DIR,)
|
||||
|
||||
dnl This is the configure.in script proper
|
||||
AC_INIT(awk.h)
|
||||
AC_PREREQ(2.12)
|
||||
AC_CONFIG_HEADER(config.h:configh.in)
|
||||
|
||||
dnl Additional argument stuff
|
||||
AC_ARG_ENABLE(bitops, [ --enable-bitops Enable Octal and Hex constants and bit functions], AC_DEFINE(BITOPS))
|
||||
AC_ARG_ENABLE(non-decimal-data, [ --enable-non-decimal-data Enable Octal and Hex constants as valid input data], AC_DEFINE(NONDECDATA))
|
||||
|
||||
dnl checks for programs
|
||||
AC_PROG_YACC
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
|
||||
# This is a hack. Different versions of install on different systems
|
||||
# are just too different. Chuck it and use install-sh.
|
||||
INSTALL="$srcdir/install-sh -c"; export INSTALL
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
if test "$CFLAGS" = ""
|
||||
then
|
||||
dnl no user provided CFLAGS, feel free to do this our way
|
||||
if test "$GCC" = yes
|
||||
then
|
||||
CFLAGS="-g -O"
|
||||
else
|
||||
dnl go for speed, not debugging. :-)
|
||||
CFLAGS="-O"
|
||||
fi
|
||||
fi
|
||||
|
||||
# This is mainly for my use during testing and development.
|
||||
# Yes, it's a bit of a hack.
|
||||
if test -f $srcdir/.developing
|
||||
then
|
||||
AC_DEFINE(BITOPS)
|
||||
AC_DEFINE(NONDECDATA)
|
||||
CFLAGS="$CFLAGS -DARRAYDEBUG"
|
||||
fi
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
dnl checks for systems
|
||||
AC_AIX
|
||||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
GAWK_AC_SYS_LARGEFILE
|
||||
GAWK_AC_AIX_TWEAK
|
||||
|
||||
if test "$ISC" = 1 # will be set by test for ISC
|
||||
then
|
||||
dnl need -D_SYSV3 for ISC
|
||||
CFLAGS="$CFLAGS -D_SYSV3"
|
||||
fi
|
||||
|
||||
dnl checks for header files
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS(limits.h locale.h stdarg.h unistd.h signum.h sys/param.h string.h)
|
||||
if test "$ac_cv_header_string_h" = yes
|
||||
then
|
||||
AC_CHECK_HEADERS(memory.h)
|
||||
else
|
||||
AC_CHECK_HEADERS(strings.h)
|
||||
fi
|
||||
|
||||
dnl checks for typedefs
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_SIZE_T
|
||||
AC_TYPE_GETGROUPS
|
||||
AC_EGREP_HEADER([int.*sprintf], stdio.h,
|
||||
AC_DEFINE(SPRINTF_RET, int),
|
||||
AC_DEFINE(SPRINTF_RET, char *))
|
||||
|
||||
dnl checks for functions
|
||||
if test "$YACC" = "bison -y" ||
|
||||
{ test -f $srcdir/awktab.c && grep 'alloca *(' $srcdir/awktab.c > /dev/null; }
|
||||
then
|
||||
AC_FUNC_ALLOCA
|
||||
fi
|
||||
AC_DEFINE(REGEX_MALLOC)
|
||||
AC_FUNC_VPRINTF
|
||||
|
||||
AC_CHECK_LIB(m, fmod)
|
||||
AC_CHECK_FUNCS(madvise memset memcpy memcmp fmod setlocale strchr strerror \
|
||||
strftime strncasecmp strtod system tzset)
|
||||
|
||||
dnl see if we have mmap
|
||||
AC_FUNC_MMAP
|
||||
|
||||
dnl check for how to use getpgrp
|
||||
dnl have to hardwire it for VMS POSIX. Sigh.
|
||||
if (uname) > /dev/null 2>&1
|
||||
then
|
||||
case `uname` in
|
||||
*VMS*|*BeOS*)
|
||||
AC_DEFINE(GETPGRP_VOID)
|
||||
;;
|
||||
*HP-UX*) # not getpgrp related
|
||||
if test "$GCC" = yes
|
||||
then
|
||||
:
|
||||
else
|
||||
# stupid HP linker leaves the output file
|
||||
# around even when a link fails. This confuses
|
||||
# the alloca tests, so we have to do this
|
||||
# manually. Sucks big time.
|
||||
LIBS="$LIBS -lPW"
|
||||
fi
|
||||
|
||||
# have to do the getpgrp test since won't
|
||||
# fall into the default
|
||||
AC_FUNC_GETPGRP
|
||||
;;
|
||||
*) AC_FUNC_GETPGRP
|
||||
;;
|
||||
esac
|
||||
else
|
||||
AC_FUNC_GETPGRP
|
||||
fi
|
||||
|
||||
dnl checks for structure members
|
||||
AC_STRUCT_ST_BLKSIZE
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
AC_STRUCT_TIMEZONE
|
||||
|
||||
dnl checks for compiler characteristics
|
||||
AC_C_CHAR_UNSIGNED
|
||||
AC_C_CONST
|
||||
GAWK_AC_C_STRINGIZE
|
||||
|
||||
AC_OUTPUT(Makefile doc/Makefile test/Makefile awklib/Makefile, [date > stamp-h])
|
||||
@@ -1,129 +0,0 @@
|
||||
# Makefile for GNU Awk documentation.
|
||||
#
|
||||
# Copyright (C) 1993-2000 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
binprefix =
|
||||
manprefix =
|
||||
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
mandir = @mandir@/man1
|
||||
manext = .1
|
||||
infodir = @infodir@
|
||||
datadir = @datadir@/awk
|
||||
|
||||
TEXI2DVI = texi2dvi
|
||||
TEX = tex
|
||||
MAKEINFO = makeinfo --no-split
|
||||
TROFF = groff -t -Tps
|
||||
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/"
|
||||
|
||||
DOCS= gawk.1 igawk.1 gawk.texi
|
||||
|
||||
TEXFILES= gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
|
||||
gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
|
||||
|
||||
ALLDOC= gawk.dvi $(TEXFILES) gawk.log awkcard.tr
|
||||
|
||||
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
|
||||
|
||||
all: $(DOCS) info
|
||||
|
||||
install: $(mandir)/gawk$(manext) $(mandir)/igawk$(manext) $(infodir)/gawk.info
|
||||
|
||||
$(infodir)/gawk.info::
|
||||
-if test -f gawk.info; then d=.; \
|
||||
else d=$(srcdir); fi; \
|
||||
if [ -f $(infodir)/dir -a -f $(infodir)/gawk.info ] \
|
||||
&& cmp $$d/gawk.info $(infodir)/gawk.info > /dev/null \
|
||||
&& grep '(gawk)' $(infodir)/dir > /dev/null; then \
|
||||
exit 0; \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $$d/gawk.info $(infodir)/gawk.info ; \
|
||||
if $(SHELL) -c 'install-info --version' > /dev/null 2>&1 ; \
|
||||
then install-info --info-dir=$(infodir) gawk.info ; \
|
||||
else true ; fi; exit 0
|
||||
|
||||
$(mandir)/gawk$(manext):: gawk.1
|
||||
$(INSTALL_DATA) $(srcdir)/gawk.1 $(mandir)/gawk$(manext)
|
||||
|
||||
$(mandir)/igawk$(manext):: igawk.1
|
||||
$(INSTALL_DATA) $(srcdir)/igawk.1 $(mandir)/igawk$(manext)
|
||||
|
||||
uninstall:
|
||||
rm -f $(mandir)/gawk$(manext) $(mandir)/igawk$(manext) $(infodir)/gawk.info*
|
||||
|
||||
dvi: gawk.dvi
|
||||
|
||||
gawk.dvi: gawk.texi
|
||||
-TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/gawk.texi
|
||||
|
||||
info: gawk.info
|
||||
|
||||
gawk.info: gawk.texi
|
||||
$(MAKEINFO) $(srcdir)/gawk.texi
|
||||
|
||||
postscript: dvi gawk.1 igawk.1 $(AWKCARD)
|
||||
-groff -man $(srcdir)/gawk.1 > gawk.1.ps
|
||||
-groff -man $(srcdir)/igawk.1 > igawk.1.ps
|
||||
dvips -o gawk.ps gawk.dvi
|
||||
|
||||
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 $(ALLDOC) *~ awkcard.nc
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use; it"
|
||||
@echo "deletes files that may require special tools to rebuild."
|
||||
rm -f gawk.info
|
||||
@@ -1,19 +0,0 @@
|
||||
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.
|
||||
@@ -1,49 +0,0 @@
|
||||
.\" AWK Reference Card --- Arnold Robbins, [email protected]
|
||||
.\" This file is the Ad block (included in cover)
|
||||
.\"
|
||||
.\" Copyright (C) 1996, 98 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
|
||||
59 Temple Place \(em Suite 330
|
||||
Boston, MA 02111-1307 USA
|
||||
Phone: +1-617-542-5942
|
||||
Fax (including Japan): +1-617-542-2652
|
||||
E-mail: [email protected]
|
||||
URL: http://www.gnu.org
|
||||
|
||||
.ce 7
|
||||
.ft HB
|
||||
\*(CGFree Software
|
||||
Source Distributions on CD-ROM
|
||||
Deluxe Distributions
|
||||
Emacs, Gawk, Make and GDB Manuals
|
||||
Emacs and GDB References\*(CX
|
||||
.EB "\f(HBOTHER FSF PRODUCTS:\*(FR"
|
||||
.ps
|
||||
.vs
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,150 +0,0 @@
|
||||
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 ([email protected]) 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).
|
||||
@@ -1,37 +0,0 @@
|
||||
.\" AWK Reference Card --- Arnold Robbins, [email protected]
|
||||
.\" 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 \fIThe GNU Awk User's Guide\fP
|
||||
@@ -1,39 +0,0 @@
|
||||
.\" AWK Reference Card --- Arnold Robbins, [email protected]
|
||||
.\" 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
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,73 +0,0 @@
|
||||
.TH IGAWK 1 "Nov 3 1999" "Free Software Foundation" "Utility Commands"
|
||||
.SH NAME
|
||||
igawk \- gawk with include files
|
||||
.SH SYNOPSIS
|
||||
.B igawk
|
||||
[ all
|
||||
.I gawk
|
||||
options ]
|
||||
.B \-f
|
||||
.I program-file
|
||||
[
|
||||
.B \-\^\-
|
||||
] file .\^.\^.
|
||||
.br
|
||||
.B igawk
|
||||
[ all
|
||||
.I gawk
|
||||
options ]
|
||||
[
|
||||
.B \-\^\-
|
||||
]
|
||||
.I program-text
|
||||
file .\^.\^.
|
||||
.SH DESCRIPTION
|
||||
.I Igawk
|
||||
is a simple shell script that adds the ability to have ``include files'' to
|
||||
.IR gawk (1).
|
||||
.PP
|
||||
AWK programs for
|
||||
.I igawk
|
||||
are the same as for
|
||||
.IR gawk ,
|
||||
except that, in addition, you may have lines like
|
||||
.RS
|
||||
.sp
|
||||
.ft B
|
||||
@include getopt.awk
|
||||
.ft R
|
||||
.sp
|
||||
.RE
|
||||
in your program to include the file
|
||||
.B getopt.awk
|
||||
from either the current directory or one of the other directories
|
||||
in the search path.
|
||||
.SH OPTIONS
|
||||
See
|
||||
.IR gawk (1)
|
||||
for a full description of the AWK language and the options that
|
||||
.I gawk
|
||||
supports.
|
||||
.SH EXAMPLES
|
||||
.nf
|
||||
.ft B
|
||||
cat << EOF > test.awk
|
||||
@include getopt.awk
|
||||
.sp
|
||||
BEGIN {
|
||||
while (getopt(ARGC, ARGV, "am:q") != \-1)
|
||||
\&.\^.\^.
|
||||
}
|
||||
EOF
|
||||
.sp
|
||||
igawk \-f test.awk
|
||||
.ft R
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.IR gawk (1)
|
||||
.PP
|
||||
.IR "Effective AWK Programming" ,
|
||||
Edition 1.0, published by the Free Software Foundation, 1995.
|
||||
.SH AUTHOR
|
||||
Arnold Robbins
|
||||
.RB ( [email protected] ).
|
||||
@@ -1,211 +0,0 @@
|
||||
.\" 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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: [email protected] (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
|
||||
@@ -1,31 +0,0 @@
|
||||
.\" AWK Reference Card --- Arnold Robbins, [email protected]
|
||||
.\" This file is for troff which does not know what to do
|
||||
.\" with a literal Poscript and cannot use 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
|
||||
@@ -1,77 +0,0 @@
|
||||
%!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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,238 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
tranformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -1,32 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <[email protected]>
|
||||
# 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'`
|
||||
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 $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* protos.h -- function prototypes for when the headers don't have them.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 1991 - 2000 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#ifdef __STDC__
|
||||
#define aptr_t void * /* arbitrary pointer type */
|
||||
#else
|
||||
#define aptr_t char *
|
||||
#endif
|
||||
extern aptr_t malloc P((MALLOC_ARG_T));
|
||||
extern aptr_t realloc P((aptr_t, MALLOC_ARG_T));
|
||||
extern aptr_t calloc P((MALLOC_ARG_T, MALLOC_ARG_T));
|
||||
|
||||
extern void free P((aptr_t));
|
||||
extern char *getenv P((const char *));
|
||||
|
||||
#if ! defined(HAVE_STRING_H) && ! defined(HAVE_STRINGS_H)
|
||||
extern char *strcpy P((char *, const char *));
|
||||
extern char *strcat P((char *, const char *));
|
||||
extern char *strncpy P((char *, const char *, size_t));
|
||||
extern int strcmp P((const char *, const char *));
|
||||
extern int strncmp P((const char *, const char *, size_t));
|
||||
extern char *strchr P((const char *, int));
|
||||
extern char *strrchr P((const char *, int));
|
||||
extern char *strstr P((const char *s1, const char *s2));
|
||||
extern size_t strlen P((const char *));
|
||||
extern long strtol P((const char *, char **, int));
|
||||
|
||||
extern aptr_t memset P((aptr_t, int, size_t));
|
||||
extern aptr_t memcpy P((aptr_t, const aptr_t, size_t));
|
||||
extern aptr_t memmove P((aptr_t, const aptr_t, size_t));
|
||||
extern aptr_t memchr P((const aptr_t, int, size_t));
|
||||
extern int memcmp P((const aptr_t, const aptr_t, size_t));
|
||||
#endif /* ! defined(HAVE_STRING_H) && ! defined(HAVE_STRINGS_H) */
|
||||
|
||||
#ifndef VMS
|
||||
extern char *strerror P((int));
|
||||
#else
|
||||
extern char *strerror P((int,...));
|
||||
#endif
|
||||
|
||||
#if ! defined(_MSC_VER) && ! defined(__GNU_LIBRARY__)
|
||||
extern size_t strftime P((char *, size_t, const char *, const struct tm *));
|
||||
#endif
|
||||
#ifdef __STDC__
|
||||
extern time_t time P((time_t *));
|
||||
#else
|
||||
extern long time();
|
||||
#endif
|
||||
|
||||
extern FILE *fdopen P((int, const char *));
|
||||
extern int fprintf P((FILE *, const char *, ...));
|
||||
#if ! defined(MSDOS) && ! defined(__GNU_LIBRARY__)
|
||||
#ifdef __STDC__
|
||||
extern size_t fwrite P((const aptr_t, size_t, size_t, FILE *));
|
||||
#else
|
||||
extern int fwrite();
|
||||
#endif
|
||||
extern int fputs P((const char *, FILE *));
|
||||
extern int unlink P((const char *));
|
||||
#endif
|
||||
extern int fflush P((FILE *));
|
||||
extern int fclose P((FILE *));
|
||||
extern FILE *popen P((const char *, const char *));
|
||||
extern int pclose P((FILE *));
|
||||
extern void abort P(());
|
||||
extern int isatty P((int));
|
||||
extern void exit P((int));
|
||||
extern int system P((const char *));
|
||||
extern int sscanf P((const char *, const char *, ...));
|
||||
#ifndef toupper
|
||||
extern int toupper P((int));
|
||||
#endif
|
||||
#ifndef tolower
|
||||
extern int tolower P((int));
|
||||
#endif
|
||||
|
||||
extern double pow P((double x, double y));
|
||||
extern double atof P((const char *));
|
||||
extern double strtod P((const char *, char **));
|
||||
extern int fstat P((int, struct stat *));
|
||||
extern int stat P((const char *, struct stat *));
|
||||
extern off_t lseek P((int, off_t, int));
|
||||
extern int fseek P((FILE *, long, int));
|
||||
extern int close P((int));
|
||||
extern int creat P((const char *, mode_t));
|
||||
extern int open P((const char *, int, ...));
|
||||
extern int pipe P((int *));
|
||||
extern int dup P((int));
|
||||
extern int dup2 P((int,int));
|
||||
extern int fork P(());
|
||||
extern int execl P((const char *, const char *, ...));
|
||||
#ifndef __STDC__
|
||||
extern int read P((int, void *, unsigned int));
|
||||
#endif
|
||||
#ifndef HAVE_SYS_WAIT_H
|
||||
extern int wait P((int *));
|
||||
#endif
|
||||
extern void _exit P((int));
|
||||
|
||||
#ifndef __STDC__
|
||||
extern long time P((long *));
|
||||
#endif
|
||||
|
||||
extern SPRINTF_RET sprintf P((char *, const char *, ...));
|
||||
|
||||
#undef aptr_t
|
||||
-5744
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
||||
Mon Jun 12 15:56:11 IDT 2000
|
||||
@@ -1,95 +0,0 @@
|
||||
#To: [email protected]
|
||||
#From: Kristján Jónasson <[email protected]>
|
||||
#Subject: Gawk bug
|
||||
#Cc: [email protected]
|
||||
#
|
||||
#Hi!
|
||||
#
|
||||
#The following seems to be a bug in gawk. I have tried as I could to
|
||||
#minimize the bug-causing program, so of course it does not seem to do
|
||||
#anything useful in its present form. The error message received is:
|
||||
#
|
||||
#gawk: test.awk:15: fatal error: internal error
|
||||
#Aborted
|
||||
#
|
||||
#Note that there is an attached file that the program reads, called "a". I
|
||||
#played with the program a fair bit and my feeling is that the error is
|
||||
#related with the delete statement, and not the reading of the file and the
|
||||
#close statement. At one point I was able to remove the file reading and
|
||||
#still obtain the error. If, for example, I remove the close statement and
|
||||
#make two copies of the file instead, (reading one copy in sub1 and the
|
||||
#other in sub2), the error still occurs.
|
||||
#
|
||||
#The operating system is Red Hat Linux, version 6.0, the gawk is version
|
||||
#3.0.4, and the gawk was obtained from an rpm file gawk-3.0.4-1.i386.rpm.
|
||||
#
|
||||
#The program is:
|
||||
#
|
||||
|
||||
# Wed Mar 8 13:41:34 IST 2000
|
||||
# ADR: modified to use INPUT, so can set it from command line.
|
||||
# When run, no output is produced, but it shouldn't core
|
||||
# dump, either.
|
||||
#
|
||||
# The program bug is to not close the file in sub2.
|
||||
|
||||
function sub1(x) {
|
||||
# while (getline < "a" == 1) i++
|
||||
while (getline < INPUT == 1) i++
|
||||
# close("a")
|
||||
close(INPUT)
|
||||
}
|
||||
|
||||
function sub2(x) {
|
||||
i=0
|
||||
delete y
|
||||
# while (getline < "a" == 1) z[++i] = $1
|
||||
while (getline < INPUT == 1) z[++i] = $1
|
||||
for(i in z) y[i] = x[i] + z[i]
|
||||
}
|
||||
|
||||
function sub3(x, y, z) {
|
||||
sub2(x)
|
||||
for(i=1; i<=4; i++) z[i] = y[i]
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
sub1(x)
|
||||
sub2(x)
|
||||
sub3(x, y, z)
|
||||
}
|
||||
#
|
||||
#And the data file is:
|
||||
#
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
# 32.440 3.830 3.383700000000000 10.08 298 865
|
||||
#
|
||||
#
|
||||
@@ -1,30 +0,0 @@
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
32.440 3.830 3.383700000000000 10.08 298 865
|
||||
Whitespace-only changes.
@@ -1 +0,0 @@
|
||||
BEGIN { n = 11 ; foo[n] = n; print (2 <= n) }
|
||||
@@ -1 +0,0 @@
|
||||
1
|
||||
@@ -1 +0,0 @@
|
||||
function foo() { print foo } {foo()}
|
||||
@@ -1 +0,0 @@
|
||||
foo
|
||||
@@ -1 +0,0 @@
|
||||
gawk: fnamedat.awk:1: (FILENAME=- FNR=1) fatal: can't use function name `foo' as variable or array
|
||||
@@ -1,31 +0,0 @@
|
||||
# fnparydl.awk --- check that deleting works with arrays
|
||||
# that are parameters.
|
||||
#
|
||||
# Tue Jul 11 14:20:58 EDT 2000
|
||||
|
||||
function delit(a, k)
|
||||
{
|
||||
print "BEFORE LOOP"
|
||||
for (k in a) {
|
||||
print "DELETING KEY", k
|
||||
delete a[k]
|
||||
}
|
||||
print "AFTER LOOP"
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
for (i = 1 ; i <= 7; i++) {
|
||||
q[i] = sprintf("element %d", i)
|
||||
x[i] = i
|
||||
y[i] = q[i]
|
||||
}
|
||||
# adump(q)
|
||||
delit(q)
|
||||
# for (i in q)
|
||||
# delete q[i]
|
||||
j = 0;
|
||||
for (i in q)
|
||||
j++
|
||||
print j, "elements still in q[]"
|
||||
# adump(q)
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
BEFORE LOOP
|
||||
DELETING KEY 4
|
||||
DELETING KEY 5
|
||||
DELETING KEY 6
|
||||
DELETING KEY 7
|
||||
DELETING KEY 1
|
||||
DELETING KEY 2
|
||||
DELETING KEY 3
|
||||
AFTER LOOP
|
||||
0 elements still in q[]
|
||||
@@ -1,6 +0,0 @@
|
||||
function foo( \
|
||||
foo)
|
||||
{
|
||||
print foo
|
||||
}
|
||||
{ foo() }
|
||||
@@ -1 +0,0 @@
|
||||
gawk: funsmnam.awk:6: fatal: function `foo': can't use function name as parameter name
|
||||
@@ -1,18 +0,0 @@
|
||||
#Date: Tue, 21 Dec 1999 16:11:07 +0100
|
||||
#From: Daniel Schnell <[email protected]>
|
||||
#To: [email protected]
|
||||
#CC: [email protected]
|
||||
#Subject: BUG in gawk (version 3.0.4 linux, windows): Text mangeling in between
|
||||
|
||||
# search for "@K@CODE" segment
|
||||
|
||||
$0 ~ /@K@CODE/ {
|
||||
# get next record
|
||||
getline temp
|
||||
printf ("@K@CODE\n")
|
||||
printf ("%s\n",temp)
|
||||
}
|
||||
|
||||
$0 !~ /@K@CODE/ {
|
||||
printf ("%s\n", $0)
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,111 +0,0 @@
|
||||
#From [email protected] Thu Jun 18 09:10 EDT 1998
|
||||
#Received: from mescaline.gnu.org ([email protected] [158.121.106.21]) by cssun.mathcs.emory.edu (8.7.5/8.6.9-940818.01cssun) with ESMTP id JAA23649 for <[email protected]>; Thu, 18 Jun 1998 09:10:54 -0400 (EDT)
|
||||
#Received: from khromeleque.dmat.uevora.pt by mescaline.gnu.org (8.8.5/8.6.12GNU) with ESMTP id JAA21732 for <[email protected]>; Thu, 18 Jun 1998 09:11:19 -0400
|
||||
#Received: from khromeleque.dmat.uevora.pt (vp@localhost [127.0.0.1])
|
||||
# by khromeleque.dmat.uevora.pt (8.8.8/8.8.8/Debian/GNU) with ESMTP id OAA11817
|
||||
# for <[email protected]>; Thu, 18 Jun 1998 14:13:57 +0100
|
||||
#Message-Id: <[email protected]>
|
||||
#To: [email protected]
|
||||
#Subject: concatenation bug in gawk 3.0.3
|
||||
#Date: Thu, 18 Jun 1998 14:13:57 +0200
|
||||
#From: Vasco Pedro <[email protected]>
|
||||
#Content-Type: text
|
||||
#Content-Length: 2285
|
||||
#Status: RO
|
||||
#
|
||||
#Hi,
|
||||
#
|
||||
#The gawk program '{print NR " " 10/NR}' will print:
|
||||
#
|
||||
#1 10
|
||||
#5 5
|
||||
#3 3.33333
|
||||
#2 2.5
|
||||
#2 2
|
||||
#1 1.66667
|
||||
#
|
||||
#instead of the correct:
|
||||
#
|
||||
#1 10
|
||||
#2 5
|
||||
#3 3.33333
|
||||
#4 2.5
|
||||
#5 2
|
||||
#6 1.66667
|
||||
#
|
||||
#You'll notice, on the incorrect output, that the first column is
|
||||
#the first digit of the second.
|
||||
#
|
||||
#I think the problem comes from the way builtin variables are handled.
|
||||
#Since the items to be concatenated are processed in reverse order and
|
||||
#the return value of tree_eval(``NR'') is a pointer to the value part
|
||||
#of `NR_node', the `unref()' of `NR_node' due to its second occurrence
|
||||
#will leave a dangling pointer in `strlist'. The reason that it doesn't
|
||||
#reuse the freed space with objects of the same type. (Using Electric
|
||||
#Fence with EF_PROTECT_FREE set confirms that freed space is being
|
||||
#accessed.)
|
||||
#
|
||||
#The enclosed patch (hack would be a better word to describe it) is
|
||||
#all I could come up with. With it installed, things seem to work ok,
|
||||
#but I doubt this is the correct way to do it. (If I treated the
|
||||
#case for `Node_field_spec' as the I did others, `make check' would
|
||||
#fail in several places.)
|
||||
#
|
||||
#Regards,
|
||||
#vasco
|
||||
#
|
||||
#*** eval.c~ Tue May 6 21:39:55 1997
|
||||
#--- eval.c Thu Jun 18 13:39:25 1998
|
||||
#***************
|
||||
#*** 685,697 ****
|
||||
# return func_call(tree->rnode, tree->lnode);
|
||||
#
|
||||
# /* unary operations */
|
||||
# case Node_NR:
|
||||
# case Node_FNR:
|
||||
# case Node_NF:
|
||||
# case Node_FIELDWIDTHS:
|
||||
# case Node_FS:
|
||||
# case Node_RS:
|
||||
#- case Node_field_spec:
|
||||
# case Node_subscript:
|
||||
# case Node_IGNORECASE:
|
||||
# case Node_OFS:
|
||||
#--- 685,700 ----
|
||||
# return func_call(tree->rnode, tree->lnode);
|
||||
#
|
||||
# /* unary operations */
|
||||
#+ case Node_field_spec:
|
||||
#+ lhs = get_lhs(tree, (Func_ptr *) NULL);
|
||||
#+ return *lhs;
|
||||
#+
|
||||
# case Node_NR:
|
||||
# case Node_FNR:
|
||||
# case Node_NF:
|
||||
# case Node_FIELDWIDTHS:
|
||||
# case Node_FS:
|
||||
# case Node_RS:
|
||||
# case Node_subscript:
|
||||
# case Node_IGNORECASE:
|
||||
# case Node_OFS:
|
||||
#***************
|
||||
#*** 699,705 ****
|
||||
# case Node_OFMT:
|
||||
# case Node_CONVFMT:
|
||||
# lhs = get_lhs(tree, (Func_ptr *) NULL);
|
||||
#! return *lhs;
|
||||
#
|
||||
# case Node_var_array:
|
||||
# fatal("attempt to use array `%s' in a scalar context",
|
||||
#--- 702,710 ----
|
||||
# case Node_OFMT:
|
||||
# case Node_CONVFMT:
|
||||
# lhs = get_lhs(tree, (Func_ptr *) NULL);
|
||||
#! r = dupnode(*lhs);
|
||||
#! r->flags |= TEMP;
|
||||
#! return r;
|
||||
#
|
||||
# case Node_var_array:
|
||||
# fatal("attempt to use array `%s' in a scalar context",
|
||||
#
|
||||
{ print NR " " 10/NR }
|
||||
@@ -1,6 +0,0 @@
|
||||
line 1
|
||||
line 2
|
||||
line 3
|
||||
line 4
|
||||
line 5
|
||||
line 6
|
||||
@@ -1,6 +0,0 @@
|
||||
1 10
|
||||
2 5
|
||||
3 3.33333
|
||||
4 2.5
|
||||
5 2
|
||||
6 1.66667
|
||||
@@ -1,75 +0,0 @@
|
||||
#From [email protected] Sat Oct 31 22:54:07 1998
|
||||
#Return-Path: <[email protected]>
|
||||
#Received: from cssun.mathcs.emory.edu (cssun.mathcs.emory.edu [170.140.150.1])
|
||||
# by amx.netvision.net.il (8.9.0.Beta5/8.8.6) with ESMTP id HAA08891
|
||||
# for <[email protected]>; Sat, 31 Oct 1998 07:14:07 +0200 (IST)
|
||||
#Received: from mescaline.gnu.org ([email protected] [158.121.106.21]) by cssun.mathcs.emory.edu (8.7.5/8.6.9-940818.01cssun) with ESMTP id AAA14947 for <[email protected]>; Sat, 31 Oct 1998 00:14:32 -0500 (EST)
|
||||
#Received: from gamgee.acad.emich.edu (gamgee.acad.emich.edu [164.76.102.76])
|
||||
# by mescaline.gnu.org (8.9.1a/8.9.1) with SMTP id AAA20645
|
||||
# for <[email protected]>; Sat, 31 Oct 1998 00:17:54 -0500
|
||||
#Received: by gamgee.acad.emich.edu (Smail3.1.29.1 #57)
|
||||
# id m0zZUKY-000IDSC; Sat, 31 Oct 98 00:16 CST
|
||||
#Message-Id: <[email protected]>
|
||||
#Date: Sat, 31 Oct 98 00:16 CST
|
||||
#From: [email protected] (David H. West)
|
||||
#To: [email protected]
|
||||
#Subject: gawk 3.0.3 bug report
|
||||
#Cc: [email protected]
|
||||
#X-UIDL: 7474b825cff989adf38f13883d84fdd7
|
||||
#Status: RO
|
||||
#
|
||||
#gawk version: 3.03
|
||||
#System used: Linux, kernel 2.0.28, libc 5.4.33, AMD K5PR133 (i586 clone)
|
||||
#Remark: There seems to be at least one bug shown by the demo below.
|
||||
# There may also be a Dark Corner involving the value of NR in an
|
||||
# END block, a topic on which the info file is silent. In gawk
|
||||
# 3.0.3, NR often seems to have the least-surprise value in an
|
||||
# END block, but sometimes it doesn't - see example below.
|
||||
#Problem descr: the log below shows a case where:
|
||||
# a) (this may be a red herring) the output of the gawk script
|
||||
# is different depending on whether its input file is named on
|
||||
# the command line or catted to stdin, without any use of the
|
||||
# legitimate means which could produce this effect.
|
||||
# b) NR is clearly getting clobbered; I have tried to simplify
|
||||
# the 19-line script "awkerr1" below, but seemingly unrelated
|
||||
# changes, like shortening constant strings which appear only in
|
||||
# print statements, or removing unexecuted or irrelevant code,
|
||||
# cause the clobbering to go away. Some previous (larger)
|
||||
# versions of this code would clobber NR also when reading from
|
||||
# stdin, but I thought you'd prefer a shorter example :-).
|
||||
#Reproduce-By: using the gawk script "awkerr1", the contents of
|
||||
# which appear in the transcript below as the output of the
|
||||
# command "cat awkerr1". Comments following # were added
|
||||
# to the transcript later as explanation.
|
||||
#---------------------------------------------- Script started on Fri
|
||||
#Oct 30 20:04:16 1998 chipmunk:/ram0# ls -l a1 awkerr1 -rw-r--r-- 1
|
||||
#root root 2 Oct 30 18:42 a1 -rwxr-xr-x 1 root root
|
||||
#389 Oct 30 19:54 awkerr1 chipmunk:/ram0# cat a1 #a1 contains
|
||||
#one printable char and a newline a chipmunk:/ram0# od -c xc a1
|
||||
#0000000 0a61
|
||||
# a \n
|
||||
#0000002 chipmunk:/ram0# cat a1 | awkerr1 #no surprises here
|
||||
#1 lines in 1 sec: 1 lines/sec; nlines=1 chipmunk:/ram0# awkerr1 a1 È
|
||||
#lines in 1 sec: 1 lines/sec; nlines=1 #?! first char is an uppercase
|
||||
#E-grave chipmunk:/ram0# awkerr1 a1 | od -N1 -xc 0000000 00c8
|
||||
# 310 \0
|
||||
#0000001 chipmunk:/ram0# cat awkerr1 #the apparent ^M's are not
|
||||
#actually in the file
|
||||
#!/usr/bin/awk -f
|
||||
function process(w) {
|
||||
if(w in ws) {
|
||||
printf " : found\n"; lc[p " " w]++; rc[w " " n]++; }
|
||||
}
|
||||
BEGIN {IGNORECASE=1;
|
||||
}
|
||||
/^/ {if(NR % 10 ==0)print "processing line " NR;
|
||||
process($1); nlines++;
|
||||
}
|
||||
END {p=w; w=n; n="";
|
||||
if(w)process(w); t=1; print NR " lines in " t " sec: " NR+0 " lines/sec; nlines=" nlines;
|
||||
}
|
||||
#chipmunk:/ram0# exit Script done on Fri Oct 30 20:07:31 1998
|
||||
#---------------------------------------------
|
||||
#
|
||||
#-David West [email protected]
|
||||
#
|
||||
@@ -1 +0,0 @@
|
||||
a
|
||||
@@ -1 +0,0 @@
|
||||
1 lines in 1 sec: 1 lines/sec; nlines=1
|
||||
@@ -1,2 +0,0 @@
|
||||
/@K@CODE/ { print ; getline temp ; print temp ;next }
|
||||
{print}
|
||||
@@ -1,56 +0,0 @@
|
||||
#From [email protected] Mon Feb 21 09:33:32 2000
|
||||
#Message-id: <[email protected]>
|
||||
#Date: 20 Feb 2000 18:14:11 EST
|
||||
#From: [email protected] (Jeffrey B. Woodward)
|
||||
#Subject: gawk 3.0.4 bug
|
||||
#To: [email protected]
|
||||
#Cc: [email protected]
|
||||
#
|
||||
#O/S: Digital UNIX 4.0D
|
||||
#
|
||||
#C Compiler: DEC C
|
||||
#
|
||||
#gawk version: 3.0.4
|
||||
#
|
||||
#Sample Program:
|
||||
#gawk '
|
||||
BEGIN {
|
||||
pattern[1] = "bar" ; ignore[1] = 1
|
||||
pattern[2] = "foo" ; ignore[2] = 0
|
||||
}
|
||||
|
||||
{
|
||||
for (i = 1 ; i <= 2 ; i++) {
|
||||
IGNORECASE = ignore[i]
|
||||
print match($0, pattern[i]) " " pattern[i] ":" $0
|
||||
}
|
||||
}
|
||||
#' << -EOF-
|
||||
#This is foo
|
||||
#This is bar
|
||||
#-EOF-
|
||||
#
|
||||
#Program Output:
|
||||
#0 bar:This is foo
|
||||
#0 foo:This is foo
|
||||
#9 bar:This is bar
|
||||
#9 foo:This is bar
|
||||
#
|
||||
#
|
||||
#**Expected** Output:
|
||||
#0 bar:This is foo
|
||||
#9 foo:This is foo
|
||||
#9 bar:This is bar
|
||||
#0 foo:This is bar
|
||||
#
|
||||
#
|
||||
#This problem appears to be directly related to IGNORECASE. If
|
||||
#IGNORECASE remains constant, the program behaves as expected;
|
||||
#however, switching IGNORECASE seems to causes problems - it is
|
||||
#almost as though the pattern stored in the variable is treated
|
||||
#as a constant and the regexp() is not recompiled(?) - just a
|
||||
#guess...
|
||||
#
|
||||
#
|
||||
#Thanks,
|
||||
#-Jeff Woodward
|
||||
@@ -1,2 +0,0 @@
|
||||
This is foo
|
||||
This is bar
|
||||
@@ -1,4 +0,0 @@
|
||||
0 bar:This is foo
|
||||
9 foo:This is foo
|
||||
9 bar:This is bar
|
||||
0 foo:This is bar
|
||||
@@ -1,92 +0,0 @@
|
||||
#From [email protected] Tue Oct 13 22:15:59 1998
|
||||
#Return-Path: <[email protected]>
|
||||
#Received: from cssun.mathcs.emory.edu (cssun.mathcs.emory.edu [170.140.150.1])
|
||||
# by dmx.netvision.net.il (8.9.0.Beta5/8.8.6) with ESMTP id PAA03924
|
||||
# for <[email protected]>; Tue, 13 Oct 1998 15:32:13 +0200 (IST)
|
||||
#Received: from mescaline.gnu.org ([email protected] [158.121.106.21]) by cssun.mathcs.emory.edu (8.7.5/8.6.9-940818.01cssun) with ESMTP id KAA11644 for <[email protected]>; Tue, 13 Oct 1998 10:22:32 -0400 (EDT)
|
||||
#Received: from manatee.dms.auburn.edu (manatee.dms.auburn.edu [131.204.53.104])
|
||||
# by mescaline.gnu.org (8.9.1a/8.9.1) with ESMTP id KAA03250
|
||||
# for <[email protected]>; Tue, 13 Oct 1998 10:25:32 -0400
|
||||
#Received: (from hankedr@localhost)
|
||||
# by manatee.dms.auburn.edu (8.9.1a/8.9.1) id JAA13348;
|
||||
# Tue, 13 Oct 1998 09:22:29 -0500 (CDT)
|
||||
#Date: Tue, 13 Oct 1998 09:22:29 -0500 (CDT)
|
||||
#Message-Id: <[email protected]>
|
||||
#From: Darrel Hankerson <[email protected]>
|
||||
#To: [email protected]
|
||||
#In-reply-to: <[email protected]> (message from
|
||||
# Aharon Robbins on Tue, 13 Oct 1998 16:10:36 +0200)
|
||||
#Subject: Re: full text of bug report?
|
||||
#Mime-Version: 1.0
|
||||
#Content-Type: text/plain; charset=US-ASCII
|
||||
#X-UIDL: bf3fce492dad4ab030c561e7b2f27d0a
|
||||
#Status: RO
|
||||
#
|
||||
# Do you have the full text of the a = a "\n" f() bug report?
|
||||
# I can't find it.... I'm not sure there really is a bug.
|
||||
#
|
||||
#Yes, see below.
|
||||
#
|
||||
#His example has unnecessary fragments (in particular, the use of
|
||||
#gensub is irrelevant). As I wrote to you earlier, the interesting
|
||||
#question for me is:
|
||||
#
|
||||
# Is the concatenation result undefined? If the result is defined or
|
||||
# implementation-dependent, then gawk has a bug.
|
||||
#
|
||||
#
|
||||
#=== Original report =====================================================
|
||||
#From: Attila Torcsvari <[email protected]>
|
||||
#To: "'[email protected]'" <[email protected]>
|
||||
#Subject: gawk 3.0.3 bug
|
||||
#Date: Thu, 17 Sep 1998 18:12:13 +0200
|
||||
#MIME-Version: 1.0
|
||||
#Content-Transfer-Encoding: 7bit
|
||||
#Resent-From: [email protected]
|
||||
#X-Mailing-List: <[email protected]> archive/latest/3396
|
||||
#X-Loop: [email protected]
|
||||
#Precedence: list
|
||||
#Resent-Sender: [email protected]
|
||||
#Content-Transfer-Encoding: 7bit
|
||||
#Content-Type: text/plain; charset="us-ascii"
|
||||
#Content-Length: 618
|
||||
#
|
||||
#Bug-gnuers,
|
||||
#please pass it to the responsible.
|
||||
#
|
||||
#The following generates something interesting:
|
||||
#
|
||||
BEGIN{
|
||||
a="aaaaa"
|
||||
a=a a #10
|
||||
a=a a #20
|
||||
a=a a #40
|
||||
a=a a #80
|
||||
a=a a #160
|
||||
a=a a # i.e. a is long enough
|
||||
|
||||
a=a"\n"f() # this causes the trouble
|
||||
print a # guess the result
|
||||
}
|
||||
|
||||
function f()
|
||||
{
|
||||
#print "a before: ", a
|
||||
#a=gensub("a","123,","g",a) # 'a' will be just a bit longer (4 times, but still should fit: 4*160=640)
|
||||
gsub(/a/, "123", a)
|
||||
#print "a after: ", a
|
||||
return "X"
|
||||
}
|
||||
#
|
||||
#Possible reason:
|
||||
#during f the a is modified,
|
||||
#it can be even freed, because gensub modifies its size
|
||||
#the printout contains trash.
|
||||
#
|
||||
#Used version: VC compiled WinNT 32 bit Intel.
|
||||
#
|
||||
#Regards,
|
||||
#
|
||||
#Attila Torcsvari
|
||||
#Arcanum Development
|
||||
#
|
||||
@@ -1,2 +0,0 @@
|
||||
123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123
|
||||
X
|
||||
@@ -1,77 +0,0 @@
|
||||
# From [email protected] Wed Aug 2 13:16:53 2000
|
||||
# Received: from mail.actcom.co.il
|
||||
# by localhost with POP3 (fetchmail-5.1.2)
|
||||
# for arnold@localhost (single-drop); Wed, 02 Aug 2000 13:16:53 -0400 (EDT)
|
||||
# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP
|
||||
# (8.9.1a/actcom-0.2) id MAA21699 for <[email protected]>;
|
||||
# Wed, 2 Aug 2000 12:20:38 +0300 (EET DST)
|
||||
# (rfc931-sender: lmail.actcom.co.il [192.114.47.13])
|
||||
# Received: from freefriends.org (freefriends.org [63.85.55.109])
|
||||
# by lmail.actcom.co.il (8.9.3/8.9.1) with ESMTP id LAA22723
|
||||
# for <[email protected]>; Wed, 2 Aug 2000 11:23:22 +0300
|
||||
# Received: from mescaline.gnu.org (mescaline.gnu.org [158.121.106.21])
|
||||
# by freefriends.org (8.9.3/8.9.3) with ESMTP id FAA23582
|
||||
# for <[email protected]>; Wed, 2 Aug 2000 05:18:59 -0400
|
||||
# Received: from dep.chem.rug.nl (dep.chem.rug.nl [129.125.7.81])
|
||||
# by mescaline.gnu.org (8.9.1a/8.9.1) with ESMTP id FAA30670;
|
||||
# Wed, 2 Aug 2000 05:20:24 -0400
|
||||
# Received: from rugmd34.chem.rug.nl (rugmd34.chem.rug.nl [129.125.42.34])
|
||||
# by dep.chem.rug.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA17089;
|
||||
# Wed, 2 Aug 2000 11:20:23 +0200
|
||||
# Received: from chem.rug.nl (localhost [127.0.0.1]) by rugmd34.chem.rug.nl (980427.SGI.8.8.8/980728.SGI.AUTOCF) via ESMTP id LAA25392; Wed, 2 Aug 2000 11:20:22 +0200 (MDT)
|
||||
# Sender: [email protected]
|
||||
# Message-ID: <[email protected]>
|
||||
# Date: Wed, 02 Aug 2000 11:20:21 +0200
|
||||
# From: Eiso AB <[email protected]>
|
||||
# X-Mailer: Mozilla 4.72C-SGI [en] (X11; I; IRIX 6.5 IP32)
|
||||
# X-Accept-Language: en
|
||||
# MIME-Version: 1.0
|
||||
# To: [email protected], [email protected]
|
||||
# Subject: bug? [GNU Awk 3.0.5]
|
||||
#
|
||||
# Content-Type: text/plain; charset=us-ascii
|
||||
# Content-Transfer-Encoding: 7bit
|
||||
# X-UIDL: \f8"!(8G!!ZL$#!h>X!!
|
||||
# Status: R
|
||||
#
|
||||
# hi Arnold,
|
||||
#
|
||||
#
|
||||
# Please try the script beneath...
|
||||
# I'm not sure if this is a bug or not, but I would expect
|
||||
# the empty string as an array index just to be treated
|
||||
# like any other string
|
||||
#
|
||||
# so if ("" in ta) would be true, and for ( i in ta ) should loop only once.
|
||||
#
|
||||
BEGIN {
|
||||
v=""
|
||||
ta[v]++
|
||||
if ( v in ta) print "a",v,++ta[v],ta[v]
|
||||
print "b",v,++ta[v],ta[v]
|
||||
for( i in ta) print "c",++c,i,ta[i]
|
||||
}
|
||||
#
|
||||
# goodluck, Eiso
|
||||
#
|
||||
# --
|
||||
# _________
|
||||
# _______________________________/ Eiso AB \_________________________
|
||||
#
|
||||
# o
|
||||
#
|
||||
# o Dept. of Biochemistry
|
||||
# University of Groningen
|
||||
# The Netherlands
|
||||
# o
|
||||
# . .
|
||||
# o ^ mailto:[email protected]
|
||||
# | - _ mailto:[email protected]
|
||||
# \__|__/ http://md.chem.rug.nl/~eiso
|
||||
# | tel 4326
|
||||
# |
|
||||
# / \
|
||||
# / \
|
||||
# | |
|
||||
# ________ ._| |_. ________________________________________________
|
||||
#
|
||||
@@ -1,3 +0,0 @@
|
||||
a 2 2
|
||||
b 3 3
|
||||
c 1 3
|
||||
@@ -1,55 +0,0 @@
|
||||
#To: [email protected]
|
||||
#cc: [email protected]
|
||||
#Subject: Possible bug in GNU Awk 3.0.4
|
||||
#Date: Wed, 24 Nov 1999 21:47:24 +0000
|
||||
#From: Daniel Elphick <[email protected]>
|
||||
#Message-Id: <E11qkG4-0000l0-00@cameron>
|
||||
#
|
||||
#This is a multipart MIME message.
|
||||
#
|
||||
#--==_Exmh_-11192982200
|
||||
#Content-Type: text/plain; charset=us-ascii
|
||||
#
|
||||
#
|
||||
#When I use the attached awk script unique on the attached data file, it
|
||||
#reports that all 4 lines of the data are the same. Using mawk it correctly
|
||||
#reports that there are no repeats.
|
||||
#
|
||||
#I don't know if there are limits on the size of associative array keys for the
|
||||
#purposes of reliable indexing but if there is then it is not (obviously)
|
||||
#documented.
|
||||
#
|
||||
#
|
||||
#--==_Exmh_-11192982200
|
||||
#Content-Type: text/plain ; name="data"; charset=us-ascii
|
||||
#Content-Description: data
|
||||
#Content-Disposition: attachment; filename="data"
|
||||
#
|
||||
#322322111111112232231111
|
||||
#322322111111112213223111
|
||||
#322322111111112211132231
|
||||
#322322111111112211113223
|
||||
#
|
||||
#--==_Exmh_-11192982200
|
||||
#Content-Type: text/plain ; name="unique"; charset=us-ascii
|
||||
#Content-Description: unique
|
||||
#Content-Disposition: attachment; filename="unique"
|
||||
#
|
||||
{
|
||||
if($0 in a)
|
||||
{
|
||||
printf("line %d has been seen before at line %d\n", NR, a[$0])
|
||||
repeat_count += 1
|
||||
}
|
||||
else
|
||||
{
|
||||
a[$0] = NR
|
||||
}
|
||||
count += 1
|
||||
}
|
||||
END {
|
||||
# printf("%d %f%%\n", repeat_count, (float)repeat_count / count * 100)
|
||||
printf("%d %f%%\n", repeat_count, repeat_count / count * 100)
|
||||
}
|
||||
#
|
||||
#--==_Exmh_-11192982200--
|
||||
@@ -1,4 +0,0 @@
|
||||
322322111111112232231111
|
||||
322322111111112213223111
|
||||
322322111111112211132231
|
||||
322322111111112211113223
|
||||
@@ -1 +0,0 @@
|
||||
0 0.000000%
|
||||
@@ -1 +0,0 @@
|
||||
BEGIN { b = 1; a[b] = 2; a[b++] += 1; print b,a[1] }
|
||||
@@ -1 +0,0 @@
|
||||
2 3
|
||||
@@ -1,6 +0,0 @@
|
||||
BEGIN {
|
||||
print b += b += 1
|
||||
b = 6
|
||||
print b += b++
|
||||
print b
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
2
|
||||
13
|
||||
13
|
||||
@@ -1,19 +0,0 @@
|
||||
# Tue May 25 16:36:16 IDT 1999
|
||||
#
|
||||
# Test cases based on email from Andreas Schwab, [email protected]
|
||||
|
||||
BEGIN {
|
||||
fmt[1] = "%8.5d"; data[1] = 100
|
||||
fmt[2] = "%#o"; data[2] = 0
|
||||
fmt[3] = "%#.1o"; data[3] = 0
|
||||
fmt[4] = "%#.0o"; data[4] = 0
|
||||
fmt[5] = "%#x"; data[5] = 0
|
||||
fmt[6] = "%.0d"; data[6] = 0
|
||||
fmt[7] = "%5.0d"; data[7] = 0
|
||||
|
||||
for (i = 1; i <= 7; i++) {
|
||||
format = "%s, %d --- |" fmt[i] "|\n"
|
||||
printf(format, fmt[i], data[i], data[i])
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
%8.5d, 100 --- | 00100|
|
||||
%#o, 0 --- |0|
|
||||
%#.1o, 0 --- |0|
|
||||
%#.0o, 0 --- |0|
|
||||
%#x, 0 --- |0|
|
||||
%.0d, 0 --- ||
|
||||
%5.0d, 0 --- | |
|
||||
@@ -1 +0,0 @@
|
||||
BEGIN { print exp(0), exp(1000000), exp(0.5) }
|
||||
@@ -1,2 +0,0 @@
|
||||
1 gawk: reg/exp.awk:1: warning: exp argument 1e+06 is out of range
|
||||
Inf 1.64872
|
||||
Whitespace-only changes.
@@ -1 +0,0 @@
|
||||
BEGIN { print log(0), log(-1), log(100) }
|
||||
@@ -1,4 +0,0 @@
|
||||
log: SING error
|
||||
-Inf gawk: reg/log.awk:1: warning: log called with negative argument -1
|
||||
log: DOMAIN error
|
||||
NaN 4.60517
|
||||
Whitespace-only changes.
@@ -1,15 +0,0 @@
|
||||
# strftime.awk ; test the strftime code
|
||||
#
|
||||
# input is the output of `date', see Makefile.in
|
||||
#
|
||||
# The mucking about with $0 and $N is to avoid problems
|
||||
# on cygwin, where the timezone field is empty and there
|
||||
# are two consecutive blanks.
|
||||
|
||||
{
|
||||
$3 = sprintf("%02d", $3 + 0)
|
||||
print > "strftime.ok"
|
||||
$0 = strftime()
|
||||
$NF = $NF
|
||||
print > OUTPUT
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
BEGIN {
|
||||
i = 2
|
||||
a[i] = 5
|
||||
a[i] /= 2
|
||||
printf "a[%s] = %f\n", i, a[i]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
a[2] = 2.500000
|
||||
@@ -1 +0,0 @@
|
||||
BEGIN { printf("%2.1d---%02.1d\n", 2, 2) }
|
||||
@@ -1 +0,0 @@
|
||||
2--- 2
|
||||
@@ -1,99 +0,0 @@
|
||||
$FreeBSD$
|
||||
CVS
|
||||
testsuite
|
||||
.cvsignore
|
||||
config.if
|
||||
mkdep
|
||||
*COPYING*
|
||||
etc
|
||||
*-hp*
|
||||
*-macos*
|
||||
*-ncr*
|
||||
*.bat
|
||||
*.com
|
||||
*.info*
|
||||
arlex.c
|
||||
arparse.[ch]
|
||||
deflex.c
|
||||
gprof
|
||||
itbl-lex.c
|
||||
itbl-parse.[ch]
|
||||
ldgram.[ch]
|
||||
ldlex.c
|
||||
sysinfo.[ch]
|
||||
syslex.c
|
||||
testsuite
|
||||
texinfo
|
||||
*10[23]00*
|
||||
*532*
|
||||
*[a-z]29k*
|
||||
*[a-z][89]60*
|
||||
*_be*
|
||||
*a68*
|
||||
*adobe*
|
||||
*aix*
|
||||
*apollo*
|
||||
*beos*
|
||||
*bout*
|
||||
*cisco*
|
||||
*d10v*
|
||||
*delt88*
|
||||
*delta*
|
||||
*dgux*
|
||||
*djgpp*
|
||||
*dos*
|
||||
*dpx2*
|
||||
*dynix*
|
||||
*epoc*
|
||||
*go32*
|
||||
*h8[35]00*
|
||||
*hp300*
|
||||
*hp[-.]*
|
||||
*hppa*
|
||||
*hpux*
|
||||
*interix*
|
||||
*irix*
|
||||
*lynx*
|
||||
*m32r*
|
||||
*m[68]8k*
|
||||
*mac-*
|
||||
*mach*
|
||||
*mcore*
|
||||
*mpw*
|
||||
*netware*
|
||||
*news*
|
||||
*nlm*
|
||||
*ns32*
|
||||
*oasys*
|
||||
*os9*
|
||||
*pei*
|
||||
*pmac*
|
||||
*psos*
|
||||
*pyr*
|
||||
*riscix*
|
||||
*riscos*
|
||||
*rs6000*
|
||||
*sa29200*
|
||||
*shpe*
|
||||
*som*
|
||||
*st2000*
|
||||
*sun*
|
||||
*symmetry*
|
||||
*tahoe*
|
||||
*u68k*
|
||||
*vax*
|
||||
*vms*
|
||||
*vxworks*
|
||||
*w65*
|
||||
*we32k*
|
||||
*win*
|
||||
*xcoff*
|
||||
*i370*
|
||||
*avr*
|
||||
*tic54x*
|
||||
*tic80*
|
||||
*d30v*
|
||||
*fr30*
|
||||
*-sh.*
|
||||
*pj*
|
||||
*ver.texi
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
/* Name of package. */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version of package. */
|
||||
#undef VERSION
|
||||
|
||||
/* Whether strstr must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_STRSTR
|
||||
|
||||
/* Whether malloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_MALLOC
|
||||
|
||||
/* Whether realloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_REALLOC
|
||||
|
||||
/* Whether free must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_FREE
|
||||
|
||||
/* Whether getenv must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_GETENV
|
||||
@TOP@
|
||||
|
||||
/* Do we need to use the b modifier when opening binary files? */
|
||||
#undef USE_BINARY_FOPEN
|
||||
|
||||
/* Name of host specific header file to include in trad-core.c. */
|
||||
#undef TRAD_HEADER
|
||||
|
||||
/* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */
|
||||
#undef HAVE_SYS_PROCFS_H
|
||||
|
||||
/* Do we really want to use mmap if it's available? */
|
||||
#undef USE_MMAP
|
||||
@@ -1,92 +0,0 @@
|
||||
/* An abstract string datatype.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Contributed by Mark Mitchell (mark@markmitchell.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
typedef struct dyn_string
|
||||
{
|
||||
int allocated; /* The amount of space allocated for the string. */
|
||||
int length; /* The actual length of the string. */
|
||||
char *s; /* The string itself, NUL-terminated. */
|
||||
}* dyn_string_t;
|
||||
|
||||
/* The length STR, in bytes, not including the terminating NUL. */
|
||||
#define dyn_string_length(STR) \
|
||||
((STR)->length)
|
||||
|
||||
/* The NTBS in which the contents of STR are stored. */
|
||||
#define dyn_string_buf(STR) \
|
||||
((STR)->s)
|
||||
|
||||
/* Compare DS1 to DS2 with strcmp. */
|
||||
#define dyn_string_compare(DS1, DS2) \
|
||||
(strcmp ((DS1)->s, (DS2)->s))
|
||||
|
||||
|
||||
/* dyn_string functions are used in the demangling implementation
|
||||
included in the G++ runtime library. To prevent collisions with
|
||||
names in user programs, the functions that are used in the
|
||||
demangler are given implementation-reserved names. */
|
||||
|
||||
#ifdef IN_LIBGCC2
|
||||
|
||||
#define dyn_string_init __cxa_dyn_string_init
|
||||
#define dyn_string_new __cxa_dyn_string_new
|
||||
#define dyn_string_delete __cxa_dyn_string_delete
|
||||
#define dyn_string_release __cxa_dyn_string_release
|
||||
#define dyn_string_resize __cxa_dyn_string_resize
|
||||
#define dyn_string_clear __cxa_dyn_string_clear
|
||||
#define dyn_string_copy __cxa_dyn_string_copy
|
||||
#define dyn_string_copy_cstr __cxa_dyn_string_copy_cstr
|
||||
#define dyn_string_prepend __cxa_dyn_string_prepend
|
||||
#define dyn_string_prepend_cstr __cxa_dyn_string_prepend_cstr
|
||||
#define dyn_string_insert __cxa_dyn_string_insert
|
||||
#define dyn_string_insert_cstr __cxa_dyn_string_insert_cstr
|
||||
#define dyn_string_insert_char __cxa_dyn_string_insert_char
|
||||
#define dyn_string_append __cxa_dyn_string_append
|
||||
#define dyn_string_append_cstr __cxa_dyn_string_append_cstr
|
||||
#define dyn_string_append_char __cxa_dyn_string_append_char
|
||||
#define dyn_string_substring __cxa_dyn_string_substring
|
||||
#define dyn_string_eq __cxa_dyn_string_eq
|
||||
|
||||
#endif /* IN_LIBGCC2 */
|
||||
|
||||
|
||||
extern int dyn_string_init PARAMS ((struct dyn_string *, int));
|
||||
extern dyn_string_t dyn_string_new PARAMS ((int));
|
||||
extern void dyn_string_delete PARAMS ((dyn_string_t));
|
||||
extern char *dyn_string_release PARAMS ((dyn_string_t));
|
||||
extern dyn_string_t dyn_string_resize PARAMS ((dyn_string_t, int));
|
||||
extern void dyn_string_clear PARAMS ((dyn_string_t));
|
||||
extern int dyn_string_copy PARAMS ((dyn_string_t, dyn_string_t));
|
||||
extern int dyn_string_copy_cstr PARAMS ((dyn_string_t, const char *));
|
||||
extern int dyn_string_prepend PARAMS ((dyn_string_t, dyn_string_t));
|
||||
extern int dyn_string_prepend_cstr PARAMS ((dyn_string_t, const char *));
|
||||
extern int dyn_string_insert PARAMS ((dyn_string_t, int,
|
||||
dyn_string_t));
|
||||
extern int dyn_string_insert_cstr PARAMS ((dyn_string_t, int,
|
||||
const char *));
|
||||
extern int dyn_string_insert_char PARAMS ((dyn_string_t, int, int));
|
||||
extern int dyn_string_append PARAMS ((dyn_string_t, dyn_string_t));
|
||||
extern int dyn_string_append_cstr PARAMS ((dyn_string_t, const char *));
|
||||
extern int dyn_string_append_char PARAMS ((dyn_string_t, int));
|
||||
extern int dyn_string_substring PARAMS ((dyn_string_t,
|
||||
dyn_string_t, int, int));
|
||||
extern int dyn_string_eq PARAMS ((dyn_string_t, dyn_string_t));
|
||||
@@ -1,58 +0,0 @@
|
||||
/* AVR ELF support for BFD.
|
||||
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
Contributed by Denis Chertykov <denisc@overta.ru>
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_AVR_H
|
||||
#define _ELF_AVR_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Processor specific flags for the ELF header e_flags field. */
|
||||
#define EF_AVR_MACH 0xf
|
||||
|
||||
#define E_AVR_MACH_AVR1 1
|
||||
#define E_AVR_MACH_AVR2 2
|
||||
#define E_AVR_MACH_AVR3 3
|
||||
#define E_AVR_MACH_AVR4 4
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_avr_reloc_type)
|
||||
RELOC_NUMBER (R_AVR_NONE, 0)
|
||||
RELOC_NUMBER (R_AVR_32, 1)
|
||||
RELOC_NUMBER (R_AVR_7_PCREL, 2)
|
||||
RELOC_NUMBER (R_AVR_13_PCREL, 3)
|
||||
RELOC_NUMBER (R_AVR_16, 4)
|
||||
RELOC_NUMBER (R_AVR_16_PM, 5)
|
||||
RELOC_NUMBER (R_AVR_LO8_LDI, 6)
|
||||
RELOC_NUMBER (R_AVR_HI8_LDI, 7)
|
||||
RELOC_NUMBER (R_AVR_HH8_LDI, 8)
|
||||
RELOC_NUMBER (R_AVR_LO8_LDI_NEG, 9)
|
||||
RELOC_NUMBER (R_AVR_HI8_LDI_NEG, 10)
|
||||
RELOC_NUMBER (R_AVR_HH8_LDI_NEG, 11)
|
||||
RELOC_NUMBER (R_AVR_LO8_LDI_PM, 12)
|
||||
RELOC_NUMBER (R_AVR_HI8_LDI_PM, 13)
|
||||
RELOC_NUMBER (R_AVR_HH8_LDI_PM, 14)
|
||||
RELOC_NUMBER (R_AVR_LO8_LDI_PM_NEG, 15)
|
||||
RELOC_NUMBER (R_AVR_HI8_LDI_PM_NEG, 16)
|
||||
RELOC_NUMBER (R_AVR_HH8_LDI_PM_NEG, 17)
|
||||
RELOC_NUMBER (R_AVR_CALL, 18)
|
||||
EMPTY_RELOC (R_AVR_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#endif /* _ELF_AVR_H */
|
||||
@@ -1,38 +0,0 @@
|
||||
/* d10v ELF support for BFD.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_D10V_H
|
||||
#define _ELF_D10V_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocation types. */
|
||||
START_RELOC_NUMBERS (elf_d10v_reloc_type)
|
||||
RELOC_NUMBER (R_D10V_NONE, 0)
|
||||
RELOC_NUMBER (R_D10V_10_PCREL_R, 1)
|
||||
RELOC_NUMBER (R_D10V_10_PCREL_L, 2)
|
||||
RELOC_NUMBER (R_D10V_16, 3)
|
||||
RELOC_NUMBER (R_D10V_18, 4)
|
||||
RELOC_NUMBER (R_D10V_18_PCREL, 5)
|
||||
RELOC_NUMBER (R_D10V_32, 6)
|
||||
RELOC_NUMBER (R_D10V_GNU_VTINHERIT, 7)
|
||||
RELOC_NUMBER (R_D10V_GNU_VTENTRY, 8)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#endif
|
||||
@@ -1,42 +0,0 @@
|
||||
/* d30v ELF support for BFD.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_D30V_H
|
||||
#define _ELF_D30V_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_d30v_reloc_type)
|
||||
RELOC_NUMBER (R_D30V_NONE, 0)
|
||||
RELOC_NUMBER (R_D30V_6, 1)
|
||||
RELOC_NUMBER (R_D30V_9_PCREL, 2)
|
||||
RELOC_NUMBER (R_D30V_9_PCREL_R, 3)
|
||||
RELOC_NUMBER (R_D30V_15, 4)
|
||||
RELOC_NUMBER (R_D30V_15_PCREL, 5)
|
||||
RELOC_NUMBER (R_D30V_15_PCREL_R, 6)
|
||||
RELOC_NUMBER (R_D30V_21, 7)
|
||||
RELOC_NUMBER (R_D30V_21_PCREL, 8)
|
||||
RELOC_NUMBER (R_D30V_21_PCREL_R, 9)
|
||||
RELOC_NUMBER (R_D30V_32, 10)
|
||||
RELOC_NUMBER (R_D30V_32_PCREL, 11)
|
||||
RELOC_NUMBER (R_D30V_32_NORMAL, 12)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#endif
|
||||
@@ -1,43 +0,0 @@
|
||||
/* FR30 ELF support for BFD.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_FR30_H
|
||||
#define _ELF_FR30_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_fr30_reloc_type)
|
||||
RELOC_NUMBER (R_FR30_NONE, 0)
|
||||
RELOC_NUMBER (R_FR30_8, 1)
|
||||
RELOC_NUMBER (R_FR30_20, 2)
|
||||
RELOC_NUMBER (R_FR30_32, 3)
|
||||
RELOC_NUMBER (R_FR30_48, 4)
|
||||
RELOC_NUMBER (R_FR30_6_IN_4, 5)
|
||||
RELOC_NUMBER (R_FR30_8_IN_8, 6)
|
||||
RELOC_NUMBER (R_FR30_9_IN_8, 7)
|
||||
RELOC_NUMBER (R_FR30_10_IN_8, 8)
|
||||
RELOC_NUMBER (R_FR30_9_PCREL, 9)
|
||||
RELOC_NUMBER (R_FR30_12_PCREL, 10)
|
||||
RELOC_NUMBER (R_FR30_GNU_VTINHERIT, 11)
|
||||
RELOC_NUMBER (R_FR30_GNU_VTENTRY, 12)
|
||||
EMPTY_RELOC (R_FR30_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#endif /* _ELF_FR30_H */
|
||||
@@ -1,336 +0,0 @@
|
||||
/* HPPA ELF support for BFD.
|
||||
Copyright (C) 1993, 1994, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file holds definitions specific to the HPPA ELF ABI. Note
|
||||
that most of this is not actually implemented by BFD. */
|
||||
|
||||
#ifndef _ELF_HPPA_H
|
||||
#define _ELF_HPPA_H
|
||||
|
||||
/* Processor specific flags for the ELF header e_flags field. */
|
||||
|
||||
/* Trap null address dereferences. */
|
||||
#define EF_PARISC_TRAPNIL 0x00010000
|
||||
|
||||
/* .PARISC.archext section is present. */
|
||||
#define EF_PARISC_EXT 0x00020000
|
||||
|
||||
/* Program expects little-endian mode. */
|
||||
#define EF_PARISC_LSB 0x00040000
|
||||
|
||||
/* Program expects wide mode. */
|
||||
#define EF_PARISC_WIDE 0x00080000
|
||||
|
||||
/* Do not allow kernel-assisted branch prediction. */
|
||||
#define EF_PARISC_NO_KABP 0x00100000
|
||||
|
||||
/* Allow lazy swap for dynamically allocated program segments. */
|
||||
#define EF_PARISC_LAZYSWAP 0x00400000
|
||||
|
||||
/* Architecture version */
|
||||
#define EF_PARISC_ARCH 0x0000ffff
|
||||
|
||||
#define EFA_PARISC_1_0 0x020b
|
||||
#define EFA_PARISC_1_1 0x0210
|
||||
#define EFA_PARISC_2_0 0x0214
|
||||
|
||||
/* Special section indices. */
|
||||
/* A symbol that has been declared as a tentative definition in an ANSI C
|
||||
compilation. */
|
||||
#define SHN_PARISC_ANSI_COMMON 0xff00
|
||||
|
||||
/* A symbol that has been declared as a common block using the
|
||||
huge memory model. */
|
||||
#define SHN_PARISC_HUGE_COMMON 0xff01
|
||||
|
||||
/* Processor specific section types. */
|
||||
|
||||
/* Section contains product specific extension bits. */
|
||||
#define SHT_PARISC_EXT 0x70000000
|
||||
|
||||
/* Section contains unwind table entries. */
|
||||
#define SHT_PARISC_UNWIND 0x70000001
|
||||
|
||||
/* Section contains debug information for optimized code. */
|
||||
#define SHT_PARISC_DOC 0x70000002
|
||||
|
||||
/* Section contains code annotations. */
|
||||
#define SHT_PARISC_ANNOT 0x70000003
|
||||
|
||||
/* These are strictly for compatibility with the older elf32-hppa
|
||||
implementation. Hopefully we can eliminate them in the future. */
|
||||
/* Optional section holding argument location/relocation info. */
|
||||
#define SHT_PARISC_SYMEXTN SHT_LOPROC+8
|
||||
|
||||
/* Option section for linker stubs. */
|
||||
#define SHT_PARISC_STUBS SHT_LOPROC+9
|
||||
|
||||
/* Processor specific section flags. */
|
||||
|
||||
/* Section contains code compiled for static branch prediction. */
|
||||
#define SHF_PARISC_SBP 0x80000000
|
||||
|
||||
/* Section should be allocated from from GP. */
|
||||
#define SHF_PARISC_HUGE 0x40000000
|
||||
|
||||
/* Section should go near GP. */
|
||||
#define SHF_PARISC_SHORT 0x20000000
|
||||
|
||||
|
||||
/* Identifies the entry point of a millicode routine. */
|
||||
#define STT_PARISC_MILLI 13
|
||||
|
||||
/* ELF/HPPA relocation types */
|
||||
|
||||
/* Note: PA-ELF is defined to use only RELA relocations. */
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
START_RELOC_NUMBERS (elf_hppa_reloc_type)
|
||||
RELOC_NUMBER (R_PARISC_NONE, 0) /* No reloc */
|
||||
|
||||
/* These relocation types do simple base + offset relocations. */
|
||||
|
||||
RELOC_NUMBER (R_PARISC_DIR32, 1)
|
||||
RELOC_NUMBER (R_PARISC_DIR21L, 2)
|
||||
RELOC_NUMBER (R_PARISC_DIR17R, 3)
|
||||
RELOC_NUMBER (R_PARISC_DIR17F, 4)
|
||||
RELOC_NUMBER (R_PARISC_DIR14R, 6)
|
||||
|
||||
/* PC-relative relocation types
|
||||
Typically used for calls.
|
||||
Note PCREL17C and PCREL17F differ only in overflow handling.
|
||||
PCREL17C never reports a relocation error.
|
||||
|
||||
When supporting argument relocations, function calls must be
|
||||
accompanied by parameter relocation information. This information is
|
||||
carried in the ten high-order bits of the addend field. The remaining
|
||||
22 bits of of the addend field are sign-extended to form the Addend.
|
||||
|
||||
Note the code to build argument relocations depends on the
|
||||
addend being zero. A consequence of this limitation is GAS
|
||||
can not perform relocation reductions for function symbols. */
|
||||
|
||||
RELOC_NUMBER (R_PARISC_PCREL32, 9)
|
||||
RELOC_NUMBER (R_PARISC_PCREL21L, 10)
|
||||
RELOC_NUMBER (R_PARISC_PCREL17R, 11)
|
||||
RELOC_NUMBER (R_PARISC_PCREL17F, 12)
|
||||
RELOC_NUMBER (R_PARISC_PCREL17C, 13)
|
||||
RELOC_NUMBER (R_PARISC_PCREL14R, 14)
|
||||
RELOC_NUMBER (R_PARISC_PCREL14F, 15)
|
||||
|
||||
/* DP-relative relocation types. */
|
||||
RELOC_NUMBER (R_PARISC_DPREL21L, 18)
|
||||
RELOC_NUMBER (R_PARISC_DPREL14WR, 19)
|
||||
RELOC_NUMBER (R_PARISC_DPREL14DR, 20)
|
||||
RELOC_NUMBER (R_PARISC_DPREL14R, 22)
|
||||
RELOC_NUMBER (R_PARISC_DPREL14F, 23)
|
||||
|
||||
/* Data linkage table (DLT) relocation types
|
||||
|
||||
SOM DLT_REL fixup requests are used to for static data references
|
||||
from position-independent code within shared libraries. They are
|
||||
similar to the GOT relocation types in some SVR4 implementations. */
|
||||
|
||||
RELOC_NUMBER (R_PARISC_DLTREL21L, 26)
|
||||
RELOC_NUMBER (R_PARISC_DLTREL14R, 30)
|
||||
RELOC_NUMBER (R_PARISC_DLTREL14F, 31)
|
||||
|
||||
/* DLT indirect relocation types */
|
||||
RELOC_NUMBER (R_PARISC_DLTIND21L, 34)
|
||||
RELOC_NUMBER (R_PARISC_DLTIND14R, 38)
|
||||
RELOC_NUMBER (R_PARISC_DLTIND14F, 39)
|
||||
|
||||
/* Base relative relocation types. Ugh. These imply lots of state */
|
||||
RELOC_NUMBER (R_PARISC_SETBASE, 40)
|
||||
RELOC_NUMBER (R_PARISC_SECREL32, 41)
|
||||
RELOC_NUMBER (R_PARISC_BASEREL21L, 42)
|
||||
RELOC_NUMBER (R_PARISC_BASEREL17R, 43)
|
||||
RELOC_NUMBER (R_PARISC_BASEREL17F, 44)
|
||||
RELOC_NUMBER (R_PARISC_BASEREL14R, 46)
|
||||
RELOC_NUMBER (R_PARISC_BASEREL14F, 47)
|
||||
|
||||
/* Segment relative relocation types. */
|
||||
RELOC_NUMBER (R_PARISC_SEGBASE, 48)
|
||||
RELOC_NUMBER (R_PARISC_SEGREL32, 49)
|
||||
|
||||
/* Offsets from the PLT. */
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF21L, 50)
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF14R, 54)
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF14F, 55)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR32, 57)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR21L, 58)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR14R, 62)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_FPTR64, 64)
|
||||
|
||||
/* Plabel relocation types. */
|
||||
RELOC_NUMBER (R_PARISC_PLABEL32, 65)
|
||||
RELOC_NUMBER (R_PARISC_PLABEL21L, 66)
|
||||
RELOC_NUMBER (R_PARISC_PLABEL14R, 70)
|
||||
|
||||
/* PCREL relocations. */
|
||||
RELOC_NUMBER (R_PARISC_PCREL64, 72)
|
||||
RELOC_NUMBER (R_PARISC_PCREL22C, 73)
|
||||
RELOC_NUMBER (R_PARISC_PCREL22F, 74)
|
||||
RELOC_NUMBER (R_PARISC_PCREL14WR, 75)
|
||||
RELOC_NUMBER (R_PARISC_PCREL14DR, 76)
|
||||
RELOC_NUMBER (R_PARISC_PCREL16F, 77)
|
||||
RELOC_NUMBER (R_PARISC_PCREL16WF, 78)
|
||||
RELOC_NUMBER (R_PARISC_PCREL16DF, 79)
|
||||
|
||||
|
||||
RELOC_NUMBER (R_PARISC_DIR64, 80)
|
||||
RELOC_NUMBER (R_PARISC_DIR64WR, 81)
|
||||
RELOC_NUMBER (R_PARISC_DIR64DR, 82)
|
||||
RELOC_NUMBER (R_PARISC_DIR14WR, 83)
|
||||
RELOC_NUMBER (R_PARISC_DIR14DR, 84)
|
||||
RELOC_NUMBER (R_PARISC_DIR16F, 85)
|
||||
RELOC_NUMBER (R_PARISC_DIR16WF, 86)
|
||||
RELOC_NUMBER (R_PARISC_DIR16DF, 87)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_GPREL64, 88)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_DLTREL14WR, 91)
|
||||
RELOC_NUMBER (R_PARISC_DLTREL14DR, 92)
|
||||
RELOC_NUMBER (R_PARISC_GPREL16F, 93)
|
||||
RELOC_NUMBER (R_PARISC_GPREL16WF, 94)
|
||||
RELOC_NUMBER (R_PARISC_GPREL16DF, 95)
|
||||
|
||||
|
||||
RELOC_NUMBER (R_PARISC_LTOFF64, 96)
|
||||
RELOC_NUMBER (R_PARISC_DLTIND14WR, 99)
|
||||
RELOC_NUMBER (R_PARISC_DLTIND14DR, 100)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF16F, 101)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF16WF, 102)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF16DF, 103)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_SECREL64, 104)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_BASEREL14WR, 107)
|
||||
RELOC_NUMBER (R_PARISC_BASEREL14DR, 108)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_SEGREL64, 112)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF14WR, 115)
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF14DR, 116)
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF16F, 117)
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF16WF, 118)
|
||||
RELOC_NUMBER (R_PARISC_PLTOFF16DF, 119)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR64, 120)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR14WR, 123)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR14DR, 124)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR16F, 125)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR16WF, 126)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_FPTR16DF, 127)
|
||||
|
||||
|
||||
RELOC_NUMBER (R_PARISC_COPY, 128)
|
||||
RELOC_NUMBER (R_PARISC_IPLT, 129)
|
||||
RELOC_NUMBER (R_PARISC_EPLT, 130)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_TPREL32, 153)
|
||||
RELOC_NUMBER (R_PARISC_TPREL21L, 154)
|
||||
RELOC_NUMBER (R_PARISC_TPREL14R, 158)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP21L, 162)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP14R, 166)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP14F, 167)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_TPREL64, 216)
|
||||
RELOC_NUMBER (R_PARISC_TPREL14WR, 219)
|
||||
RELOC_NUMBER (R_PARISC_TPREL14DR, 220)
|
||||
RELOC_NUMBER (R_PARISC_TPREL16F, 221)
|
||||
RELOC_NUMBER (R_PARISC_TPREL16WF, 222)
|
||||
RELOC_NUMBER (R_PARISC_TPREL16DF, 223)
|
||||
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP64, 224)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP14WR, 227)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP14DR, 228)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP16F, 229)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP16WF, 230)
|
||||
RELOC_NUMBER (R_PARISC_LTOFF_TP16DF, 231)
|
||||
EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#ifndef RELOC_MACROS_GEN_FUNC
|
||||
typedef enum elf_hppa_reloc_type elf_hppa_reloc_type;
|
||||
#endif
|
||||
|
||||
#define PT_PARISC_ARCHEXT 0x70000000
|
||||
#define PT_PARISC_UNWIND 0x70000001
|
||||
#define PF_PARISC_SBP 0x08000000
|
||||
#define PF_HP_PAGE_SIZE 0x00100000
|
||||
#define PF_HP_FAR_SHARED 0x00200000
|
||||
#define PF_HP_NEAR_SHARED 0x00400000
|
||||
#define PF_HP_CODE 0x01000000
|
||||
#define PF_HP_MODIFY 0x02000000
|
||||
#define PF_HP_LAZYSWAP 0x04000000
|
||||
#define PF_HP_SBP 0x08000000
|
||||
|
||||
|
||||
/* Processor specific dynamic array tags. */
|
||||
|
||||
#define DT_HP_LOAD_MAP (DT_LOOS + 0x0)
|
||||
#define DT_HP_DLD_FLAGS (DT_LOOS + 0x1)
|
||||
#define DT_HP_DLD_HOOK (DT_LOOS + 0x2)
|
||||
#define DT_HP_UX10_INIT (DT_LOOS + 0x3)
|
||||
#define DT_HP_UX10_INITSZ (DT_LOOS + 0x4)
|
||||
#define DT_HP_PREINIT (DT_LOOS + 0x5)
|
||||
#define DT_HP_PREINITSZ (DT_LOOS + 0x6)
|
||||
#define DT_HP_NEEDED (DT_LOOS + 0x7)
|
||||
#define DT_HP_TIME_STAMP (DT_LOOS + 0x8)
|
||||
#define DT_HP_CHECKSUM (DT_LOOS + 0x9)
|
||||
#define DT_HP_GST_SIZE (DT_LOOS + 0xa)
|
||||
#define DT_HP_GST_VERSION (DT_LOOS + 0xb)
|
||||
#define DT_HP_GST_HASHVAL (DT_LOOS + 0xc)
|
||||
|
||||
/* Values for DT_HP_DLD_FLAGS. */
|
||||
#define DT_HP_DEBUG_PRIVATE 0x0001 /* Map text private */
|
||||
#define DT_HP_DEBUG_CALLBACK 0x0002 /* Callback */
|
||||
#define DT_HP_DEBUG_CALLBACK_BOR 0x0004 /* BOR callback */
|
||||
#define DT_HP_NO_ENVVAR 0x0008 /* No env var */
|
||||
#define DT_HP_BIND_NOW 0x0010 /* Bind now */
|
||||
#define DT_HP_BIND_NONFATAL 0x0020 /* Bind non-fatal */
|
||||
#define DT_HP_BIND_VERBOSE 0x0040 /* Bind verbose */
|
||||
#define DT_HP_BIND_RESTRICTED 0x0080 /* Bind restricted */
|
||||
#define DT_HP_BIND_SYMBOLIC 0x0100 /* Bind symbolic */
|
||||
#define DT_HP_RPATH_FIRST 0x0200 /* RPATH first */
|
||||
#define DT_HP_BIND_DEPTH_FIRST 0x0400 /* Bind depth-first */
|
||||
|
||||
/* Program header extensions. */
|
||||
#define PT_HP_TLS (PT_LOOS + 0x0)
|
||||
#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
|
||||
#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
|
||||
#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
|
||||
#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
|
||||
#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
|
||||
#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
|
||||
#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
|
||||
#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
|
||||
#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
|
||||
#define PT_HP_PARALLEL (PT_LOOS + 0x10)
|
||||
#define PT_HP_FASTBIND (PT_LOOS + 0x11)
|
||||
|
||||
/* Additional symbol types. */
|
||||
#define STT_HP_OPAQUE (STT_LOOS + 0x1)
|
||||
#define STT_HP_STUB (STT_LOOS + 0x2)
|
||||
|
||||
#endif /* _ELF_HPPA_H */
|
||||
@@ -1,46 +0,0 @@
|
||||
/* i370 ELF support for BFD.
|
||||
Copyright (C) 1995, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file holds definitions specific to the i370 ELF ABI. Note
|
||||
that most of this is not actually implemented by BFD. */
|
||||
|
||||
#ifndef _ELF_I370_H
|
||||
#define _ELF_I370_H
|
||||
|
||||
/* Processor specific section headers, sh_type field */
|
||||
|
||||
#define SHT_ORDERED SHT_HIPROC /* Link editor is to sort the \
|
||||
entries in this section \
|
||||
based on the address \
|
||||
specified in the associated \
|
||||
symbol table entry. */
|
||||
|
||||
#define EF_I370_RELOCATABLE 0x00010000 /* i370 -mrelocatable flag */
|
||||
#define EF_I370_RELOCATABLE_LIB 0x00008000 /* i370 -mrelocatable-lib flag */
|
||||
/* Processor specific section flags, sh_flags field */
|
||||
|
||||
#define SHF_EXCLUDE 0x80000000 /* Link editor is to exclude \
|
||||
this section from executable \
|
||||
and shared objects that it \
|
||||
builds when those objects \
|
||||
are not to be furhter \
|
||||
relocated. */
|
||||
#endif /* _ELF_I370_H */
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/* Intel 960 ELF support for BFD.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_I960_H
|
||||
#define _ELF_I960_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
|
||||
START_RELOC_NUMBERS (elf_i960_reloc_type)
|
||||
RELOC_NUMBER (R_960_NONE, 0)
|
||||
RELOC_NUMBER (R_960_12, 1)
|
||||
RELOC_NUMBER (R_960_32, 2)
|
||||
RELOC_NUMBER (R_960_IP24, 3)
|
||||
RELOC_NUMBER (R_960_SUB, 4)
|
||||
RELOC_NUMBER (R_960_OPTCALL, 5)
|
||||
RELOC_NUMBER (R_960_OPTCALLX, 6)
|
||||
RELOC_NUMBER (R_960_OPTCALLXA, 7)
|
||||
EMPTY_RELOC (R_960_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#endif /* _ELF_I960_H */
|
||||
@@ -1,68 +0,0 @@
|
||||
/* M32R ELF support for BFD.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_M32R_H
|
||||
#define _ELF_M32R_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_m32r_reloc_type)
|
||||
RELOC_NUMBER (R_M32R_NONE, 0)
|
||||
RELOC_NUMBER (R_M32R_16, 1)
|
||||
RELOC_NUMBER (R_M32R_32, 2)
|
||||
RELOC_NUMBER (R_M32R_24, 3)
|
||||
RELOC_NUMBER (R_M32R_10_PCREL, 4)
|
||||
RELOC_NUMBER (R_M32R_18_PCREL, 5)
|
||||
RELOC_NUMBER (R_M32R_26_PCREL, 6)
|
||||
RELOC_NUMBER (R_M32R_HI16_ULO, 7)
|
||||
RELOC_NUMBER (R_M32R_HI16_SLO, 8)
|
||||
RELOC_NUMBER (R_M32R_LO16, 9)
|
||||
RELOC_NUMBER (R_M32R_SDA16, 10)
|
||||
RELOC_NUMBER (R_M32R_GNU_VTINHERIT, 11)
|
||||
RELOC_NUMBER (R_M32R_GNU_VTENTRY, 12)
|
||||
EMPTY_RELOC (R_M32R_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
/* Processor specific section indices. These sections do not actually
|
||||
exist. Symbols with a st_shndx field corresponding to one of these
|
||||
values have a special meaning. */
|
||||
|
||||
/* Small common symbol. */
|
||||
#define SHN_M32R_SCOMMON 0xff00
|
||||
|
||||
/* Processor specific section flags. */
|
||||
|
||||
/* This section contains sufficient relocs to be relaxed.
|
||||
When relaxing, even relocs of branch instructions the assembler could
|
||||
complete must be present because relaxing may cause the branch target to
|
||||
move. */
|
||||
#define SHF_M32R_CAN_RELAX 0x10000000
|
||||
|
||||
/* Processor specific flags for the ELF header e_flags field. */
|
||||
|
||||
/* Two bit m32r architecture field. */
|
||||
#define EF_M32R_ARCH 0x30000000
|
||||
|
||||
/* m32r code. */
|
||||
#define E_M32R_ARCH 0x00000000
|
||||
/* m32rx code. */
|
||||
#define E_M32RX_ARCH 0x10000000
|
||||
|
||||
#endif
|
||||
@@ -1,58 +0,0 @@
|
||||
/* MC68k ELF support for BFD.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_M68K_H
|
||||
#define _ELF_M68K_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocation types. */
|
||||
START_RELOC_NUMBERS (elf_m68k_reloc_type)
|
||||
RELOC_NUMBER (R_68K_NONE, 0) /* No reloc */
|
||||
RELOC_NUMBER (R_68K_32, 1) /* Direct 32 bit */
|
||||
RELOC_NUMBER (R_68K_16, 2) /* Direct 16 bit */
|
||||
RELOC_NUMBER (R_68K_8, 3) /* Direct 8 bit */
|
||||
RELOC_NUMBER (R_68K_PC32, 4) /* PC relative 32 bit */
|
||||
RELOC_NUMBER (R_68K_PC16, 5) /* PC relative 16 bit */
|
||||
RELOC_NUMBER (R_68K_PC8, 6) /* PC relative 8 bit */
|
||||
RELOC_NUMBER (R_68K_GOT32, 7) /* 32 bit PC relative GOT entry */
|
||||
RELOC_NUMBER (R_68K_GOT16, 8) /* 16 bit PC relative GOT entry */
|
||||
RELOC_NUMBER (R_68K_GOT8, 9) /* 8 bit PC relative GOT entry */
|
||||
RELOC_NUMBER (R_68K_GOT32O, 10) /* 32 bit GOT offset */
|
||||
RELOC_NUMBER (R_68K_GOT16O, 11) /* 16 bit GOT offset */
|
||||
RELOC_NUMBER (R_68K_GOT8O, 12) /* 8 bit GOT offset */
|
||||
RELOC_NUMBER (R_68K_PLT32, 13) /* 32 bit PC relative PLT address */
|
||||
RELOC_NUMBER (R_68K_PLT16, 14) /* 16 bit PC relative PLT address */
|
||||
RELOC_NUMBER (R_68K_PLT8, 15) /* 8 bit PC relative PLT address */
|
||||
RELOC_NUMBER (R_68K_PLT32O, 16) /* 32 bit PLT offset */
|
||||
RELOC_NUMBER (R_68K_PLT16O, 17) /* 16 bit PLT offset */
|
||||
RELOC_NUMBER (R_68K_PLT8O, 18) /* 8 bit PLT offset */
|
||||
RELOC_NUMBER (R_68K_COPY, 19) /* Copy symbol at runtime */
|
||||
RELOC_NUMBER (R_68K_GLOB_DAT, 20) /* Create GOT entry */
|
||||
RELOC_NUMBER (R_68K_JMP_SLOT, 21) /* Create PLT entry */
|
||||
RELOC_NUMBER (R_68K_RELATIVE, 22) /* Adjust by program base */
|
||||
/* These are GNU extensions to enable C++ vtable garbage collection. */
|
||||
RELOC_NUMBER (R_68K_GNU_VTINHERIT, 23)
|
||||
RELOC_NUMBER (R_68K_GNU_VTENTRY, 24)
|
||||
EMPTY_RELOC (R_68K_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#define EF_CPU32 0x00810000
|
||||
|
||||
#endif
|
||||
@@ -1,47 +0,0 @@
|
||||
/* Motorola MCore support for BFD.
|
||||
Copyright (C) 1995, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file holds definitions specific to the MCore ELF ABI. */
|
||||
#ifndef _ELF_MORE_H
|
||||
#define _ELF_MORE_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_mcore_reloc_type)
|
||||
RELOC_NUMBER (R_MCORE_NONE, 0)
|
||||
RELOC_NUMBER (R_MCORE_ADDR32, 1)
|
||||
RELOC_NUMBER (R_MCORE_PCRELIMM8BY4, 2)
|
||||
RELOC_NUMBER (R_MCORE_PCRELIMM11BY2, 3)
|
||||
RELOC_NUMBER (R_MCORE_PCRELIMM4BY2, 4)
|
||||
RELOC_NUMBER (R_MCORE_PCREL32, 5)
|
||||
RELOC_NUMBER (R_MCORE_PCRELJSR_IMM11BY2, 6)
|
||||
RELOC_NUMBER (R_MCORE_GNU_VTINHERIT, 7)
|
||||
RELOC_NUMBER (R_MCORE_GNU_VTENTRY, 8)
|
||||
RELOC_NUMBER (R_MCORE_RELATIVE, 9)
|
||||
RELOC_NUMBER (R_MCORE_COPY, 10)
|
||||
RELOC_NUMBER (R_MCORE_GLOB_DAT, 11)
|
||||
RELOC_NUMBER (R_MCORE_JUMP_SLOT, 12)
|
||||
EMPTY_RELOC (R_MCORE_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
/* Section Attributes. */
|
||||
#define SHF_MCORE_NOREAD 0x80000000
|
||||
|
||||
#endif /* _ELF_MCORE_H */
|
||||
@@ -1,39 +0,0 @@
|
||||
/* MN10200 ELF support for BFD.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file holds definitions specific to the MN10200 ELF ABI. */
|
||||
|
||||
#ifndef _ELF_MN10200_H
|
||||
#define _ELF_MN10200_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_mn10200_reloc_type)
|
||||
RELOC_NUMBER (R_MN10200_NONE, 0)
|
||||
RELOC_NUMBER (R_MN10200_32, 1)
|
||||
RELOC_NUMBER (R_MN10200_16, 2)
|
||||
RELOC_NUMBER (R_MN10200_8, 3)
|
||||
RELOC_NUMBER (R_MN10200_24, 4)
|
||||
RELOC_NUMBER (R_MN10200_PCREL8, 5)
|
||||
RELOC_NUMBER (R_MN10200_PCREL16, 6)
|
||||
RELOC_NUMBER (R_MN10200_PCREL24, 7)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#endif /* _ELF_MN10200_H */
|
||||
@@ -1,54 +0,0 @@
|
||||
/* MN10300 ELF support for BFD.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file holds definitions specific to the MN10300 ELF ABI. */
|
||||
|
||||
#ifndef _ELF_MN10300_H
|
||||
#define _ELF_MN10300_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
START_RELOC_NUMBERS (elf_mn10300_reloc_type)
|
||||
RELOC_NUMBER (R_MN10300_NONE, 0)
|
||||
RELOC_NUMBER (R_MN10300_32, 1)
|
||||
RELOC_NUMBER (R_MN10300_16, 2)
|
||||
RELOC_NUMBER (R_MN10300_8, 3)
|
||||
RELOC_NUMBER (R_MN10300_PCREL32, 4)
|
||||
RELOC_NUMBER (R_MN10300_PCREL16, 5)
|
||||
RELOC_NUMBER (R_MN10300_PCREL8, 6)
|
||||
RELOC_NUMBER (R_MN10300_GNU_VTINHERIT, 7)
|
||||
RELOC_NUMBER (R_MN10300_GNU_VTENTRY, 8)
|
||||
RELOC_NUMBER (R_MN10300_24, 9)
|
||||
EMPTY_RELOC (R_MN10300_MAX)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
/* Machine variant if we know it. This field was invented at Cygnus,
|
||||
but it is hoped that other vendors will adopt it. If some standard
|
||||
is developed, this code should be changed to follow it. */
|
||||
|
||||
#define EF_MN10300_MACH 0x00FF0000
|
||||
|
||||
/* Cygnus is choosing values between 80 and 9F;
|
||||
00 - 7F should be left for a future standard;
|
||||
the rest are open. */
|
||||
|
||||
#define E_MN10300_MACH_MN10300 0x00810000
|
||||
#define E_MN10300_MACH_AM33 0x00820000
|
||||
#endif /* _ELF_MN10300_H */
|
||||
@@ -1,45 +0,0 @@
|
||||
/* picoJava ELF support for BFD.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _ELF_PJ_H
|
||||
#define _ELF_PJ_H
|
||||
|
||||
#include "elf/reloc-macros.h"
|
||||
|
||||
/* Relocations. */
|
||||
|
||||
START_RELOC_NUMBERS (elf_pj_reloc_type)
|
||||
RELOC_NUMBER (R_PJ_NONE, 0)
|
||||
RELOC_NUMBER (R_PJ_DATA_DIR32, 1)
|
||||
RELOC_NUMBER (R_PJ_CODE_REL32, 2)
|
||||
RELOC_NUMBER (R_PJ_CODE_REL16, 3)
|
||||
RELOC_NUMBER (R_PJ_CODE_DIR32, 6)
|
||||
RELOC_NUMBER (R_PJ_CODE_DIR16, 7)
|
||||
RELOC_NUMBER (R_PJ_CODE_LO16, 13)
|
||||
RELOC_NUMBER (R_PJ_CODE_HI16, 14)
|
||||
RELOC_NUMBER (R_PJ_GNU_VTINHERIT, 15)
|
||||
RELOC_NUMBER (R_PJ_GNU_VTENTRY, 16)
|
||||
EMPTY_RELOC (R_PJ_max)
|
||||
END_RELOC_NUMBERS
|
||||
|
||||
#define EF_PICOJAVA_ARCH 0x0000000f
|
||||
#define EF_PICOJAVA_NEWCALLS 0x00000010
|
||||
#define EF_PICOJAVA_GNUCALLS 0x00000020 /* The (currently) non standard GNU calling convention */
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,409 +0,0 @@
|
||||
/* An abstract string datatype.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Contributed by Mark Mitchell (mark@markmitchell.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "libiberty.h"
|
||||
#include "dyn-string.h"
|
||||
|
||||
/* If this file is being compiled for inclusion in the C++ runtime
|
||||
library, as part of the demangler implementation, we don't want to
|
||||
abort if an allocation fails. Instead, percolate an error code up
|
||||
through the call chain. */
|
||||
|
||||
#ifdef IN_LIBGCC2
|
||||
#define RETURN_ON_ALLOCATION_FAILURE
|
||||
#endif
|
||||
|
||||
/* Performs in-place initialization of a dyn_string struct. This
|
||||
function can be used with a dyn_string struct on the stack or
|
||||
embedded in another object. The contents of of the string itself
|
||||
are still dynamically allocated. The string initially is capable
|
||||
of holding at least SPACE characeters, including the terminating
|
||||
NUL. If SPACE is 0, it will silently be increated to 1.
|
||||
|
||||
If RETURN_ON_ALLOCATION_FAILURE is defined and memory allocation
|
||||
fails, returns 0. Otherwise returns 1. */
|
||||
|
||||
int
|
||||
dyn_string_init (ds_struct_ptr, space)
|
||||
struct dyn_string *ds_struct_ptr;
|
||||
int space;
|
||||
{
|
||||
/* We need at least one byte in which to store the terminating NUL. */
|
||||
if (space == 0)
|
||||
space = 1;
|
||||
|
||||
#ifdef RETURN_ON_ALLOCATION_FAILURE
|
||||
ds_struct_ptr->s = (char *) malloc (space);
|
||||
if (ds_struct_ptr->s == NULL)
|
||||
return 0;
|
||||
#else
|
||||
ds_struct_ptr->s = (char *) xmalloc (space);
|
||||
#endif
|
||||
ds_struct_ptr->allocated = space;
|
||||
ds_struct_ptr->length = 0;
|
||||
ds_struct_ptr->s[0] = '\0';
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Create a new dynamic string capable of holding at least SPACE
|
||||
characters, including the terminating NUL. If SPACE is 0, it will
|
||||
be silently increased to 1. If RETURN_ON_ALLOCATION_FAILURE is
|
||||
defined and memory allocation fails, returns NULL. Otherwise
|
||||
returns the newly allocated string. */
|
||||
|
||||
dyn_string_t
|
||||
dyn_string_new (space)
|
||||
int space;
|
||||
{
|
||||
dyn_string_t result;
|
||||
#ifdef RETURN_ON_ALLOCATION_FAILURE
|
||||
result = (dyn_string_t) malloc (sizeof (struct dyn_string));
|
||||
if (result == NULL)
|
||||
return NULL;
|
||||
if (!dyn_string_init (result, space))
|
||||
{
|
||||
free (result);
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
result = (dyn_string_t) xmalloc (sizeof (struct dyn_string));
|
||||
dyn_string_init (result, space);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Free the memory used by DS. */
|
||||
|
||||
void
|
||||
dyn_string_delete (ds)
|
||||
dyn_string_t ds;
|
||||
{
|
||||
free (ds->s);
|
||||
free (ds);
|
||||
}
|
||||
|
||||
/* Returns the contents of DS in a buffer allocated with malloc. It
|
||||
is the caller's responsibility to deallocate the buffer using free.
|
||||
DS is then set to the empty string. Deletes DS itself. */
|
||||
|
||||
char*
|
||||
dyn_string_release (ds)
|
||||
dyn_string_t ds;
|
||||
{
|
||||
/* Store the old buffer. */
|
||||
char* result = ds->s;
|
||||
/* The buffer is no longer owned by DS. */
|
||||
ds->s = NULL;
|
||||
/* Delete DS. */
|
||||
free (ds);
|
||||
/* Return the old buffer. */
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Increase the capacity of DS so it can hold at least SPACE
|
||||
characters, plus the terminating NUL. This function will not (at
|
||||
present) reduce the capacity of DS. Returns DS on success.
|
||||
|
||||
If RETURN_ON_ALLOCATION_FAILURE is defined and a memory allocation
|
||||
operation fails, deletes DS and returns NULL. */
|
||||
|
||||
dyn_string_t
|
||||
dyn_string_resize (ds, space)
|
||||
dyn_string_t ds;
|
||||
int space;
|
||||
{
|
||||
int new_allocated = ds->allocated;
|
||||
|
||||
/* Increase SPACE to hold the NUL termination. */
|
||||
++space;
|
||||
|
||||
/* Increase allocation by factors of two. */
|
||||
while (space > new_allocated)
|
||||
new_allocated *= 2;
|
||||
|
||||
if (new_allocated != ds->allocated)
|
||||
{
|
||||
ds->allocated = new_allocated;
|
||||
/* We actually need more space. */
|
||||
#ifdef RETURN_ON_ALLOCATION_FAILURE
|
||||
ds->s = (char *) realloc (ds->s, ds->allocated);
|
||||
if (ds->s == NULL)
|
||||
{
|
||||
free (ds);
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
ds->s = (char *) xrealloc (ds->s, ds->allocated);
|
||||
#endif
|
||||
}
|
||||
|
||||
return ds;
|
||||
}
|
||||
|
||||
/* Sets the contents of DS to the empty string. */
|
||||
|
||||
void
|
||||
dyn_string_clear (ds)
|
||||
dyn_string_t ds;
|
||||
{
|
||||
/* A dyn_string always has room for at least the NUL terminator. */
|
||||
ds->s[0] = '\0';
|
||||
ds->length = 0;
|
||||
}
|
||||
|
||||
/* Makes the contents of DEST the same as the contents of SRC. DEST
|
||||
and SRC must be distinct. Returns 1 on success. On failure, if
|
||||
RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_copy (dest, src)
|
||||
dyn_string_t dest;
|
||||
dyn_string_t src;
|
||||
{
|
||||
if (dest == src)
|
||||
abort ();
|
||||
|
||||
/* Make room in DEST. */
|
||||
if (dyn_string_resize (dest, src->length) == NULL)
|
||||
return 0;
|
||||
/* Copy DEST into SRC. */
|
||||
strcpy (dest->s, src->s);
|
||||
/* Update the size of DEST. */
|
||||
dest->length = src->length;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Copies SRC, a NUL-terminated string, into DEST. Returns 1 on
|
||||
success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST
|
||||
and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_copy_cstr (dest, src)
|
||||
dyn_string_t dest;
|
||||
const char *src;
|
||||
{
|
||||
int length = strlen (src);
|
||||
/* Make room in DEST. */
|
||||
if (dyn_string_resize (dest, length) == NULL)
|
||||
return 0;
|
||||
/* Copy DEST into SRC. */
|
||||
strcpy (dest->s, src);
|
||||
/* Update the size of DEST. */
|
||||
dest->length = length;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Inserts SRC at the beginning of DEST. DEST is expanded as
|
||||
necessary. SRC and DEST must be distinct. Returns 1 on success.
|
||||
On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and
|
||||
returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_prepend (dest, src)
|
||||
dyn_string_t dest;
|
||||
dyn_string_t src;
|
||||
{
|
||||
return dyn_string_insert (dest, 0, src);
|
||||
}
|
||||
|
||||
/* Inserts SRC, a NUL-terminated string, at the beginning of DEST.
|
||||
DEST is expanded as necessary. Returns 1 on success. On failure,
|
||||
if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_prepend_cstr (dest, src)
|
||||
dyn_string_t dest;
|
||||
const char *src;
|
||||
{
|
||||
return dyn_string_insert_cstr (dest, 0, src);
|
||||
}
|
||||
|
||||
/* Inserts SRC into DEST starting at position POS. DEST is expanded
|
||||
as necessary. SRC and DEST must be distinct. Returns 1 on
|
||||
success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST
|
||||
and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_insert (dest, pos, src)
|
||||
dyn_string_t dest;
|
||||
int pos;
|
||||
dyn_string_t src;
|
||||
{
|
||||
int i;
|
||||
|
||||
if (src == dest)
|
||||
abort ();
|
||||
|
||||
if (dyn_string_resize (dest, dest->length + src->length) == NULL)
|
||||
return 0;
|
||||
/* Make room for the insertion. Be sure to copy the NUL. */
|
||||
for (i = dest->length; i >= pos; --i)
|
||||
dest->s[i + src->length] = dest->s[i];
|
||||
/* Splice in the new stuff. */
|
||||
strncpy (dest->s + pos, src->s, src->length);
|
||||
/* Compute the new length. */
|
||||
dest->length += src->length;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Inserts SRC, a NUL-terminated string, into DEST starting at
|
||||
position POS. DEST is expanded as necessary. Returns 1 on
|
||||
success. On failure, RETURN_ON_ALLOCATION_FAILURE, deletes DEST
|
||||
and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_insert_cstr (dest, pos, src)
|
||||
dyn_string_t dest;
|
||||
int pos;
|
||||
const char *src;
|
||||
{
|
||||
int i;
|
||||
int length = strlen (src);
|
||||
|
||||
if (dyn_string_resize (dest, dest->length + length) == NULL)
|
||||
return 0;
|
||||
/* Make room for the insertion. Be sure to copy the NUL. */
|
||||
for (i = dest->length; i >= pos; --i)
|
||||
dest->s[i + length] = dest->s[i];
|
||||
/* Splice in the new stuff. */
|
||||
strncpy (dest->s + pos, src, length);
|
||||
/* Compute the new length. */
|
||||
dest->length += length;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Append S to DS, resizing DS if necessary. Returns 1 on success.
|
||||
On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and
|
||||
returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_append (dest, s)
|
||||
dyn_string_t dest;
|
||||
dyn_string_t s;
|
||||
{
|
||||
if (dyn_string_resize (dest, dest->length + s->length) == 0)
|
||||
return 0;
|
||||
strcpy (dest->s + dest->length, s->s);
|
||||
dest->length += s->length;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Append the NUL-terminated string S to DS, resizing DS if necessary.
|
||||
Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE,
|
||||
deletes DEST and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_append_cstr (dest, s)
|
||||
dyn_string_t dest;
|
||||
const char *s;
|
||||
{
|
||||
int len = strlen (s);
|
||||
|
||||
/* The new length is the old length plus the size of our string, plus
|
||||
one for the null at the end. */
|
||||
if (dyn_string_resize (dest, dest->length + len) == NULL)
|
||||
return 0;
|
||||
strcpy (dest->s + dest->length, s);
|
||||
dest->length += len;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Appends C to the end of DEST. Returns 1 on success. On failiure,
|
||||
if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_append_char (dest, c)
|
||||
dyn_string_t dest;
|
||||
int c;
|
||||
{
|
||||
/* Make room for the extra character. */
|
||||
if (dyn_string_resize (dest, dest->length + 1) == NULL)
|
||||
return 0;
|
||||
/* Append the character; it will overwrite the old NUL. */
|
||||
dest->s[dest->length] = c;
|
||||
/* Add a new NUL at the end. */
|
||||
dest->s[dest->length + 1] = '\0';
|
||||
/* Update the length. */
|
||||
++(dest->length);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Sets the contents of DEST to the substring of SRC starting at START
|
||||
and ending before END. START must be less than or equal to END,
|
||||
and both must be between zero and the length of SRC, inclusive.
|
||||
Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE,
|
||||
deletes DEST and returns 0. */
|
||||
|
||||
int
|
||||
dyn_string_substring (dest, src, start, end)
|
||||
dyn_string_t dest;
|
||||
dyn_string_t src;
|
||||
int start;
|
||||
int end;
|
||||
{
|
||||
int i;
|
||||
int length = end - start;
|
||||
|
||||
if (start > end || start > src->length || end > src->length)
|
||||
abort ();
|
||||
|
||||
/* Make room for the substring. */
|
||||
if (dyn_string_resize (dest, length) == NULL)
|
||||
return 0;
|
||||
/* Copy the characters in the substring, */
|
||||
for (i = length; --i >= 0; )
|
||||
dest->s[i] = src->s[start + i];
|
||||
/* NUL-terimate the result. */
|
||||
dest->s[length] = '\0';
|
||||
/* Record the length of the substring. */
|
||||
dest->length = length;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Returns non-zero if DS1 and DS2 have the same contents. */
|
||||
|
||||
int
|
||||
dyn_string_eq (ds1, ds2)
|
||||
dyn_string_t ds1;
|
||||
dyn_string_t ds2;
|
||||
{
|
||||
/* If DS1 and DS2 have different lengths, they must not be the same. */
|
||||
if (ds1->length != ds2->length)
|
||||
return 0;
|
||||
else
|
||||
return !strcmp (ds1->s, ds2->s);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
# Magic
|
||||
# Magic data for file(1) command.
|
||||
# Machine-generated from src/cmd/file/magdir/*; edit there only!
|
||||
# Format is described in magic(files), where:
|
||||
# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.
|
||||
@@ -1,34 +0,0 @@
|
||||
$Id: LEGAL.NOTICE,v 1.11 1999/01/14 16:30:12 christos Exp $
|
||||
Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995.
|
||||
Software written by Ian F. Darwin and others;
|
||||
maintained 1994-1999 Christos Zoulas.
|
||||
|
||||
This software is not subject to any export provision of the United States
|
||||
Department of Commerce, and may be exported to any country or planet.
|
||||
|
||||
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 immediately at the beginning of the file, without modification,
|
||||
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 Ian F. Darwin and others.
|
||||
4. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Localstuff: file(1) magic for locally observed files
|
||||
#
|
||||
# $Id: Localstuff,v 1.3 1995/01/21 21:09:00 christos Exp $
|
||||
# Add any locally observed files here. Remember:
|
||||
# text if readable, executable if runnable binary, data if unreadable.
|
||||
@@ -1,33 +0,0 @@
|
||||
$Id: MAINT,v 1.4 2000/04/11 02:43:51 christos Exp $
|
||||
|
||||
Maintenance notes:
|
||||
|
||||
I am continuing to maintain the file command. I welcome your help,
|
||||
but to make my life easier I'd like to request the following:
|
||||
|
||||
- Don't change the version numbers!
|
||||
|
||||
If your changes are extensive, I will have to work hard to
|
||||
integrate them into my version. If you check it into SCCS locally,
|
||||
the version numbers will likely be kept. IF you check it into RCS
|
||||
or CVS locally, please use -k to keep the version numbers, and
|
||||
please use branch deltas (1.21.1, 1.21.2, ...). If you don't do
|
||||
this, I will likely be unable to use your changes; life's just too
|
||||
short.
|
||||
|
||||
- Do not distribute changed versions.
|
||||
|
||||
People trying to be helpful occasionally put up their hacked versions
|
||||
of the file command for FTP, then the "archie" server finds and publishes
|
||||
the hacked version, and people all over the world get copies of it.
|
||||
Within a day or two I am getting email from around the world
|
||||
asking me why "my" file command won't compile!!! Needless to say this
|
||||
detracts from the limited time I have available to work on the actual
|
||||
software. Therefore I ask you again to please NOT distribute
|
||||
your changed version.
|
||||
|
||||
|
||||
Thank you for your assistance and cooperation.
|
||||
|
||||
Christos Zoulas
|
||||
[email protected]
|
||||
@@ -1,39 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# adventure: file(1) magic for Adventure game files
|
||||
#
|
||||
# from Allen Garvin <[email protected]>
|
||||
# Edited by Dave Chapeskie <[email protected]> Jun 28, 1998
|
||||
#
|
||||
# ALAN
|
||||
# I assume there are other, lower versions, but these are the only ones I
|
||||
# saw in the archive.
|
||||
0 beshort 0x0206 ALAN text adventure code data
|
||||
>2 byte <10 version 2.6%d
|
||||
|
||||
# Conflicts with too much other stuff!
|
||||
# Infocom
|
||||
# (Note: to avoid false matches Z-machine version 1 and 2 are not
|
||||
# recognized since only the oldest Zork I and II used them. Similarly
|
||||
# there are 4 Infocom games that use verion 4 that are not recognized.)
|
||||
#0 byte 3 Infocom game data (Z-machine 3,
|
||||
#>2 beshort <0x7fff Release %3d,
|
||||
#>26 beshort >0 Size %d*2
|
||||
#>18 string >\0 Serial %.6s)
|
||||
#0 byte 5 Infocom game data (Z-machine 5,
|
||||
#>2 beshort <0x7fff Release %3d,
|
||||
#>26 beshort >0 Size %d*4
|
||||
#>18 string >\0 Serial %.6s)
|
||||
#0 byte 6 Infocom game data (Z-machine 6,
|
||||
#>2 beshort <0x7fff Release %3d,
|
||||
#>26 beshort >0 Size %d*8
|
||||
#>18 string >\0 Serial %.6s)
|
||||
#0 byte 8 Infocom game data (Z-machine 8,
|
||||
#>2 beshort <0x7fff Release %3d,
|
||||
#>26 beshort >0 Size %d*8
|
||||
#>18 string >\0 Serial %.6s)
|
||||
|
||||
# TADS (Text Adventure Development System)
|
||||
0 string TADS TADS game data
|
||||
>13 string >\0 (ver. %.6s,
|
||||
>22 string >\0 date %s)
|
||||
@@ -1,7 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# allegro: file(1) magic for Allegro datafiles
|
||||
# Toby Deshane <[email protected]>
|
||||
#
|
||||
0 belong 0x736C6821 Allegro datafile (packed)
|
||||
0 belong 0x736C682E Allegro datafile (not packed/autodetect)
|
||||
0 belong 0x736C682B Allegro datafile (appended exe data)
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# alliant: file(1) magic for Alliant FX series a.out files
|
||||
#
|
||||
# If the FX series is the one that had a processor with a 68K-derived
|
||||
# instruction set, the "short" should probably become "beshort" and the
|
||||
# "long" should probably become "belong".
|
||||
# If it's the i860-based one, they should probably become either the
|
||||
# big-endian or little-endian versions, depending on the mode they ran
|
||||
# the 860 in....
|
||||
#
|
||||
0 short 0420 0420 Alliant virtual executable
|
||||
>2 short &0x0020 common library
|
||||
>16 long >0 not stripped
|
||||
0 short 0421 0421 Alliant compact executable
|
||||
>2 short &0x0020 common library
|
||||
>16 long >0 not stripped
|
||||
Loaded 100 of 521 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user