mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
5107cf1d7d
1997-06-21 02:48 Ulrich Drepper <drepper@cygnus.com> * config.h.in: Add DO_STATIC_NSS. * config.make.in: Add build-static-nss. * elf/eval.c: Use __getdelim instead of __getline. * locale/programs/locale.c: Correct comment. * manual/libc.texinfo: Update copyright and date. Remove A4 option. * sysdeps/libm-ieee754/k_standard.c: Always return HUGE_VAL for gamma overflow. * sysdeps/libm-ieee754/w_gamma.c: Handle SVID and ISO C behaviour. * sysdeps/libm-ieee754/w_gammaf.c: Likewise. * sysdeps/libm-ieee754/w_gammalp.c: Likewise. * po/ko.po: Update. 1997-06-13 10:06 Richard Henderson <rth@tamu.edu> The Great Bit File Move: * configure.in (AC_INIT): Look in include/ for features.h. (sysnames): Add include as the final search directory. (AC_OUTPUT): Create a bits directory in the build directory. * Makeconfig (CPPFLAGS): Look in include/ for libc-symbols.h. * Makefile: Make sure the target directory exists when installing <gnu/stubs.h> and <gnu/lib-names.h>. * csu/Makefile: Use $(compile.S) and $(compile.c) instead of invoking $(CC) directly, as the former have the full include path. * ansidecl.h: Removed. * aliases.h: Moved to include/. * alloca.h: Likewise. * argp.h: Likewise. * argz.h: Likewise. * arpa/ftp.h: Likewise. * arpa/inet.h: Likewise. * arpa/nameser.h: Likewise. * arpa/telnet.h: Likewise. * arpa/tftp.h: Likewise. * assert.h: Likewise. * ctype.h: Likewise. * db.h: Likewise. * dirent.h: Likewise. * dlfcn.h: Likewise. * elf.h: Likewise. * endian.h: Likewise. * envz.h: Likewise. * err.h: Likewise. * errno.h: Likewise. * error.h: Likewise. * fcntl.h: Likewise. * features.h: Likewise. * fnmatch.h: Likewise. * ftw.h: Likewise. * getopt.h: Likewise. * glob.h: Likewise. * gnu-versions.h: Likewise. * grp.h: Likewise. * langinfo.h: Likewise. * libc-symbols.h: Likewise. * libgen.h: Likewise. * libintl.h: Likewise. * limits.h: Likewise. * linewrap.h: Likewise. * link.h: Likewise. * locale.h: Likewise. * malloc.h: Likewise. * math.h: Likewise. * mathcalls.h: Likewise. * mcheck.h: Likewise. * memory.h: Likewise. * netdb.h: Likewise. * netgroup.h: Likewise. * netinet/ether.h: Likewise. * netinet/in.h: Likewise. * nlist.h: Likewise. * nss.h: Likewise. * nsswitch.h: Likewise. * obstack.h: Likewise. * poll.h: Likewise. * posix1_lim.h: Likewise. * posix2_lim.h: Likewise. * printf.h: Likewise. * protocols/routed.h: Likewise. * protocols/rwhod.h: Likewise. * protocols/talkd.h: Likewise. * protocols/timed.h: Likewise. * pwd.h: Likewise. * regex.h: Likewise. * resolv.h: Likewise. * rpc/auth_unix.h: Likewise. * rpc/clnt.h: Likewise. * rpc/netdb.h: Likewise. * rpc/pmap_clnt.h: Likewise. * rpc/pmap_prot.h: Likewise. * rpc/pmap_rmt.h: Likewise. * rpc/rpc.h: Likewise. * rpc/rpc_msg.h: Likewise. * rpc/svc.h: Likewise. * rpc/svc_auth.h: Likewise. * rpc/types.h: Likewise. * rpc/xdr.h: Likewise. * sched.h: Likewise. * search.h: Likewise. * set-hooks.h: Likewise. * setjmp.h: Likewise. * sgtty.h: Likewise. * shadow.h: Likewise. * signal.h: Likewise. * stab.def: Likewise. * stab.h: Likewise. * stdio.h: Likewise. * stdlib.h: Likewise. * string.h: Likewise. * strings.h: Likewise. * sys/bitypes.h: Likewise. * sys/cdefs.h: Likewise. * sys/dir.h: Likewise. * sys/errno.h: Likewise. * sys/fcntl.h: Likewise. * sys/file.h: Likewise. * sys/gmon.h: Likewise. * sys/ioctl.h: Likewise. * sys/ipc.h: Likewise. * sys/msg.h: Likewise. * sys/poll.h: Likewise. * sys/queue.h: Likewise. * sys/resource.h: Likewise. * sys/select.h: Likewise. * sys/sem.h: Likewise. * sys/shm.h: Likewise. * sys/signal.h: Likewise. * sys/socket.h: Likewise. * sys/stat.h: Likewise. * sys/statfs.h: Likewise. * sys/syslog.h: Likewise. * sys/termios.h: Likewise. * sys/time.h: Likewise. * sys/timeb.h: Likewise. * sys/times.h: Likewise. * sys/types.h: Likewise. * sys/uio.h: Likewise. * sys/un.h: Likewise. * sys/unistd.h: Likewise. * sys/utsname.h: Likewise. * sys/vlimit.h: Likewise. * sys/vtimes.h: Likewise. * sys/wait.h: Likewise. * syscall.h: Likewise. * syslog.h: Likewise. * tar.h: Likewise. * termios.h: Likewise. * time.h: Likewise. * ttyent.h: Likewise. * unistd.h: Likewise. * utime.h: Likewise. * utmp.h: Likewise. * values.h: Likewise. * wchar.h: Likewise. * wctype.h: Likewise. * wordexp.h: Likewise. * xlocale.h: Likewise. * xopen_lim.h: Likewise. * linuxthreads/sysdeps/alpha/semaphorebits.h: -> .../bits/semaphore.h. * linuxthreads/sysdeps/powerpc/semaphorebits.h: Likewise. * linuxthreads/sysdeps/pthread/cmpxchg/semaphorebits.h: Likewise. * linuxthreads/sysdeps/pthread/no-cmpxchg/semaphorebits.h: Likewise. * linuxthreads/sysdeps/pthread/libc-lock.h: -> bits/ * sysdeps/mach/libc-lock.h: Likewise. * sysdeps/stub/libc-lock.h: Likewise. * linuxthreads/sysdeps/pthread/stdio-lock.h: Likewise. * linuxthreads/sysdeps/unix/sysv/linux/local_lim.h: Likewise. * sysdeps/mach/hurd/local_lim.h: Likewise. * sysdeps/stub/local_lim.h: Likewise. * sysdeps/unix/sysv/linux/local_lim.h: Likewise. * sysdeps/unix/sysv/local_lim.h: Likewise. * sysdeps/unix/sysv/sco3.2/local_lim.h: Likewise. * linuxthreads/sysdeps/unix/sysv/linux/posix_opt.h: Likewise. * sysdeps/mach/hurd/posix_opt.h: Likewise. * sysdeps/stub/posix_opt.h: Likewise. * sysdeps/unix/bsd/posix_opt.h: Likewise. * sysdeps/unix/bsd/ultrix4/posix_opt.h: Likewise. * sysdeps/unix/sysv/linux/posix_opt.h: Likewise. * math/cmathcalls.h: -> bits/ * math/mathcalls.h: Likewise. * misc/stab.def: -> bits/ * posix/posix1_lim.h: -> bits/ * posix/posix2_lim.h: Likewise. * sysdeps/alpha/__math.h: -> .../fpu/bits/mathinline.h * sysdeps/i386/fpu/__math.h: Likewise. * sysdeps/m68k/fpu/__math.h: Likewise. * sysdeps/m68k/fpu/switch/__math.h: Likewise. * sysdeps/powerpc/__math.h: Likewise. * sysdeps/stub/__math.h: Likewise. * sysdeps/alpha/bytesex.h: -> .../bits/endian.h * sysdeps/arm/bytesex.h: Likewise. * sysdeps/i386/bytesex.h: Likewise. * sysdeps/m68k/bytesex.h: Likewise. * sysdeps/mips/bytesex.h: Likewise. * sysdeps/mips/dec/bytesex.h: Likewise. * sysdeps/mips/mipsel/bytesex.h: Likewise. * sysdeps/mips/p40/bytesex.h: Likewise. * sysdeps/sparc/bytesex.h: Likewise. * sysdeps/stub/bytesex.h: Likewise. * sysdeps/alpha/fpu/fenvbits.h: -> .../bits/fenv.h * sysdeps/i386/fpu/fenvbits.h: Likewise. * sysdeps/m68k/fpu/fenvbits.h: Likewise. * sysdeps/powerpc/fenvbits.h: Likewise. * sysdeps/stub/fenvbits.h: Likewise. * sysdeps/alpha/jmp_buf.h: -> .../bits/setenv.h * sysdeps/arm/jmp_buf.h: Likewise. * sysdeps/i386/jmp_buf.h: Likewise. * sysdeps/m68k/jmp_buf.h: Likewise. * sysdeps/mips/jmp_buf.h: Likewise. * sysdeps/sparc/jmp_buf.h: Likewise. * sysdeps/powerpc/jmp_buf.h: Likewise. * sysdeps/stub/jmp_buf.h: Likewise. * sysdeps/vax/jmp_buf.h: Likewise. * sysdeps/generic/confname.h: -> bits/ * sysdeps/unix/sysv/irix4/confname.h: Likewise. * sysdeps/unix/sysv/sco3.2.4/confname.h: Likewise. * sysdeps/generic/gnu/types.h: -> ../bits/types.h * sysdeps/unix/sysv/linux/alpha/gnu/types.h: Likewise. * sysdeps/unix/sysv/linux/gnu/types.h: Likewise. * sysdeps/generic/ioctl-types.h: -> bits/ * sysdeps/unix/sysv/linux/ioctl-types.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/ioctl-types.h: Likewise. * sysdeps/generic/iovec.h: -> .../bits/uio.h * sysdeps/unix/sysv/linux/iovec.h: Likewise. * sysdeps/generic/mathbits.h: -> .../bits/mathdef.h * sysdeps/i386/fpu/mathbits.h: Likewise. * sysdeps/m68k/fpu/mathbits.h: Likewise. * sysdeps/powerpc/mathbits.h: Likewise. * sysdeps/generic/resourcebits.h: -> .../bits/resource.h * sysdeps/unix/bsd/sun/sunos4/resourcebits.h: Likewise. * sysdeps/unix/sysv/linux/resourcebits.h: Likewise. * sysdeps/generic/schedbits.h: -> .../bits/sched.h * sysdeps/unix/sysv/linux/schedbits.h: Likewise. * sysdeps/generic/selectbits.h: -> .../bits/select.h * sysdeps/i386/selectbits.h: Likewise. * sysdeps/generic/sigaction.h: -> bits/ * sysdeps/unix/bsd/osf/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/alpha/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sigaction.h: Likewise. * sysdeps/unix/sysv/minix/sigaction.h: Likewise. * sysdeps/unix/sysv/sco3.2.4/sigaction.h: Likewise. * sysdeps/unix/sysv/sysv4/sigaction.h: Likewise. * sysdeps/generic/sigset.h: -> bits/ * sysdeps/unix/sysv/linux/sigset.h: Likewise. * sysdeps/unix/sysv/sysv4/sigset.h: Likewise. * sysdeps/generic/sockaddrcom.h: -> .../bits/sockaddr.h * sysdeps/unix/bsd/bsd4.4/sockaddrcom.h: Likewise. * sysdeps/generic/socketbits.h: -> .../bits/socket.h * sysdeps/unix/sysv/linux/socketbits.h: Likewise. * sysdeps/generic/statfsbuf.h: -> .../bits/statfs.h * sysdeps/unix/sysv/linux/statfsbuf.h: Likewise. * sysdeps/generic/termbits.h: -> .../bits/termios.h * sysdeps/unix/bsd/sun/sunos4/termbits.h: Likewise. * sysdeps/unix/sysv/linux/alpha/termbits.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/termbits.h: Likewise. * sysdeps/unix/sysv/linux/sparc/termbits.h: Likewise. * sysdeps/unix/sysv/linux/termbits.h: Likewise. * sysdeps/generic/ustatbits.h: -> .../bits/ustat.h * sysdeps/unix/sysv/linux/ustatbits.h: Likewise. * sysdeps/generic/utmpbits.h: -> .../bits/utmp.h * sysdeps/gnu/utmpbits.h: Likewise. * sysdeps/unix/sysv/utmpbits.h: Likewise. * sysdeps/generic/utsnamelen.h: -> .../bits/utsname.h * sysdeps/unix/bsd/sun/sunos4/utsnamelen.h: Likewise. * sysdeps/unix/bsd/ultrix4/utsnamelen.h: Likewise. * sysdeps/unix/sysv/linux/utsnamelen.h: Likewise. * sysdeps/unix/sysv/sysv4/utsnamelen.h: Likewise. * sysdeps/unix/sysv/utsnamelen.h: Likewise. * sysdeps/generic/waitstatus.h: -> bits/ * sysdeps/i386/huge_val.h: -> bits/ * sysdeps/ieee754/huge_val.h: Likewise. * sysdeps/m68k/huge_val.h: Likewise. * sysdeps/stub/huge_val.h: Likewise. * sysdeps/vax/huge_val.h: Likewise. * sysdeps/ieee754/nan.h: Likewise. * sysdeps/stub/nan.h: Likewise. * sysdeps/mach/hurd/alpha/sigcontext.h: -> bits/ * sysdeps/mach/hurd/hppa/sigcontext.h: Likewise. * sysdeps/mach/hurd/i386/sigcontext.h: Likewise. * sysdeps/mach/hurd/mips/sigcontext.h: Likewise. * sysdeps/stub/sigcontext.h: Likewise. * sysdeps/unix/bsd/sun/m68k/sigcontext.h: Likewise. * sysdeps/unix/bsd/sun/sparc/sigcontext.h: Likewise. * sysdeps/unix/bsd/ultrix4/mips/sigcontext.h: Likewise. * sysdeps/unix/sysv/linux/sigcontext.h: Likewise. * sysdeps/mach/hurd/errnos.h: -> .../bits/errno.h * sysdeps/standalone/arm/errnos.h: Likewise. * sysdeps/stub/errnos.h: Likewise. * sysdeps/unix/bsd/bsd4.4/errnos.h: Likewise. * sysdeps/unix/sysv/linux/errnos.h: Likewise. * sysdeps/mach/hurd/fcntlbits.h: -> .../bits/fcntl.h * sysdeps/stub/fcntlbits.h: Likewise. * sysdeps/unix/bsd/bsd4.4/fcntlbits.h: Likewise. * sysdeps/unix/bsd/fcntlbits.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/fcntlbits.h: Likewise. * sysdeps/unix/bsd/ultrix4/fcntlbits.h: Likewise. * sysdeps/unix/common/fcntlbits.h: Likewise. * sysdeps/unix/sysv/fcntlbits.h: Likewise. * sysdeps/unix/sysv/irix4/fcntlbits.h: Likewise. * sysdeps/unix/sysv/linux/alpha/fcntlbits.h: Likewise. * sysdeps/unix/sysv/linux/fcntlbits.h: Likewise. * sysdeps/unix/sysv/linux/sparc/fcntlbits.h: Likewise. * sysdeps/mach/hurd/ioctls.h: -> bits/ * sysdeps/stub/ioctls.h: Likewise. * sysdeps/unix/bsd/bsd4.4/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/alpha/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/sparc/ioctls.h: Likewise. * sysdeps/mach/hurd/statbuf.h: -> .../bits/stat.h * sysdeps/stub/statbuf.h: Likewise. * sysdeps/unix/bsd/osf/alpha/statbuf.h: Likewise. * sysdeps/unix/bsd/statbuf.h: Likewise. * sysdeps/unix/sysv/irix4/statbuf.h: Likewise. * sysdeps/unix/sysv/linux/alpha/statbuf.h: Likewise. * sysdeps/unix/sysv/linux/statbuf.h: Likewise. * sysdeps/unix/sysv/statbuf.h: Likewise. * sysdeps/unix/sysv/sysv4/i386/statbuf.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/statbuf.h: Likewise. * sysdeps/standalone/stdio_lim.h: -> bits/ * sysdeps/stub/stdio_lim.h: Likewise. * sysdeps/stub/direntry.h: -> ../bits/dirent.h * sysdeps/unix/bsd/bsd4.4/direntry.h: Likewise. * sysdeps/unix/bsd/direntry.h: Likewise. * sysdeps/unix/common/direntry.h: Likewise. * sysdeps/unix/sysv/direntry.h: Likewise. * sysdeps/unix/sysv/linux/direntry.h: Likewise. * sysdeps/stub/elfclass.h: -> bits/ * sysdeps/wordsize-32/elfclass.h: Likewise. * sysdeps/wordsize-64/elfclass.h: Likewise. * sysdeps/stub/signum.h: -> bits/ * sysdeps/unix/bsd/signum.h: Likewise. * sysdeps/unix/bsd/sun/signum.h: Likewise. * sysdeps/unix/sysv/irix4/signum.h: Likewise. * sysdeps/unix/sysv/linux/alpha/signum.h: Likewise. * sysdeps/unix/sysv/linux/signum.h: Likewise. * sysdeps/unix/sysv/linux/sparc/signum.h: Likewise. * sysdeps/unix/sysv/signum.h: Likewise. * sysdeps/unix/sysv/sysv4/signum.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/signum.h: Likewise. * sysdeps/stub/sys/ipc_buf.h: -> .../bits/ipc.h * sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h: Likewise. * sysdeps/unix/sysv/linux/sys/ipc_buf.h: Likewise. * sysdeps/stub/sys/msq_buf.h: -> .../bits/msq.h * sysdeps/unix/sysv/linux/sys/msq_buf.h: Likewise. * sysdeps/stub/sys/sem_buf.h: -> .../bits/sem.h * sysdeps/unix/sysv/linux/sys/sem_buf.h: Likewise. * sysdeps/stub/sys/shm_buf.h: -> .../bits/shm.h * sysdeps/unix/sysv/linux/sys/shm_buf.h: Likewise. * sysdeps/stub/timebits.h: -> .../bits/time.h * sysdeps/unix/sysv/linux/alpha/timebits.h: Likewise. * sysdeps/unix/sysv/linux/timebits.h: Likewise. * sysdeps/stub/waitflags.h: -> bits/ * sysdeps/unix/bsd/waitflags.h: Likewise. * sysdeps/unix/sysv/linux/waitflags.h: Likewise. * sysdeps/unix/sysv/sysv4/waitflags.h: Likewise. * sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h: -> ../ * sysdeps/unix/sysv/linux/powerpc/sys/kernel_termios.h: Likewise. * sysdeps/unix/sysv/linux/sys/kernel_termios.h: Likewise. * sysdeps/unix/sysv/linux/sys/socketcall.h: -> ../ * argp/argp-fmtstream.h: Standardize the multiple-include protect. * argp/argp.h: Likewise. * catgets/nl_types.h: Likewise. * crypt/sysdeps/unix/crypt.h: Likewise. * ctype/ctype.h: Likewise. * db/db.h: Likewise. * db/mpool.h: Likewise. * db/ndbm.h: Likewise. * dirent/dirent.h: Likewise. * elf/dlfcn.h: Likewise. * elf/elf.h: Likewise. * elf/link.h: Likewise. * gmon/sys/gmon.h: Likewise. * gmon/sys/gmon_out.h: Likewise. * grp/grp.h: Likewise. * inet/aliases.h: Likewise. * inet/arpa/ftp.h: Likewise. * inet/arpa/inet.h: Likewise. * inet/arpa/telnet.h: Likewise. * inet/arpa/tftp.h: Likewise. * inet/netinet/ether.h: Likewise. * inet/netinet/icmp6.h: Likewise. * inet/netinet/in.h: Likewise. * inet/netinet/ip6.h: Likewise. * inet/protocols/routed.h: Likewise. * inet/protocols/rwhod.h: Likewise. * inet/protocols/talkd.h: Likewise. * inet/protocols/timed.h: Likewise. * intl/libintl.h: Likewise. * io/fcntl.h: Likewise. * io/fts.h: Likewise. * io/ftw.h: Likewise. * io/sys/poll.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/utime.h: Likewise. * linuxthreads/semaphore.h: Likewise. * linuxthreads/sysdeps/pthread/pthread.h: Likewise. * locale/locale.h: Likewise. * login/pty.h: Likewise. * login/utmp.h: Likewise. * malloc/malloc.h: Likewise. * malloc/obstack.h: Likewise. * math/complex.h: Likewise. * math/fenv.h: Likewise. * math/math.h: Likewise. * md5-crypt/md5.h: Likewise. * misc/ar.h: Likewise. * misc/err.h: Likewise. * misc/error.h: Likewise. * misc/fstab.h: Likewise. * misc/libgen.h: Likewise. * misc/nlist.h: Likewise. * misc/sys/cdefs.h: Likewise. * misc/sys/file.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/queue.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/syslog.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sysexits.h: Likewise. * misc/ttyent.h: Likewise. * nss/nss.h: Likewise. * posix/fnmatch.h: Likewise. * posix/getopt.h: Likewise. * posix/glob.h: Likewise. * posix/regex.h: Likewise. * posix/sys/times.h: Likewise. * posix/sys/types.h: Likewise. * posix/sys/utsname.h: Likewise. * posix/sys/wait.h: Likewise. * posix/tar.h: Likewise. * posix/unistd.h: Likewise. * posix/wordexp.h: Likewise. * pwd/pwd.h: Likewise. * resolv/arpa/nameser.h: Likewise. * resolv/netdb.h: Likewise. * resolv/resolv.h: Likewise. * resource/sys/resource.h: Likewise. * resource/sys/vlimit.h: Likewise. * resource/sys/vtimes.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/shadow.h: Likewise. * socket/sys/socket.h: Likewise. * socket/sys/un.h: Likewise. * stdlib/exit.h: Likewise. * stdlib/fmtmsg.h: Likewise. * stdlib/monetary.h: Likewise. * stdlib/stdlib.h: Likewise. * string/argz.h: Likewise. * string/envz.h: Likewise. * string/memory.h: Likewise. * string/string.h: Likewise. * string/strings.h: Likewise. * sunrpc/rpc/rpc.h: Likewise. * sunrpc/rpc/svc.h: Likewise. * sunrpc/rpc/types.h: Likewise. * sunrpc/rpc/xdr.h: Likewise. * termios/sys/ttychars.h: Likewise. * termios/termios.h: Likewise. * argp/argp-parse.c: <foo.h> -> <bits/foo.h>. * crypt/sysdeps/unix/crypt_util.c: Likewise. * dirent/dirent.h: Likewise. * elf/link.h: Likewise. * grp/fgetgrent.c: Likewise. * grp/grp.h: Likewise. * hurd/hurd/ioctl.h: Likewise. * inet/getnameinfo.c: Likewise. * inet/getnetgrent_r.c: Likewise. * inet/inet_ntoa.c: Likewise. * inet/netinet/in.h: Likewise. * io/fcntl.h: Likewise. * io/ftw.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/utime.h: Likewise. * libio/_G_config.h: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/stdio.h: Likewise. * linuxthreads/lockfile.c: Likewise. * linuxthreads/semaphore.h: Likewise. * locale/duplocale.c: Likewise. * locale/freelocale.c: Likewise. * locale/lc-time.c: Likewise. * locale/setlocale.c: Likewise. * login/getutent_r.c: Likewise. * login/getutid_r.c: Likewise. * login/getutline_r.c: Likewise. * login/lastlog.h: Likewise. * login/pty.h: Likewise. * login/utmp.h: Likewise. * login/utmpname.c: Likewise. * malloc/mtrace.c: Likewise. * malloc/thread-m.h: Likewise. * math/complex.h: Likewise. * math/fenv.h: Likewise. * math/libm-test.c: Likewise. * math/math.h: Likewise. * misc/sgtty.h: Likewise. * misc/stab.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sys/ustat.h: Likewise. * misc/syslog.c: Likewise. * nis/nss_compat/compat-grp.c: Likewise. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-netgrp.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-publickey.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nss_nisplus/nisplus-alias.c: Likewise. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-netgrp.c: Likewise. * nis/nss_nisplus/nisplus-netgrp.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. * nis/ypclnt.c: Likewise. * nss/getXXbyYY.c: Likewise. * nss/getXXent.c: Likewise. * nss/getXXent_r.c: Likewise. * nss/nss_db/db-XXX.c: Likewise. * nss/nss_db/db-alias.c: Likewise. * nss/nss_db/db-netgrp.c: Likewise. * nss/nss_files/files-XXX.c: Likewise. * nss/nss_files/files-alias.c: Likewise. * nss/nsswitch.c: Likewise. * posix/sched.h: Likewise. * posix/sys/types.h: Likewise. * posix/sys/utsname.h: Likewise. * posix/sys/wait.h: Likewise. * posix/unistd.h: Likewise. * pwd/fgetpwent.c: Likewise. * pwd/pwd.h: Likewise. * resource/sys/resource.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/fgetspent.c: Likewise. * shadow/lckpwdf.c: Likewise. * shadow/sgetspent.c: Likewise. * signal/signal.h: Likewise. * signal/sigsetops.c: Likewise. * socket/sys/socket.h: Likewise. * socket/sys/un.h: Likewise. * stdio/stdio.h: Likewise. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * stdlib/atexit.c: Likewise. * stdlib/fmtmsg.c: Likewise. * stdlib/random.c: Likewise. * string/endian.h: Likewise. * sysdeps/alpha/w_sqrt.S: Likewise. * sysdeps/arm/__longjmp.S: Likewise. * sysdeps/arm/setjmp.S: Likewise. * sysdeps/generic/abort.c: Likewise. * sysdeps/generic/netinet/ip.h: Likewise. * sysdeps/generic/setenv.c: Likewise. * generic/sys/mman.h: Likewise. * sysdeps/i386/__longjmp.S: Likewise. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/mach/hurd/dirstream.h: Likewise. * sysdeps/mach/hurd/jmp-unwind.c: Likewise. * sysdeps/posix/mk-stdiolim.c: Likewise. * sysdeps/powerpc/__longjmp.S: Likewise. * sysdeps/powerpc/setjmp.S: Likewise. * sysdeps/sparc/__longjmp.S: Likewise. * sysdeps/sparc/setjmp.S: Likewise. * sysdeps/standalone/close.c: Likewise. * sysdeps/standalone/filedesc.h: Likewise. * sysdeps/standalone/open.c: Likewise. * sysdeps/unix/bsd/bsd4.4/tcsetattr.c: Likewise. * sysdeps/unix/bsd/m68k/sysdep.S: Likewise. * sysdeps/unix/bsd/osf/sys/mman.h: Likewise. * sysdeps/unix/bsd/sun/m68k/sethostid.S: Likewise. * sysdeps/unix/bsd/sun/sparc/sethostid.S: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/mman.h: Likewise. * sysdeps/unix/bsd/ultrix4/sys/mman.h: Likewise. * sysdeps/unix/bsd/vax/sysdep.S: Likewise. * sysdeps/unix/dirstream.h: Likewise. * sysdeps/unix/i386/sysdep.S: Likewise. * sysdeps/unix/mips/sysdep.S: Likewise. * sysdeps/unix/mk-local_lim.c: Likewise. * sysdeps/unix/sparc/sysdep.S: Likewise. * sysdeps/unix/sysv/irix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/alpha/brk.S: Likewise. * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise. * sysdeps/unix/sysv/linux/arm/clone.S: Likewise. * sysdeps/unix/sysv/linux/i386/clone.S: Likewise. * sysdeps/unix/sysv/linux/m68k/clone.S: Likewise. * sysdeps/unix/sysv/linux/netinet/ip.h: Likewise. * sysdeps/unix/sysv/linux/netinet/tcp.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/clone.S: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/sys/syscall.h: Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c: Likewise. * sysdeps/unix/sysv/sco3.2.4/sysconf.S: Likewise. * sysdeps/unix/sysv/sysv4/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S: Likewise. * sysvipc/sys/ipc.h: Likewise. * sysvipc/sys/msg.h: Likewise. * sysvipc/sys/sem.h: Likewise. * sysvipc/sys/shm.h: Likewise. * termios/termios.h: Likewise. * time/localtime.c: Likewise. * time/sys/time.h: Likewise. * time/time.h: Likewise. * time/tzset.c: Likewise. * sysdeps/unix/sysv/linux/arm/socket.S: socketcall.h change. * sysdeps/unix/sysv/linux/i386/socket.S: Likewise. * sysdeps/unix/sysv/linux/m68k/socket.S: Likewise. * sysdeps/unix/sysv/linux/powerpc/socket.S: Likewise. * sysdeps/unix/sysv/linux/sparc/socket.S: Likewise. * Makefile (headers): foo.h -> bits/foo.h. * dirent/Makefile: Likewise. * elf/Makefile: Likewise. * io/Makefile: Likewise. * linuxthreads/Makefile: Likewise. * linuxthreads/sysdeps/pthread/Makefile: Likewise. * login/Makefile: Likewise. * math/Makefile: Likewise. * misc/Makefile: Likewise. * posix/Makefile: Likewise. * resource/Makefile: Likewise. * setjmp/Makefile: Likewise. * signal/Makefile: Likewise. * socket/Makefile: Likewise. * stdio-common/Makefile: Likewise. * sysdeps/unix/sysv/linux/Makefile: Likewise. * sysvipc/Makefile: Likewise. * termios/Makefile: Likewise. * time/Makefile: Likewise. * sysdeps/generic/Makefile (make_siglist-CFLAGS): Likewise. * sysdeps/posix/Makefile: stdio_lim.h -> bits/stdio_lim.h * sysdeps/unix/Makefile: Likewise with local_lim.h, errnos.h, ioctls.h, termbits.h. * sysdeps/unix/sysv/linux/Dist: sys/kernel_termios.h -> kernel_termios.h, sys/socketcall.h -> socketcall.h * elf/elf.h: Use <inttypes.h> definitions instead of __attribute__ for getting the proper length on the ELF types to be friendly to non-gcc compilers. * posix/sys/types.h: Notice when int8_t and friends are defined and don't redefine them. * sysdeps/wordsize-32/inttypes.h: Likewise. * sysdeps/wordsize-64/inttypes.h: Likewise. * sysdeps/unix/sysv/linux/arm/profil-counter.h: Get sigcontext via <signal.h> instead. * sysdeps/unix/sysv/linux/i386/profil-counter.h: Likewise. * sysdeps/unix/sysv/linux/sparc/profil-counter.h: Likewise. 1997-06-20 17:59 Kazumoto Kojima <kkojima@kk.info.kanagawa-u.ac.jp> * hurd/intr-msg.c: More 64bit changes. * mach/msg-destroy.c: Likewise. * sysdeps/mach/hurd/ioctl.c: Likewise. * sysdeps/mach/hurd/ioctls.h: Likewise. * sysdeps/mach/hurd/select.c: Likewise. * sysdeps/mach/hurd/statbuf.h: Likewise. * sysdeps/mach/hurd/mips/dl-machine.c: Hurd/MIPS64 patches. * sysdeps/mach/hurd/mips/exc2signal.c: Likewise. * sysdeps/mach/hurd/mips/init-fault.c: Likewise. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/mach/hurd/mips/intr-msg.h: Likewise. * sysdeps/mach/hurd/mips/longjmp-ctx.c: Likewise. * sysdeps/mach/hurd/mips/longjmp-ts.c: Likewise. * sysdeps/mach/hurd/mips/sigcontext.h: Likewise. * sysdeps/mach/hurd/mips/sigreturn.c: Likewise. * sysdeps/mach/hurd/mips/trampoline.c: Likewise. * sysdeps/mach/mips/cacheflush.c: Likewise. * sysdeps/mach/mips/machine-lock.h: Likewise. * sysdeps/mach/mips/machine-sp.h: Likewise. * sysdeps/mach/mips/syscall.S: Likewise. * sysdeps/mach/mips/sysdep.h: Likewise. * sysdeps/mach/mips/thread_state.h: Likewise. * sysdeps/mach/start.c: Likewise. * sysdeps/mips/dl-machine.h: MIPS changes. * sysdeps/mips/elf/start.S: Likewise. * sysdeps/mips/init-first.c: Likewise. * sysdeps/mips/fpu_control.h: Likewise. * sysdeps/mips/machine-gmon.h: Likewise. * sysdeps/mips/jmp_buf.h: Likewise. * sysdeps/mips/__longjmp.c: Likewise. * sysdeps/mips/bsd-_setjmp.S: Likewise. * sysdeps/mips/bsd-setjmp.S: Likewise. * sysdeps/mips/setjmp.S: Likewise. * sysdeps/mips/setjmp_aux.c: Likewise. * sysdeps/mips/mips64/gmp-mparam.h: Likewise. * sysdeps/mips/add_n.S: New file. * sysdeps/mips/addmul_1.S: Likewise. * sysdeps/mips/lshift.S: Likewise. * sysdeps/mips/mul_1.S: Likewise. * sysdeps/mips/rshift.S: Likewise. * sysdeps/mips/sub_n.S: Likewise. * sysdeps/mips/submul_1.S: Likewise. * sysdeps/mips/mips64/Implies: Likewise. * sysdeps/mips/mips64/add_n.S: Likewise. * sysdeps/mips/mips64/addmul_1.S: Likewise. * sysdeps/mips/mips64/lshift.S: Likewise. * sysdeps/mips/mips64/mul_1.S: Likewise. * sysdeps/mips/mips64/rshift.S: Likewise. * sysdeps/mips/mips64/sub_n.S: Likewise. * sysdeps/mips/mips64/submul_1.S: Likewise. * sysdeps/mips/add_n.S: Removed. * sysdeps/mips/addmul_1.S: Likewise. * sysdeps/mips/lshift.S: Likewise. * sysdeps/mips/mul_1.S: Likewise. * sysdeps/mips/rshift.S: Likewise. * sysdeps/mips/sub_n.S: Likewise. * sysdeps/mips/submul_1.S: Likewise. * nss/Makefile: Prepare for static NSS. * resolv/Makefile: Likewise. * nss/nsswitch.c: Add code for static NSS. * nss/function.def: Define functions for static NSS. 1997-06-19 11:10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libc.map: Add yet more symbols. 1997-06-19 20:33 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-lookup.c (_dl_lookup_versioned_symbol): Don't pass NULL as object name to _dl_signal_error. (do_lookup): Skip objects that could not be opened. * sysdeps/m68k/dl-machine.h (elf_machine_rela): Check that the symbol was found. * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_rela): Likewise. 1997-06-20 03:13 Kazumoto Kojima <kkojima@kk.info.kanagawa-u.ac.jp> * ctype/ctype-info.c: Use int32_t where `int' with 4 bytes is assumed. * ctype/ctype.h: Likewise. * math/math_private.h: Likewise. * inet/netinet/in.h: Likewise. * wctype/wctype.h: Likewise. * nss/Makefile: Only inhibit nss_files and nss_db modules if static NSS modules are not enabled. * resolv/Makefile: Likewise for nss_dns. * nss/function.def: New file. List all available lookup functions for static NSS. * nss/nsswitch.c: Add code for static NSS. 1997-06-15 21:15 Andreas Jaeger <aj@arthur.rhein-neckar.de> * math/libm-test.c (gamma_test): Test for _SVID_ and for normal behaviour. 1997-06-15 20:32 Andreas Jaeger <aj@arthur.rhein-neckar.de> * math/libm.map: Add all necessary functions, correct existing entries. 1997-06-20 02:35 a sun <asun@zoology.washington.edu> * sysdeps/unix/sysv/linux/netipx/ipx.h: Don't use kernel header. 1997-06-19 18:43 Andreas Jaeger <aj@arthur.rhein-neckar.de> * nis/nss_nisplus/nisplus-spwd.c (_nss_nisplus_parse_spent): Compare pointer with NULL. * login/logout.c (logout): Compare pututline result with NULL. * inet/rcmd.c: Correct a few typos. Reported by Erik Troan.
591 lines
22 KiB
C
591 lines
22 KiB
C
/* obstack.h - object stack macros
|
||
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||
|
||
This file is part of the GNU C Library. Its master source is NOT part of
|
||
the C library, however. The master source lives in /gd/gnu/lib.
|
||
|
||
The GNU C Library is free software; you can redistribute it and/or
|
||
modify it under the terms of the GNU Library General Public License as
|
||
published by the Free Software Foundation; either version 2 of the
|
||
License, or (at your option) any later version.
|
||
|
||
The GNU C Library is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
Library General Public License for more details.
|
||
|
||
You should have received a copy of the GNU Library General Public
|
||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||
Boston, MA 02111-1307, USA. */
|
||
|
||
/* Summary:
|
||
|
||
All the apparent functions defined here are macros. The idea
|
||
is that you would use these pre-tested macros to solve a
|
||
very specific set of problems, and they would run fast.
|
||
Caution: no side-effects in arguments please!! They may be
|
||
evaluated MANY times!!
|
||
|
||
These macros operate a stack of objects. Each object starts life
|
||
small, and may grow to maturity. (Consider building a word syllable
|
||
by syllable.) An object can move while it is growing. Once it has
|
||
been "finished" it never changes address again. So the "top of the
|
||
stack" is typically an immature growing object, while the rest of the
|
||
stack is of mature, fixed size and fixed address objects.
|
||
|
||
These routines grab large chunks of memory, using a function you
|
||
supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
|
||
by calling `obstack_chunk_free'. You must define them and declare
|
||
them before using any obstack macros.
|
||
|
||
Each independent stack is represented by a `struct obstack'.
|
||
Each of the obstack macros expects a pointer to such a structure
|
||
as the first argument.
|
||
|
||
One motivation for this package is the problem of growing char strings
|
||
in symbol tables. Unless you are "fascist pig with a read-only mind"
|
||
--Gosper's immortal quote from HAKMEM item 154, out of context--you
|
||
would not like to put any arbitrary upper limit on the length of your
|
||
symbols.
|
||
|
||
In practice this often means you will build many short symbols and a
|
||
few long symbols. At the time you are reading a symbol you don't know
|
||
how long it is. One traditional method is to read a symbol into a
|
||
buffer, realloc()ating the buffer every time you try to read a symbol
|
||
that is longer than the buffer. This is beaut, but you still will
|
||
want to copy the symbol from the buffer to a more permanent
|
||
symbol-table entry say about half the time.
|
||
|
||
With obstacks, you can work differently. Use one obstack for all symbol
|
||
names. As you read a symbol, grow the name in the obstack gradually.
|
||
When the name is complete, finalize it. Then, if the symbol exists already,
|
||
free the newly read name.
|
||
|
||
The way we do this is to take a large chunk, allocating memory from
|
||
low addresses. When you want to build a symbol in the chunk you just
|
||
add chars above the current "high water mark" in the chunk. When you
|
||
have finished adding chars, because you got to the end of the symbol,
|
||
you know how long the chars are, and you can create a new object.
|
||
Mostly the chars will not burst over the highest address of the chunk,
|
||
because you would typically expect a chunk to be (say) 100 times as
|
||
long as an average object.
|
||
|
||
In case that isn't clear, when we have enough chars to make up
|
||
the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
|
||
so we just point to it where it lies. No moving of chars is
|
||
needed and this is the second win: potentially long strings need
|
||
never be explicitly shuffled. Once an object is formed, it does not
|
||
change its address during its lifetime.
|
||
|
||
When the chars burst over a chunk boundary, we allocate a larger
|
||
chunk, and then copy the partly formed object from the end of the old
|
||
chunk to the beginning of the new larger chunk. We then carry on
|
||
accreting characters to the end of the object as we normally would.
|
||
|
||
A special macro is provided to add a single char at a time to a
|
||
growing object. This allows the use of register variables, which
|
||
break the ordinary 'growth' macro.
|
||
|
||
Summary:
|
||
We allocate large chunks.
|
||
We carve out one object at a time from the current chunk.
|
||
Once carved, an object never moves.
|
||
We are free to append data of any size to the currently
|
||
growing object.
|
||
Exactly one object is growing in an obstack at any one time.
|
||
You can run one obstack per control block.
|
||
You may have as many control blocks as you dare.
|
||
Because of the way we do it, you can `unwind' an obstack
|
||
back to a previous state. (You may remove objects much
|
||
as you would with a stack.)
|
||
*/
|
||
|
||
|
||
/* Don't do the contents of this file more than once. */
|
||
|
||
#ifndef _OBSTACK_H
|
||
#define _OBSTACK_H 1
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
/* We use subtraction of (char *) 0 instead of casting to int
|
||
because on word-addressable machines a simple cast to int
|
||
may ignore the byte-within-word field of the pointer. */
|
||
|
||
#ifndef __PTR_TO_INT
|
||
#define __PTR_TO_INT(P) ((P) - (char *) 0)
|
||
#endif
|
||
|
||
#ifndef __INT_TO_PTR
|
||
#define __INT_TO_PTR(P) ((P) + (char *) 0)
|
||
#endif
|
||
|
||
/* We need the type of the resulting object. In ANSI C it is ptrdiff_t
|
||
but in traditional C it is usually long. If we are in ANSI C and
|
||
don't already have ptrdiff_t get it. */
|
||
|
||
#if defined (__STDC__) && __STDC__ && ! defined (offsetof)
|
||
#if defined (__GNUC__) && defined (IN_GCC)
|
||
/* On Next machine, the system's stddef.h screws up if included
|
||
after we have defined just ptrdiff_t, so include all of stddef.h.
|
||
Otherwise, define just ptrdiff_t, which is all we need. */
|
||
#ifndef __NeXT__
|
||
#define __need_ptrdiff_t
|
||
#endif
|
||
#endif
|
||
|
||
#include <stddef.h>
|
||
#endif
|
||
|
||
#if defined (__STDC__) && __STDC__
|
||
#define PTR_INT_TYPE ptrdiff_t
|
||
#else
|
||
#define PTR_INT_TYPE long
|
||
#endif
|
||
|
||
#if defined (_LIBC) || defined (HAVE_STRING_H)
|
||
#include <string.h>
|
||
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
|
||
#else
|
||
#ifdef memcpy
|
||
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
|
||
#else
|
||
#define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
|
||
#endif
|
||
#endif
|
||
|
||
struct _obstack_chunk /* Lives at front of each chunk. */
|
||
{
|
||
char *limit; /* 1 past end of this chunk */
|
||
struct _obstack_chunk *prev; /* address of prior chunk or NULL */
|
||
char contents[4]; /* objects begin here */
|
||
};
|
||
|
||
struct obstack /* control current object in current chunk */
|
||
{
|
||
long chunk_size; /* preferred size to allocate chunks in */
|
||
struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
|
||
char *object_base; /* address of object we are building */
|
||
char *next_free; /* where to add next char to current object */
|
||
char *chunk_limit; /* address of char after current chunk */
|
||
PTR_INT_TYPE temp; /* Temporary for some macros. */
|
||
int alignment_mask; /* Mask of alignment for each object. */
|
||
#if defined (__STDC__) && __STDC__
|
||
/* These prototypes vary based on `use_extra_arg', and we use
|
||
casts to the prototypeless function type in all assignments,
|
||
but having prototypes here quiets -Wstrict-prototypes. */
|
||
struct _obstack_chunk *(*chunkfun) (void *, long);
|
||
void (*freefun) (void *, struct _obstack_chunk *);
|
||
void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
|
||
#else
|
||
struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
|
||
void (*freefun) (); /* User's function to free a chunk. */
|
||
char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
|
||
#endif
|
||
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
|
||
unsigned maybe_empty_object:1;/* There is a possibility that the current
|
||
chunk contains a zero-length object. This
|
||
prevents freeing the chunk if we allocate
|
||
a bigger chunk to replace it. */
|
||
unsigned alloc_failed:1; /* No longer used, as we now call the failed
|
||
handler on error, but retained for binary
|
||
compatibility. */
|
||
};
|
||
|
||
/* Declare the external functions we use; they are in obstack.c. */
|
||
|
||
#if defined (__STDC__) && __STDC__
|
||
extern void _obstack_newchunk (struct obstack *, int);
|
||
extern void _obstack_free (struct obstack *, void *);
|
||
extern int _obstack_begin (struct obstack *, int, int,
|
||
void *(*) (long), void (*) (void *));
|
||
extern int _obstack_begin_1 (struct obstack *, int, int,
|
||
void *(*) (void *, long),
|
||
void (*) (void *, void *), void *);
|
||
extern int _obstack_memory_used (struct obstack *);
|
||
#else
|
||
extern void _obstack_newchunk ();
|
||
extern void _obstack_free ();
|
||
extern int _obstack_begin ();
|
||
extern int _obstack_begin_1 ();
|
||
extern int _obstack_memory_used ();
|
||
#endif
|
||
|
||
#if defined (__STDC__) && __STDC__
|
||
|
||
/* Do the function-declarations after the structs
|
||
but before defining the macros. */
|
||
|
||
void obstack_init (struct obstack *obstack);
|
||
|
||
void * obstack_alloc (struct obstack *obstack, int size);
|
||
|
||
void * obstack_copy (struct obstack *obstack, void *address, int size);
|
||
void * obstack_copy0 (struct obstack *obstack, void *address, int size);
|
||
|
||
void obstack_free (struct obstack *obstack, void *block);
|
||
|
||
void obstack_blank (struct obstack *obstack, int size);
|
||
|
||
void obstack_grow (struct obstack *obstack, void *data, int size);
|
||
void obstack_grow0 (struct obstack *obstack, void *data, int size);
|
||
|
||
void obstack_1grow (struct obstack *obstack, int data_char);
|
||
void obstack_ptr_grow (struct obstack *obstack, void *data);
|
||
void obstack_int_grow (struct obstack *obstack, int data);
|
||
|
||
void * obstack_finish (struct obstack *obstack);
|
||
|
||
int obstack_object_size (struct obstack *obstack);
|
||
|
||
int obstack_room (struct obstack *obstack);
|
||
void obstack_make_room (struct obstack *obstack, int size);
|
||
void obstack_1grow_fast (struct obstack *obstack, int data_char);
|
||
void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
|
||
void obstack_int_grow_fast (struct obstack *obstack, int data);
|
||
void obstack_blank_fast (struct obstack *obstack, int size);
|
||
|
||
void * obstack_base (struct obstack *obstack);
|
||
void * obstack_next_free (struct obstack *obstack);
|
||
int obstack_alignment_mask (struct obstack *obstack);
|
||
int obstack_chunk_size (struct obstack *obstack);
|
||
int obstack_memory_used (struct obstack *obstack);
|
||
|
||
#endif /* __STDC__ */
|
||
|
||
/* Non-ANSI C cannot really support alternative functions for these macros,
|
||
so we do not declare them. */
|
||
|
||
/* Error handler called when `obstack_chunk_alloc' failed to allocate
|
||
more memory. This can be set to a user defined function. The
|
||
default action is to print a message and abort. */
|
||
#if defined (__STDC__) && __STDC__
|
||
extern void (*obstack_alloc_failed_handler) (void);
|
||
#else
|
||
extern void (*obstack_alloc_failed_handler) ();
|
||
#endif
|
||
|
||
/* Exit value used when `print_and_abort' is used. */
|
||
extern int obstack_exit_failure;
|
||
|
||
/* Pointer to beginning of object being allocated or to be allocated next.
|
||
Note that this might not be the final address of the object
|
||
because a new chunk might be needed to hold the final size. */
|
||
|
||
#define obstack_base(h) ((h)->object_base)
|
||
|
||
/* Size for allocating ordinary chunks. */
|
||
|
||
#define obstack_chunk_size(h) ((h)->chunk_size)
|
||
|
||
/* Pointer to next byte not yet allocated in current chunk. */
|
||
|
||
#define obstack_next_free(h) ((h)->next_free)
|
||
|
||
/* Mask specifying low bits that should be clear in address of an object. */
|
||
|
||
#define obstack_alignment_mask(h) ((h)->alignment_mask)
|
||
|
||
/* To prevent prototype warnings provide complete argument list in
|
||
standard C version. */
|
||
#if defined (__STDC__) && __STDC__
|
||
|
||
#define obstack_init(h) \
|
||
_obstack_begin ((h), 0, 0, \
|
||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||
|
||
#define obstack_begin(h, size) \
|
||
_obstack_begin ((h), (size), 0, \
|
||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||
|
||
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||
_obstack_begin ((h), (size), (alignment), \
|
||
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
|
||
|
||
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||
_obstack_begin_1 ((h), (size), (alignment), \
|
||
(void *(*) (void *, long)) (chunkfun), \
|
||
(void (*) (void *, void *)) (freefun), (arg))
|
||
|
||
#define obstack_chunkfun(h, newchunkfun) \
|
||
((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
|
||
|
||
#define obstack_freefun(h, newfreefun) \
|
||
((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
|
||
|
||
#else
|
||
|
||
#define obstack_init(h) \
|
||
_obstack_begin ((h), 0, 0, \
|
||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||
|
||
#define obstack_begin(h, size) \
|
||
_obstack_begin ((h), (size), 0, \
|
||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||
|
||
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||
_obstack_begin ((h), (size), (alignment), \
|
||
(void *(*) ()) (chunkfun), (void (*) ()) (freefun))
|
||
|
||
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||
_obstack_begin_1 ((h), (size), (alignment), \
|
||
(void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
|
||
|
||
#define obstack_chunkfun(h, newchunkfun) \
|
||
((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
|
||
|
||
#define obstack_freefun(h, newfreefun) \
|
||
((h) -> freefun = (void (*)()) (newfreefun))
|
||
|
||
#endif
|
||
|
||
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
|
||
|
||
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
|
||
|
||
#define obstack_memory_used(h) _obstack_memory_used (h)
|
||
|
||
#if defined (__GNUC__) && defined (__STDC__) && __STDC__
|
||
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
|
||
does not implement __extension__. But that compiler doesn't define
|
||
__GNUC_MINOR__. */
|
||
#if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
|
||
#define __extension__
|
||
#endif
|
||
|
||
/* For GNU C, if not -traditional,
|
||
we can define these macros to compute all args only once
|
||
without using a global variable.
|
||
Also, we can avoid using the `temp' slot, to make faster code. */
|
||
|
||
#define obstack_object_size(OBSTACK) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
(unsigned) (__o->next_free - __o->object_base); })
|
||
|
||
#define obstack_room(OBSTACK) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
(unsigned) (__o->chunk_limit - __o->next_free); })
|
||
|
||
#define obstack_make_room(OBSTACK,length) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
int __len = (length); \
|
||
if (__o->chunk_limit - __o->next_free < __len) \
|
||
_obstack_newchunk (__o, __len); \
|
||
(void) 0; })
|
||
|
||
#define obstack_grow(OBSTACK,where,length) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
int __len = (length); \
|
||
if (__o->next_free + __len > __o->chunk_limit) \
|
||
_obstack_newchunk (__o, __len); \
|
||
_obstack_memcpy (__o->next_free, (char *) (where), __len); \
|
||
__o->next_free += __len; \
|
||
(void) 0; })
|
||
|
||
#define obstack_grow0(OBSTACK,where,length) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
int __len = (length); \
|
||
if (__o->next_free + __len + 1 > __o->chunk_limit) \
|
||
_obstack_newchunk (__o, __len + 1); \
|
||
_obstack_memcpy (__o->next_free, (char *) (where), __len); \
|
||
__o->next_free += __len; \
|
||
*(__o->next_free)++ = 0; \
|
||
(void) 0; })
|
||
|
||
#define obstack_1grow(OBSTACK,datum) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
if (__o->next_free + 1 > __o->chunk_limit) \
|
||
_obstack_newchunk (__o, 1); \
|
||
*(__o->next_free)++ = (datum); \
|
||
(void) 0; })
|
||
|
||
/* These assume that the obstack alignment is good enough for pointers or ints,
|
||
and that the data added so far to the current object
|
||
shares that much alignment. */
|
||
|
||
#define obstack_ptr_grow(OBSTACK,datum) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
|
||
_obstack_newchunk (__o, sizeof (void *)); \
|
||
*((void **)__o->next_free)++ = ((void *)datum); \
|
||
(void) 0; })
|
||
|
||
#define obstack_int_grow(OBSTACK,datum) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
|
||
_obstack_newchunk (__o, sizeof (int)); \
|
||
*((int *)__o->next_free)++ = ((int)datum); \
|
||
(void) 0; })
|
||
|
||
#define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
|
||
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
|
||
|
||
#define obstack_blank(OBSTACK,length) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
int __len = (length); \
|
||
if (__o->chunk_limit - __o->next_free < __len) \
|
||
_obstack_newchunk (__o, __len); \
|
||
__o->next_free += __len; \
|
||
(void) 0; })
|
||
|
||
#define obstack_alloc(OBSTACK,length) \
|
||
__extension__ \
|
||
({ struct obstack *__h = (OBSTACK); \
|
||
obstack_blank (__h, (length)); \
|
||
obstack_finish (__h); })
|
||
|
||
#define obstack_copy(OBSTACK,where,length) \
|
||
__extension__ \
|
||
({ struct obstack *__h = (OBSTACK); \
|
||
obstack_grow (__h, (where), (length)); \
|
||
obstack_finish (__h); })
|
||
|
||
#define obstack_copy0(OBSTACK,where,length) \
|
||
__extension__ \
|
||
({ struct obstack *__h = (OBSTACK); \
|
||
obstack_grow0 (__h, (where), (length)); \
|
||
obstack_finish (__h); })
|
||
|
||
/* The local variable is named __o1 to avoid a name conflict
|
||
when obstack_blank is called. */
|
||
#define obstack_finish(OBSTACK) \
|
||
__extension__ \
|
||
({ struct obstack *__o1 = (OBSTACK); \
|
||
void *value; \
|
||
value = (void *) __o1->object_base; \
|
||
if (__o1->next_free == value) \
|
||
__o1->maybe_empty_object = 1; \
|
||
__o1->next_free \
|
||
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
|
||
& ~ (__o1->alignment_mask)); \
|
||
if (__o1->next_free - (char *)__o1->chunk \
|
||
> __o1->chunk_limit - (char *)__o1->chunk) \
|
||
__o1->next_free = __o1->chunk_limit; \
|
||
__o1->object_base = __o1->next_free; \
|
||
value; })
|
||
|
||
#define obstack_free(OBSTACK, OBJ) \
|
||
__extension__ \
|
||
({ struct obstack *__o = (OBSTACK); \
|
||
void *__obj = (OBJ); \
|
||
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
|
||
__o->next_free = __o->object_base = __obj; \
|
||
else (obstack_free) (__o, __obj); })
|
||
|
||
#else /* not __GNUC__ or not __STDC__ */
|
||
|
||
#define obstack_object_size(h) \
|
||
(unsigned) ((h)->next_free - (h)->object_base)
|
||
|
||
#define obstack_room(h) \
|
||
(unsigned) ((h)->chunk_limit - (h)->next_free)
|
||
|
||
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
|
||
so that we can avoid having void expressions
|
||
in the arms of the conditional expression.
|
||
Casting the third operand to void was tried before,
|
||
but some compilers won't accept it. */
|
||
|
||
#define obstack_make_room(h,length) \
|
||
( (h)->temp = (length), \
|
||
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
|
||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
|
||
|
||
#define obstack_grow(h,where,length) \
|
||
( (h)->temp = (length), \
|
||
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
|
||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
|
||
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
|
||
(h)->next_free += (h)->temp)
|
||
|
||
#define obstack_grow0(h,where,length) \
|
||
( (h)->temp = (length), \
|
||
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
|
||
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
|
||
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
|
||
(h)->next_free += (h)->temp, \
|
||
*((h)->next_free)++ = 0)
|
||
|
||
#define obstack_1grow(h,datum) \
|
||
( (((h)->next_free + 1 > (h)->chunk_limit) \
|
||
? (_obstack_newchunk ((h), 1), 0) : 0), \
|
||
(*((h)->next_free)++ = (datum)))
|
||
|
||
#define obstack_ptr_grow(h,datum) \
|
||
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
|
||
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
|
||
(*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
|
||
|
||
#define obstack_int_grow(h,datum) \
|
||
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
|
||
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
|
||
(*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
|
||
|
||
#define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
|
||
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
|
||
|
||
#define obstack_blank(h,length) \
|
||
( (h)->temp = (length), \
|
||
(((h)->chunk_limit - (h)->next_free < (h)->temp) \
|
||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
|
||
((h)->next_free += (h)->temp))
|
||
|
||
#define obstack_alloc(h,length) \
|
||
(obstack_blank ((h), (length)), obstack_finish ((h)))
|
||
|
||
#define obstack_copy(h,where,length) \
|
||
(obstack_grow ((h), (where), (length)), obstack_finish ((h)))
|
||
|
||
#define obstack_copy0(h,where,length) \
|
||
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
|
||
|
||
#define obstack_finish(h) \
|
||
( ((h)->next_free == (h)->object_base \
|
||
? (((h)->maybe_empty_object = 1), 0) \
|
||
: 0), \
|
||
(h)->temp = __PTR_TO_INT ((h)->object_base), \
|
||
(h)->next_free \
|
||
= __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
|
||
& ~ ((h)->alignment_mask)), \
|
||
(((h)->next_free - (char *) (h)->chunk \
|
||
> (h)->chunk_limit - (char *) (h)->chunk) \
|
||
? ((h)->next_free = (h)->chunk_limit) : 0), \
|
||
(h)->object_base = (h)->next_free, \
|
||
__INT_TO_PTR ((h)->temp))
|
||
|
||
#if defined (__STDC__) && __STDC__
|
||
#define obstack_free(h,obj) \
|
||
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
|
||
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
|
||
? (int) ((h)->next_free = (h)->object_base \
|
||
= (h)->temp + (char *) (h)->chunk) \
|
||
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
|
||
#else
|
||
#define obstack_free(h,obj) \
|
||
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
|
||
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
|
||
? (int) ((h)->next_free = (h)->object_base \
|
||
= (h)->temp + (char *) (h)->chunk) \
|
||
: (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
|
||
#endif
|
||
|
||
#endif /* not __GNUC__ or not __STDC__ */
|
||
|
||
#ifdef __cplusplus
|
||
} /* C++ */
|
||
#endif
|
||
|
||
#endif /* obstack.h */
|