gopher-3.0.15/ 0000775 0000000 0000000 00000000000 12621233174 007755 5 ustar gopher-3.0.15/announcements/ 0000775 0000000 0000000 00000000000 10762617110 012632 5 ustar gopher-3.0.15/announcements/3.0.0.txt 0000664 0000000 0000000 00000021725 10762617110 014040 0 ustar
Gopher Turns 10 / Gopher 3.0 (Furry Terror) Released
January 8, 2002
The Internet Gopher Server and Curses Client is 10 years old!* Since
its [1]announcement in late 1991, Gopher quickly sprang up to be one
of the most innovative technologies of its time. Gopher today still
provides features not found on Web servers -- namely, its idea that
the entire planet is just one big filesystem. Modern browsers such as
Konqueror and Mozilla show it to us that way, even with drag-and-drop
integration with the desktop.
Today we release the Internet Gopher Server and Client version 3.0.
After having been totally unmodified for five years, the Internet
Gopher has kicked back to life. The University of Minnesota placed the
code under the GNU General Public License and an interested group of
hackers set to work on it. A year later, we have this release.
About Gopher
To learn about Gopher, please visit The Gopher Project
[[2]gopher/[3]web], A Brief Introduction to Gopherspace
[[4]gopher/[5]web], or The Gopher Manifesto [[6]gopher/[7]web].
Obtaining Gopher/Gopherd 3.0
Debian sid users may run "apt-get install gopher gopherd" beginning on
approximately January 11.
The source distribution may be downloaded from:
* [8]gopher://gopher.quux.org/1/devel/gopher
* [9]Quux.Org's Web-To-Gopher Interface to the Above
* [10]http://www.quux.org/give-me-gopher/ for people that want a
more conventional HTTP presentation.
Release Notes
* You are encouraged to use ./configure --disable-auth to build.
* BSD users should use "gmake" to build.
Changes since UMN Gopher release 2.3.1
In Brief:
* Many security and buffer overrun fixes
* New security features in gopherd
* Improved handling of MIME types
* Modified to work on modern operating systems. Verified to work in
Linux for multiple platforms and NetBSD/i386. Should also work for
HURD.
* Many other modifications, see below.
A more detailed listing is below -- but it is still abbreviated. The
most current is available from CVS.
gopher (3.0.0-1) unstable; urgency=low
* Patched to work with Hurd. Closes: #115511. Uses
suggestions from James Morrison
but not his patch.
* gopher.c, gopherd/error.c, gopher/download.c:
Modified to use HAVE_STRERROR
* configure.in: Modified with checks for sys/param.h, HURD header files,
get_current_dir_name, etc.
* configure.h.in, configure: rebuilt.
* Moved the current UMN Copyright notice in "COPYING" into "copyright"
* Updated copyright files, etc. with current info.
* Updated the locales with semi-current copyright stuff.
* Updated greeting in gopher and gopherd.
* This is Gopher 3.0.0, the Furry Terror release.
-- John Goerzen Tue, 8 Jan 2002 15:31:00 -0500
gopher (2.3.1-15) unstable; urgency=low
* NetBSD port effort began.
* Added crypt.h to configure.in's list of headers to look for.
Reran autoconf/autoheader.
* Modified gopherd/AUTH.h to include crypt.h only if it's available
and to include unistd.h if it's available. (NetBSD)
* Integrated patches from David Allen
(may have been done earlier anyway)
* config.h.in: rebuilt by autoheader
* configure: rebuilt by autoconf
* configure.in:
* Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
* Added checkes for term.h, re_comp.h, regex.h
* gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
* gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
* Use REGEXLIBS
* gopher/globals.h, gopher/gopher.c: Remove sys_errlist
* object/GSgopherobj.c: Removed #include, now use
"Regex.h" that has proper regex determining logic
* object/Regex.h: Moved regex.h include to here. Make it conditional
based on configure test. Add conditional re_comp.h include.
* gopherd/gopherd.c: Add init of view and filter after setjmp
to eliminate clobbering due to longjmp and a warning. Cast
parameters to *printf to long as appropriate.
* AUTH.h: Add missing AUTHITEMSprocessLine prototype
* AUTH.h: Add a check to prevent including twice.
* gopherdconf.c: Add a missing prototype.
* AUTH.c: add missing include of GGroup.h
* download.c: Added cast to long for some *printf's
* Now compiles with only one warning on NetBSD.
* This is Gopher 20020108-01.cvs
* object/Regex.h: now conditionally includes sys/types.h for regex.h
* This is Gopher 20020108-02.cvs
-- John Goerzen Tue, 8 Jan 2002 13:11:00 -0500
gopher (2.3.1-14) unstable; urgency=low
* Added build-depends on autoconf. Closes: #113255.
-- John Goerzen Thu, 1 Nov 2001 12:49:00 -0500
gopher (2.3.1-13) unstable; urgency=low
* Added Build-Depends. Closes: #94237.
-- John Goerzen Mon, 23 Apr 2001 11:00:04 -0500
gopher (2.3.1-12) unstable; urgency=low
* Only chown /var/gopher if it's just created. Closes: #89557.
-- John Goerzen Fri, 6 Apr 2001 15:35:16 -0500
gopher (2.3.1-11) unstable; urgency=low
* Many sprintf -> snprintf changes.
-- John Goerzen Wed, 17 Jan 2001 15:22:09 -0500
gopher (2.3.1-10) unstable; urgency=low
* Added mp3 MIME type. Closes: #81529.
* Now logs about chroot status on server startup.
-- John Goerzen Wed, 17 Jan 2001 13:11:25 -0500
gopher (2.3.1-9) unstable; urgency=low
* Fixed potential buffer overflows. Closes: #82602.
-- John Goerzen Wed, 17 Jan 2001 12:12:51 -0500
gopher (2.3.1-8) unstable; urgency=low
* Update to latest code in CVS, much from
David Allen
* Fixed dh_testversion to 2.0.103. Closes: #79883.
-- John Goerzen Sat, 6 Jan 2001 20:06:01 -0500
gopher (2.3.1-7) unstable; urgency=low
* A new debian rev to fix the access: problem in the gopherdlocal.conf.
-- John Goerzen Tue, 19 Dec 2000 23:40:09 -0500
gopher (2.3.1-6) unstable; urgency=low
* Added many excellent code patches and cleanups from
David Allen .
-- John Goerzen Tue, 19 Dec 2000 20:18:09 -0500
gopher (2.3.1-5) unstable; urgency=low
* Additional code modifications and fixes.
-- John Goerzen Mon, 18 Dec 2000 17:03:56 -0500
gopher (2.3.1-4) unstable; urgency=low
* Disable authentication for the moment due to security concerns.
-- John Goerzen Tue, 17 Oct 2000 23:49:20 -0500
gopher (2.3.1-3) unstable; urgency=low
* Added startopts as a gopherd conffile.
-- John Goerzen Tue, 22 Aug 2000 22:25:25 -0500
gopher (2.3.1-2) unstable; urgency=low
* Modify postinst to be easier for people to use if they already have
a gopher user.
* Fixed a bug in the restart option for the init script.
* Made debian/copyright more verbose.
-- John Goerzen Tue, 22 Aug 2000 21:57:26 -0500
gopher (2.3.1-1) unstable; urgency=low
* Initial re-release. Package had been yanked after 1995 due to licensing.
* UMN has just GPL'd gopher.
* This package contains the security fix from bugtraq.
* I have patched it to chroot() and setuid() earlier for better
security.
SIDE EFFECT: logging will not work if chroot() is used.
* The extension chopping code was buggy, so I have removed it.
* Made many fixes to eliminate compiler warnings and errors.
* Removed redefinitions of sys_errlist
* Included more header files to bring in relevant prototypes
* Modified to use Debian paths
* Modified configure.in to look for -lcrypt
* Modified Makefile.config.in to use -Wall
* Removed -DSETPROCTITLE from configure.in to make start-stop-daemon
work better.
* Added logrotate
* Wrote Debian support from scratch.
* AUTH.h includes crypt.h
* gopherd/Makefile.in uses separate conffile dir (Debian path)
* STRstring.h had a paren problem; gcc on alpha brought it out. Fixed.
* String.h was missing some header files.
* Other fixes.
-- John Goerzen Thu, 17 Aug 2000 15:16:07 -0500
* The exact date of version 1.0 of UMN gopher's release is not logged,
but this is about the right time.
_________________________________________________________________
$Id: 3.0.0.html,v 1.4 2002/01/08 22:14:44 jgoerzen Exp $
References
Visible links
1. http://groups.google.com/groups?selm=1991Sep10.020238.4751%40cs.umn.edu
2. gopher://gopherproject.org/1/Software/Gopher/
3. http://gopherproject.org/
4. gopher://gopher.floodgap.com/0/gopher/welcome
5. http://quux.org/hurg/hurg?selector=%2Fgopher%2Fwelcome&port=70&type=0&host=gopher.floodgap.com&username=A+Brief+Introduction+to+Gopherspace
6. gopher://gopher.quux.org/0/Software/Gopher/whygopher/gopher-manifesto.txt
7. http://quux.org/hurg/hurg?selector=0%2FSoftware%2FGopher%2Fwhygopher%2Fgopher-manifesto.txt&port=70&type=0&host=gopher.quux.org&username=Gopher+Manifesto
8. gopher://gopher.quux.org/1/devel/gopher
9. http://quux.org/hurg/hurg?selector=1%2Fdevel%2Fgopher&port=70&type=1&host=gopher.quux.org&username=Gopher
10. http://www.quux.org/give-me-gopher/
Hidden links:
11. mailto:jgoerzen@complete.org
gopher-3.0.15/announcements/3.0.4.html 0000664 0000000 0000000 00000005701 10762617110 014165 0 ustar
Gopher (FurryTerror) 3.0.4 Released
Gopher FurryTerror Released
March 20, 2002
Today we release the Internet Gopher Server and Client version
3.0.4, two months after the release of our 10th anniversary 3.0
edition.
Since version 3.0, the following major changes have occured:
[portability] Builds on MacOS X natively
[portability] Builds on Solaris natively
[portability] Fixes to make install target
[portability] Many autoconf fixes
[bugfix] Proper gopher URL handling
[features] Out-of-box support for .ogg and .mp2 files
[features] Generate useful gopherd.conf as part of build
[portability] Major rewrite of regex system resulting in
more portable code
[bugfix] Don't prematurely stop reading some documents
[portability] Builds on FreeBSD natively
[features] New FAQ
About Gopher
To learn about Gopher, please visit The Gopher Project
[gopher/web], A Brief Introduction to Gopherspace
[gopher/web], or
The Gopher Manifesto
[gopher/web].
Obtaining Gopher/Gopherd 3.0.4
Debian sid users may run "apt-get install gopher gopherd" beginning on
approximately March 22.
Gopher Turns 10 / Gopher 3.0 (Furry Terror) Released
January 8, 2002
The Internet Gopher Server and Curses Client is 10 years old!*
Since its announcement in late 1991, Gopher quickly sprang up to be
one of the most innovative technologies of its time. Gopher today
still provides features not found on Web servers -- namely,
its idea that the entire planet is just one big filesystem.
Modern browsers such as Konqueror and Mozilla show it to us that
way, even with drag-and-drop integration with the desktop.
Today we release the Internet Gopher Server and Client version
3.0.
After having been totally unmodified for five years, the
Internet Gopher has kicked back to life. The University of
Minnesota placed the code under the GNU General Public License
and an interested group of hackers set to work on it. A year
later, we have this release.
About Gopher
To learn about Gopher, please visit The Gopher Project
[gopher/web], A Brief Introduction to Gopherspace
[gopher/web], or
The Gopher Manifesto
[gopher/web].
Obtaining Gopher/Gopherd 3.0
Debian sid users may run "apt-get install gopher gopherd" beginning on
approximately January 11.
You are encouraged to use ./configure --disable-auth to
build.
BSD users should use "gmake" to build.
Changes since UMN Gopher release 2.3.1
In Brief:
Many security and buffer overrun fixes
New security features in gopherd
Improved handling of MIME types
Modified to work on modern operating systems. Verified to
work in Linux for multiple platforms and NetBSD/i386. Should
also work for HURD.
Many other modifications, see below.
A more detailed listing is below -- but it is still abbreviated.
The most current is available from CVS.
gopher (3.0.0-1) unstable; urgency=low
* Patched to work with Hurd. Closes: #115511. Uses
suggestions from James Morrison
but not his patch.
* gopher.c, gopherd/error.c, gopher/download.c:
Modified to use HAVE_STRERROR
* configure.in: Modified with checks for sys/param.h, HURD header files,
get_current_dir_name, etc.
* configure.h.in, configure: rebuilt.
* Moved the current UMN Copyright notice in "COPYING" into "copyright"
* Updated copyright files, etc. with current info.
* Updated the locales with semi-current copyright stuff.
* Updated greeting in gopher and gopherd.
* This is Gopher 3.0.0, the Furry Terror release.
-- John Goerzen Tue, 8 Jan 2002 15:31:00 -0500
gopher (2.3.1-15) unstable; urgency=low
* NetBSD port effort began.
* Added crypt.h to configure.in's list of headers to look for.
Reran autoconf/autoheader.
* Modified gopherd/AUTH.h to include crypt.h only if it's available
and to include unistd.h if it's available. (NetBSD)
* Integrated patches from David Allen
(may have been done earlier anyway)
* config.h.in: rebuilt by autoheader
* configure: rebuilt by autoconf
* configure.in:
* Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
* Added checkes for term.h, re_comp.h, regex.h
* gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
* gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
* Use REGEXLIBS
* gopher/globals.h, gopher/gopher.c: Remove sys_errlist
* object/GSgopherobj.c: Removed #include, now use
"Regex.h" that has proper regex determining logic
* object/Regex.h: Moved regex.h include to here. Make it conditional
based on configure test. Add conditional re_comp.h include.
* gopherd/gopherd.c: Add init of view and filter after setjmp
to eliminate clobbering due to longjmp and a warning. Cast
parameters to *printf to long as appropriate.
* AUTH.h: Add missing AUTHITEMSprocessLine prototype
* AUTH.h: Add a check to prevent including twice.
* gopherdconf.c: Add a missing prototype.
* AUTH.c: add missing include of GGroup.h
* download.c: Added cast to long for some *printf's
* Now compiles with only one warning on NetBSD.
* This is Gopher 20020108-01.cvs
* object/Regex.h: now conditionally includes sys/types.h for regex.h
* This is Gopher 20020108-02.cvs
-- John Goerzen Tue, 8 Jan 2002 13:11:00 -0500
gopher (2.3.1-14) unstable; urgency=low
* Added build-depends on autoconf. Closes: #113255.
-- John Goerzen Thu, 1 Nov 2001 12:49:00 -0500
gopher (2.3.1-13) unstable; urgency=low
* Added Build-Depends. Closes: #94237.
-- John Goerzen Mon, 23 Apr 2001 11:00:04 -0500
gopher (2.3.1-12) unstable; urgency=low
* Only chown /var/gopher if it's just created. Closes: #89557.
-- John Goerzen Fri, 6 Apr 2001 15:35:16 -0500
gopher (2.3.1-11) unstable; urgency=low
* Many sprintf -> snprintf changes.
-- John Goerzen Wed, 17 Jan 2001 15:22:09 -0500
gopher (2.3.1-10) unstable; urgency=low
* Added mp3 MIME type. Closes: #81529.
* Now logs about chroot status on server startup.
-- John Goerzen Wed, 17 Jan 2001 13:11:25 -0500
gopher (2.3.1-9) unstable; urgency=low
* Fixed potential buffer overflows. Closes: #82602.
-- John Goerzen Wed, 17 Jan 2001 12:12:51 -0500
gopher (2.3.1-8) unstable; urgency=low
* Update to latest code in CVS, much from
David Allen
* Fixed dh_testversion to 2.0.103. Closes: #79883.
-- John Goerzen Sat, 6 Jan 2001 20:06:01 -0500
gopher (2.3.1-7) unstable; urgency=low
* A new debian rev to fix the access: problem in the gopherdlocal.conf.
-- John Goerzen Tue, 19 Dec 2000 23:40:09 -0500
gopher (2.3.1-6) unstable; urgency=low
* Added many excellent code patches and cleanups from
David Allen .
-- John Goerzen Tue, 19 Dec 2000 20:18:09 -0500
gopher (2.3.1-5) unstable; urgency=low
* Additional code modifications and fixes.
-- John Goerzen Mon, 18 Dec 2000 17:03:56 -0500
gopher (2.3.1-4) unstable; urgency=low
* Disable authentication for the moment due to security concerns.
-- John Goerzen Tue, 17 Oct 2000 23:49:20 -0500
gopher (2.3.1-3) unstable; urgency=low
* Added startopts as a gopherd conffile.
-- John Goerzen Tue, 22 Aug 2000 22:25:25 -0500
gopher (2.3.1-2) unstable; urgency=low
* Modify postinst to be easier for people to use if they already have
a gopher user.
* Fixed a bug in the restart option for the init script.
* Made debian/copyright more verbose.
-- John Goerzen Tue, 22 Aug 2000 21:57:26 -0500
gopher (2.3.1-1) unstable; urgency=low
* Initial re-release. Package had been yanked after 1995 due to licensing.
* UMN has just GPL'd gopher.
* This package contains the security fix from bugtraq.
* I have patched it to chroot() and setuid() earlier for better
security.
SIDE EFFECT: logging will not work if chroot() is used.
* The extension chopping code was buggy, so I have removed it.
* Made many fixes to eliminate compiler warnings and errors.
* Removed redefinitions of sys_errlist
* Included more header files to bring in relevant prototypes
* Modified to use Debian paths
* Modified configure.in to look for -lcrypt
* Modified Makefile.config.in to use -Wall
* Removed -DSETPROCTITLE from configure.in to make start-stop-daemon
work better.
* Added logrotate
* Wrote Debian support from scratch.
* AUTH.h includes crypt.h
* gopherd/Makefile.in uses separate conffile dir (Debian path)
* STRstring.h had a paren problem; gcc on alpha brought it out. Fixed.
* String.h was missing some header files.
* Other fixes.
-- John Goerzen Thu, 17 Aug 2000 15:16:07 -0500
* The exact date of version 1.0 of UMN gopher's release is not logged,
but this is about the right time.
$Id: 3.0.0.html,v 1.4 2002/01/08 22:14:44 jgoerzen Exp $
gopher-3.0.15/configure 0000664 0000000 0000000 00000354010 12621233174 011664 0 ustar #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--disable-debug controls whether debug text is compilied in"
ac_help="$ac_help
--enable-socks use socks library, requires -lsocks"
ac_help="$ac_help
--enable-locale use international localized msgs for the client"
ac_help="$ac_help
--enable-datadir=dir enable custom datadir (/gopher-data)"
ac_help="$ac_help
--enable-port=portnum enable custom port (70)"
ac_help="$ac_help
--enable-dl=dlpathname use Tim Cook's dl databases"
ac_help="$ac_help
--enable-opt=args Special optimization flags to pass to the compiler"
ac_help="$ac_help
--without-wais Don't try using WAIS (default: try)"
# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
ac_prev=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case "$ac_option" in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir="$ac_optarg" ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build="$ac_optarg" ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file="$ac_optarg" ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
datadir="$ac_optarg" ;;
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix="$ac_optarg" ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data in DIR
[PREFIX/share]
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data in DIR
[PREFIX/com]
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
--includedir=DIR C header files in DIR [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM
run sed PROGRAM on installed program names
EOF
cat << EOF
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
EOF
if test -n "$ac_help"; then
echo "--enable and --with options recognized:$ac_help"
fi
exit 0 ;;
-host | --host | --hos | --ho)
ac_prev=host ;;
-host=* | --host=* | --hos=* | --ho=*)
host="$ac_optarg" ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir="$ac_optarg" ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir="$ac_optarg" ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir="$ac_optarg" ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir="$ac_optarg" ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
| --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir="$ac_optarg" ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir="$ac_optarg" ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir="$ac_optarg" ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix="$ac_optarg" ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix="$ac_optarg" ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix="$ac_optarg" ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name="$ac_optarg" ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir="$ac_optarg" ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir="$ac_optarg" ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir="$ac_optarg" ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir="$ac_optarg" ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target="$ac_optarg" ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "with_${ac_package}='$ac_optarg'" ;;
-without-* | --without-*)
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
eval "with_${ac_package}=no" ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes="$ac_optarg" ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries="$ac_optarg" ;;
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
*)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
if test "x$nonopt" != xNONE; then
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
fi
nonopt="$ac_option"
;;
esac
done
if test -n "$ac_prev"; then
{ echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
exec 6>/dev/null
else
exec 6>&1
fi
exec 5>./config.log
echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
case "$ac_arg" in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c) ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
esac
done
# NLS nuisances.
# Only set these to C if already set. These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=gopher/gopher.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
ac_prog=$0
ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
{ echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
else
{ echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
else
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
echo "loading site script $ac_site_file"
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
echo "----------------------------------------------------------------------"
echo "You are about to build the Gopher system for Unix"
echo "Please read the file doc/INSTALL for full information on"
echo "building Gopher"
echo " "
echo "Gopher is copyrighted software, see the file Copyright in"
echo "the distribution for more information and limitations."
echo "----------------------------------------------------------------------"
echo " "
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:556: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:586: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
break
fi
done
IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# -gt 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
set dummy "$ac_dir/$ac_word" "$@"
shift
ac_cv_prog_CC="$@"
fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
if test -z "$CC"; then
case "`uname -s`" in
*win32* | *WIN32*)
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:637: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="cl"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
;;
esac
fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:669: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
#line 680 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
ac_cv_prog_cc_cross=no
else
ac_cv_prog_cc_cross=yes
fi
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:711: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:716: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi
fi
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:744: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_cc_g=yes
else
ac_cv_prog_cc_g=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f $ac_dir/install.sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:806: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
fi
fi
done
;;
esac
done
IFS="$ac_save_IFS"
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL="$ac_cv_path_install"
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
INSTALL="$ac_install_sh"
fi
fi
echo "$ac_t""$INSTALL" 1>&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:859: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
rm -f conftestdata
ac_cv_prog_LN_S="ln -s"
else
ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
echo "$ac_t""yes" 1>&6
else
echo "$ac_t""no" 1>&6
fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:882: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
echo "$ac_t""$RANLIB" 1>&6
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:910: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftestmake <<\EOF
all:
@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
echo "$ac_t""yes" 1>&6
SET_MAKE=
else
echo "$ac_t""no" 1>&6
SET_MAKE="MAKE=${MAKE-make}"
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
echo "configure:938: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
######################################################################
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
enableval="$enable_debug"
DEBUGGING=$enableval
else
DEBUGGING=""
fi
if test "$DEBUGGING" = yes; then
DEBUGGING="-DDEBUGGING"
fi
######################################################################
HAVE_SOCKS=0
# Check whether --enable-socks or --disable-socks was given.
if test "${enable_socks+set}" = set; then
enableval="$enable_socks"
HAVE_SOCKS=1
else
HAVE_SOCKS=0
fi
if test "$HAVE_SOCKS" = 1; then
echo $ac_n "checking for main in -lsocks""... $ac_c" 1>&6
echo "configure:1011: checking for main in -lsocks" >&5
ac_lib_var=`echo socks'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsocks $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
SOCKSLIBS="-lsocks";
SOCKSFLAGS="-Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
else
echo "$ac_t""no" 1>&6
fi
fi
######################################################################
GINTERNATIONAL=""
# Check whether --enable-locale or --disable-locale was given.
if test "${enable_locale+set}" = set; then
enableval="$enable_locale"
GINTERNATIONAL="-DGINTERNATIONAL"
else
GINTERNATIONAL=""
fi
######################################################################
GOPHER_DATA="/gopher-data"
# Check whether --enable-datadir or --disable-datadir was given.
if test "${enable_datadir+set}" = set; then
enableval="$enable_datadir"
GOPHER_DATA="$enableval"
else
GOPHER_DATA="/gopher-data"
fi
######################################################################
GOPHER_PORT=70
# Check whether --enable-port or --disable-port was given.
if test "${enable_port+set}" = set; then
enableval="$enable_port"
GOPHER_PORT="$enableval"
else
GOPHER_PORT=70
fi
######################################################################
# Check whether --enable-dl or --disable-dl was given.
if test "${enable_dl+set}" = set; then
enableval="$enable_dl"
DLPATH="$enableval";DLOBJS="$enableval/getdesc.o $enableval/enddesc.o";SERVEROPTS="$SERVEROPTS -DDL"
else
:
fi
######################################################################
# Check whether --enable-opt or --disable-opt was given.
if test "${enable_opt+set}" = set; then
enableval="$enable_opt"
OPT="$enableval"
else
OPT="$CFLAGS"
fi
######################################################################
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
# libsocket.so which has a bad implementation of gethostbyname (it
# only looks in /etc/hosts), so we only look for -lsocket if we need
# it.
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:1118: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char connect();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_connect) || defined (__stub___connect)
choke me
#else
connect();
#endif
; return 0; }
EOF
if { (eval echo configure:1146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_connect=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
echo "$ac_t""yes" 1>&6
:
else
echo "$ac_t""no" 1>&6
case $LIBS in
*-lnsl*) ;;
*) echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
echo "configure:1166: checking for main in -lnsl_s" >&5
ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lnsl_s $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
;;
esac
case $LIBS in
*-lnsl*) ;;
*) echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
echo "configure:1212: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
;;
esac
case $LIBS in
*-lsocket*) ;;
*) echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:1258: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
;;
esac
case $LIBS in
*-linet*) ;;
*) echo $ac_n "checking for connect in -linet""... $ac_c" 1>&6
echo "configure:1308: checking for connect in -linet" >&5
ac_lib_var=`echo inet'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-linet $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
;;
esac
unset ac_cv_func_connect
for ac_func in connect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1360: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:1388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <&6
fi
done
fi
echo $ac_n "checking for gethostname""... $ac_c" 1>&6
echo "configure:1416: checking for gethostname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostname();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_gethostname) || defined (__stub___gethostname)
choke me
#else
gethostname();
#endif
; return 0; }
EOF
if { (eval echo configure:1444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostname=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_gethostname=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then
echo "$ac_t""yes" 1>&6
:
else
echo "$ac_t""no" 1>&6
LIBOBJS="$LIBOBJS hostname.o"
fi
######################################################################
with_wais=1
# Check whether --with-wais or --without-wais was given.
if test "${with_wais+set}" = set; then
withval="$with_wais"
with_wais=1
else
with_wais=0
fi
LDFLAGS=$OLDLDFLAGS
echo $ac_n "checking for re_comp in -lcompat""... $ac_c" 1>&6
echo "configure:1483: checking for re_comp in -lcompat" >&5
ac_lib_var=`echo compat'_'re_comp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lcompat $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
REGEXLIBS="$REGEXLIBS -lcompat"
else
echo "$ac_t""no" 1>&6
fi
######################################################################
echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6
echo "configure:1525: checking for main in -lmalloc" >&5
ac_lib_var=`echo malloc'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lmalloc $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo malloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
echo $ac_n "checking for main in -lcurses""... $ac_c" 1>&6
echo "configure:1570: checking for main in -lcurses" >&5
ac_lib_var=`echo curses'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
CLIENTLIBS="$CLIENTLIBS -lcurses"
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for main in -ltermcap""... $ac_c" 1>&6
echo "configure:1606: checking for main in -ltermcap" >&5
ac_lib_var=`echo termcap'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
CLIENTLIBS="$CLIENTLIBS -ltermcap"
else
echo "$ac_t""no" 1>&6
fi
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:1647: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:1660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <&6
fi
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
echo "configure:1685: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="$LIBS -ldir"
else
echo "$ac_t""no" 1>&6
fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
echo "configure:1726: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="$LIBS -lx"
else
echo "$ac_t""no" 1>&6
fi
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1768: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# This must be in double quotes, not single quotes, because CPP may get
# substituted into the Makefile and "${CC-cc}" will confuse make.
CPP="${CC-cc} -E"
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
else
ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1848: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
#include
#include
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "memchr" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "free" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_header_stdc=no
fi
rm -fr conftest*
fi
fi
fi
echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
echo "configure:1952: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
#ifndef WEXITSTATUS
#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
int main() {
int s;
wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
if { (eval echo configure:1973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_sys_wait_h=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
if test $ac_cv_header_sys_wait_h = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_SYS_WAIT_H 1
EOF
fi
for ac_hdr in strings.h string.h sys/param.h term.h re_comp.h regex.h crypt.h fcntl.h time.h ctype.h limits.h locale.h sys/types.h sys/stat.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h malloc.h stdlib.h libgen.h regexp.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1997: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <&6
fi
done
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2035: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
}
; return 0; }
EOF
if { (eval echo configure:2089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_const=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
cat >> confdefs.h <<\EOF
#define const
EOF
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:2110: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "uid_t" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_uid_t=yes
else
rm -rf conftest*
ac_cv_type_uid_t=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_uid_t" 1>&6
if test $ac_cv_type_uid_t = no; then
cat >> confdefs.h <<\EOF
#define uid_t int
EOF
cat >> confdefs.h <<\EOF
#define gid_t int
EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
echo "configure:2144: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#if STDC_HEADERS
#include
#include
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_pid_t=yes
else
rm -rf conftest*
ac_cv_type_pid_t=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_pid_t" 1>&6
if test $ac_cv_type_pid_t = no; then
cat >> confdefs.h <<\EOF
#define pid_t int
EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2177: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#if STDC_HEADERS
#include
#include
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
rm -rf conftest*
ac_cv_type_size_t=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:2210: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
#include
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:2224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_time=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_header_time" 1>&6
if test $ac_cv_header_time = yes; then
cat >> confdefs.h <<\EOF
#define TIME_WITH_SYS_TIME 1
EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
echo "configure:2245: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if { (eval echo configure:2258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_struct_tm=sys/time.h
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_struct_tm" 1>&6
if test $ac_cv_struct_tm = sys/time.h; then
cat >> confdefs.h <<\EOF
#define TM_IN_SYS_TIME 1
EOF
fi
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:2281: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <
Autoconf TIOCGETP
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "$ac_pattern" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_prog_gcc_traditional=yes
else
rm -rf conftest*
ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <
Autoconf TCGETA
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "$ac_pattern" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*
fi
fi
echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2330: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2340: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <&6
fi
done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2369: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:2397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <&6
fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:2422: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <
#include
#include
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H
# include
# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
# define HAVE_SYS_PARAM_H 1
# endif
# ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
# ifdef HAVE_SYS_PARAM_H
# include
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
# else /* no EXEC_PAGESIZE */
# ifdef NBPG
# define getpagesize() NBPG * CLSIZE
# ifndef CLSIZE
# define CLSIZE 1
# endif /* no CLSIZE */
# else /* no NBPG */
# ifdef NBPC
# define getpagesize() NBPC
# else /* no NBPC */
# ifdef PAGESIZE
# define getpagesize() PAGESIZE
# endif /* PAGESIZE */
# endif /* no NBPC */
# endif /* no NBPG */
# endif /* no EXEC_PAGESIZE */
# else /* no HAVE_SYS_PARAM_H */
# define getpagesize() 8192 /* punt totally */
# endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */
#endif /* no HAVE_GETPAGESIZE */
#ifdef __cplusplus
extern "C" { void *malloc(unsigned); }
#else
char *malloc();
#endif
int
main()
{
char *data, *data2, *data3;
int i, pagesize;
int fd;
pagesize = getpagesize();
/*
* First, make a file with some known garbage in it.
*/
data = malloc(pagesize);
if (!data)
exit(1);
for (i = 0; i < pagesize; ++i)
*(data + i) = rand();
umask(0);
fd = creat("conftestmmap", 0600);
if (fd < 0)
exit(1);
if (write(fd, data, pagesize) != pagesize)
exit(1);
close(fd);
/*
* Next, try to mmap the file at a fixed address which
* already has something else allocated at it. If we can,
* also make sure that we see the same garbage.
*/
fd = open("conftestmmap", O_RDWR);
if (fd < 0)
exit(1);
data2 = malloc(2 * pagesize);
if (!data2)
exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_FIXED, fd, 0L))
exit(1);
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data2 + i))
exit(1);
/*
* Finally, make sure that changes to the mapped area
* do not percolate back to the file as seen by read().
* (This is a bug on some variants of i386 svr4.0.)
*/
for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1;
data3 = malloc(pagesize);
if (!data3)
exit(1);
if (read(fd, data3, pagesize) != pagesize)
exit(1);
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data3 + i))
exit(1);
close(fd);
unlink("conftestmmap");
exit(0);
}
EOF
if { (eval echo configure:2570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_func_mmap_fixed_mapped=no
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
if test $ac_cv_func_mmap_fixed_mapped = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP 1
EOF
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:2593: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif
int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:2615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_type_signal=int
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_type_signal" 1>&6
cat >> confdefs.h <&6
echo "configure:2634: checking for working strcoll" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_strcoll_works=no
else
cat > conftest.$ac_ext <
main ()
{
exit (strcoll ("abc", "def") >= 0 ||
strcoll ("ABC", "DEF") >= 0 ||
strcoll ("123", "456") >= 0);
}
EOF
if { (eval echo configure:2652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strcoll_works=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_func_strcoll_works=no
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
if test $ac_cv_func_strcoll_works = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_STRCOLL 1
EOF
fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
echo "configure:2676: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_VFORK_H 1
EOF
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
echo "configure:2711: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
echo "configure:2717: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char vfork();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_vfork) || defined (__stub___vfork)
choke me
#else
vfork();
#endif
; return 0; }
EOF
if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_vfork=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
echo "$ac_t""yes" 1>&6
:
else
echo "$ac_t""no" 1>&6
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <
#include
#include
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_VFORK_H
#include
#endif
/* On some sparc systems, changes by the child to local and incoming
argument registers are propagated back to the parent.
The compiler is told about this with #include ,
but some compilers (e.g. gcc -O) don't grok .
Test for this by using a static variable whose address
is put into a register that is clobbered by the vfork. */
static
#ifdef __cplusplus
sparc_address_test (int arg)
#else
sparc_address_test (arg) int arg;
#endif
{
static pid_t child;
if (!child) {
child = vfork ();
if (child < 0) {
perror ("vfork");
_exit(2);
}
if (!child) {
arg = getpid();
write(-1, "", 0);
_exit (arg);
}
}
}
main() {
pid_t parent = getpid ();
pid_t child;
sparc_address_test ();
child = vfork ();
if (child == 0) {
/* Here is another test for sparc vfork register problems.
This test uses lots of local variables, at least
as many local variables as main has allocated so far
including compiler temporaries. 4 locals are enough for
gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
A buggy compiler should reuse the register of parent
for one of the local variables, since it will think that
parent can't possibly be used any more in this routine.
Assigning to the local variable will thus munge parent
in the parent process. */
pid_t
p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
/* Convince the compiler that p..p7 are live; otherwise, it might
use the same hardware register for all 8 local variables. */
if (p != p1 || p != p2 || p != p3 || p != p4
|| p != p5 || p != p6 || p != p7)
_exit(1);
/* On some systems (e.g. IRIX 3.3),
vfork doesn't separate parent from child file descriptors.
If the child closes a descriptor before it execs or exits,
this munges the parent's descriptor as well.
Test for this by closing stdout in the child. */
_exit(close(fileno(stdout)) != 0);
} else {
int status;
struct stat st;
while (wait(&status) != child)
;
exit(
/* Was there some problem with vforking? */
child < 0
/* Did the child fail? (This shouldn't happen.) */
|| status
/* Did the vfork/compiler bug occur? */
|| parent != getpid()
/* Did the file descriptor bug occur? */
|| fstat(fileno(stdout), &st) != 0
);
}
}
EOF
if { (eval echo configure:2862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_func_vfork_works=no
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
if test $ac_cv_func_vfork_works = no; then
cat >> confdefs.h <<\EOF
#define vfork fork
EOF
fi
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:2885: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char vprintf();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_vprintf) || defined (__stub___vprintf)
choke me
#else
vprintf();
#endif
; return 0; }
EOF
if { (eval echo configure:2913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_vprintf=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_VPRINTF 1
EOF
else
echo "$ac_t""no" 1>&6
fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:2937: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char _doprnt();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub__doprnt) || defined (__stub____doprnt)
choke me
#else
_doprnt();
#endif
; return 0; }
EOF
if { (eval echo configure:2965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func__doprnt=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_DOPRNT 1
EOF
else
echo "$ac_t""no" 1>&6
fi
fi
ac_have_func=no # yes means we've found a way to get the load average.
# Some systems have getloadavg without any extra libraries.
echo $ac_n "checking for getloadavg""... $ac_c" 1>&6
echo "configure:2993: checking for getloadavg" >&5
if eval "test \"`echo '$''{'ac_cv_func_getloadavg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char getloadavg();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_getloadavg) || defined (__stub___getloadavg)
choke me
#else
getloadavg();
#endif
; return 0; }
EOF
if { (eval echo configure:3021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_getloadavg=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_getloadavg=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'getloadavg`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_have_func=yes
else
echo "$ac_t""no" 1>&6
fi
if test $ac_have_func = no; then
# Some systems with -lutil have (and need) -lkvm as well, some do not.
# On Solaris, -lkvm requires nlist from -lelf, so check that first
# to get the right answer into the cache.
echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6
echo "configure:3046: checking for elf_begin in -lelf" >&5
ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lelf $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="-lelf $LIBS"
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6
echo "configure:3086: checking for kvm_open in -lkvm" >&5
ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lkvm $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="-lkvm $LIBS"
else
echo "$ac_t""no" 1>&6
fi
# Check for the 4.4BSD definition of getloadavg.
echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6
echo "configure:3127: checking for getloadavg in -lutil" >&5
ac_lib_var=`echo util'_'getloadavg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lutil $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
else
echo "$ac_t""no" 1>&6
fi
fi
if test $ac_have_func = no; then
# There is a commonly available library for RS/6000 AIX.
# Since it is not a standard part of AIX, it might be installed locally.
ac_getloadavg_LIBS="$LIBS"; LIBS="-L/usr/local/lib $LIBS"
echo $ac_n "checking for getloadavg in -lgetloadavg""... $ac_c" 1>&6
echo "configure:3173: checking for getloadavg in -lgetloadavg" >&5
ac_lib_var=`echo getloadavg'_'getloadavg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lgetloadavg $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="-lgetloadavg $LIBS"
else
echo "$ac_t""no" 1>&6
LIBS="$ac_getloadavg_LIBS"
fi
fi
# Make sure it is really in the library, if we think we found it.
for ac_func in getloadavg
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3219: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <&6
LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done
if test $ac_cv_func_getloadavg = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_GETLOADAVG 1
EOF
ac_have_func=yes
else
# Figure out what our getloadavg.c needs.
ac_have_func=no
ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6
echo "configure:3285: checking for sys/dg_sys_info.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_have_func=yes; cat >> confdefs.h <<\EOF
#define DGUX 1
EOF
echo $ac_n "checking for dg_sys_info in -ldgc""... $ac_c" 1>&6
echo "configure:3316: checking for dg_sys_info in -ldgc" >&5
ac_lib_var=`echo dgc'_'dg_sys_info | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldgc $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo dgc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
else
echo "$ac_t""no" 1>&6
fi
# We cannot check for , because Solaris 2 does not use dwarf (it
# uses stabs), but it is still SVR4. We cannot check for because
# Irix 4.0.5F has the header but not the library.
if test $ac_have_func = no && test $ac_cv_lib_elf_elf_begin = yes; then
ac_have_func=yes; cat >> confdefs.h <<\EOF
#define SVR4 1
EOF
fi
if test $ac_have_func = no; then
ac_safe=`echo "inq_stats/cpustats.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6
echo "configure:3380: checking for inq_stats/cpustats.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_have_func=yes; cat >> confdefs.h <<\EOF
#define UMAX 1
EOF
cat >> confdefs.h <<\EOF
#define UMAX4_3 1
EOF
else
echo "$ac_t""no" 1>&6
fi
fi
if test $ac_have_func = no; then
ac_safe=`echo "sys/cpustats.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6
echo "configure:3423: checking for sys/cpustats.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_have_func=yes; cat >> confdefs.h <<\EOF
#define UMAX 1
EOF
else
echo "$ac_t""no" 1>&6
fi
fi
if test $ac_have_func = no; then
for ac_hdr in mach/mach.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3464: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <&6
fi
done
fi
ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
echo "configure:3504: checking for nlist.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define NLIST_STRUCT 1
EOF
echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6
echo "configure:3535: checking for n_un in struct nlist" >&5
if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
int main() {
struct nlist n; n.n_un.n_name = 0;
; return 0; }
EOF
if { (eval echo configure:3547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_nlist_n_un=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_struct_nlist_n_un=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_struct_nlist_n_un" 1>&6
if test $ac_cv_struct_nlist_n_un = yes; then
cat >> confdefs.h <<\EOF
#define NLIST_NAME_UNION 1
EOF
fi
else
echo "$ac_t""no" 1>&6
fi
fi # Do not have getloadavg in system libraries.
# Some definitions of getloadavg require that the program be installed setgid.
echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6
echo "configure:3574: checking whether getloadavg requires setgid" >&5
if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5 |
egrep "Yowza Am I SETGID yet" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_func_getloadavg_setgid=yes
else
rm -rf conftest*
ac_cv_func_getloadavg_setgid=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_func_getloadavg_setgid" 1>&6
if test $ac_cv_func_getloadavg_setgid = yes; then
NEED_SETGID=true; cat >> confdefs.h <<\EOF
#define GETLOADAVG_PRIVILEGED 1
EOF
else
NEED_SETGID=false
fi
if test $ac_cv_func_getloadavg_setgid = yes; then
echo $ac_n "checking group of /dev/kmem""... $ac_c" 1>&6
echo "configure:3610: checking group of /dev/kmem" >&5
if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# On Solaris, /dev/kmem is a symlink. Get info on the real file.
ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
# If we got an error (system does not support symlinks), try without -L.
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
ac_cv_group_kmem=`echo $ac_ls_output \
| sed -ne 's/[ ][ ]*/ /g;
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
/ /s/.* //;p;'`
fi
echo "$ac_t""$ac_cv_group_kmem" 1>&6
KMEM_GROUP=$ac_cv_group_kmem
fi
echo $ac_n "checking for main in -lcurses""... $ac_c" 1>&6
echo "configure:3632: checking for main in -lcurses" >&5
ac_lib_var=`echo curses'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
echo $ac_n "checking for main in -ltermcap""... $ac_c" 1>&6
echo "configure:3675: checking for main in -ltermcap" >&5
ac_lib_var=`echo termcap'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <&6
fi
for ac_func in bzero gethostname fgetpwent get_current_dir_name getcwd getwd madvise mkdir mkstemp mktime putenv re_comp select seteuid setsid socket strcasecmp strcspn strdup strerror strftime strspn strstr strtol sysconf tempnam tzset wait3 waitpid strcasestr regcomp regfree wattron wattroff wstandout wstandend
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3720: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <&6
fi
done
cat > conftest.$ac_ext <
int main() {
getdtablesize();
; return 0; }
EOF
if { (eval echo configure:3781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
sed -n \
-e "s/'/'\\\\''/g" \
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
;;
esac >> confcache
if cmp -s $cache_file confcache; then
:
else
if test -w $cache_file; then
echo "updating cache $cache_file"
cat confcache > $cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
DEFS=-DHAVE_CONFIG_H
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS </dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
case "\$ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
*) echo "\$ac_cs_usage"; exit 1 ;;
esac
done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile Makefile.config object/Makefile gopher/Makefile gopher/locales/Makefile doc/Makefile gophfilt/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@CC@%$CC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@RANLIB@%$RANLIB%g
s%@SET_MAKE@%$SET_MAKE%g
s%@DEBUGGING@%$DEBUGGING%g
s%@SOCKSLIBS@%$SOCKSLIBS%g
s%@SOCKSFLAGS@%$SOCKSFLAGS%g
s%@GINTERNATIONAL@%$GINTERNATIONAL%g
s%@GOPHER_DATA@%$GOPHER_DATA%g
s%@GOPHER_PORT@%$GOPHER_PORT%g
s%@DLPATH@%$DLPATH%g
s%@DLOBJS@%$DLOBJS%g
s%@OPT@%$OPT%g
s%@REGEXLIBS@%$REGEXLIBS%g
s%@WAISTYPE@%$WAISTYPE%g
s%@SEARCH@%$SEARCH%g
s%@CLIENTLIBS@%$CLIENTLIBS%g
s%@CPP@%$CPP%g
s%@LIBOBJS@%$LIBOBJS%g
s%@NEED_SETGID@%$NEED_SETGID%g
s%@KMEM_GROUP@%$KMEM_GROUP%g
CEOF
EOF
cat >> $CONFIG_STATUS <<\EOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if test ! -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_max_sed_cmds`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
EOF
cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dir_suffix= ac_dots=
fi
case "$ac_given_srcdir" in
.) srcdir=.
if test -z "$ac_dots"; then top_srcdir=.
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
*) # Relative path.
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
case "$ac_given_INSTALL" in
[/$]*) INSTALL="$ac_given_INSTALL" ;;
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
case "$ac_file" in
*Makefile*) ac_comsub="1i\\
# $configure_input" ;;
*) ac_comsub= ;;
esac
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='\([ ]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'
if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
cat $ac_file_inputs > conftest.in
EOF
# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h. And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF
# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.
rm -f conftest.tail
while :
do
ac_lines=`grep -c . conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
# Write a limited-size here document to conftest.frag.
echo ' cat > conftest.frag <> $CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
' >> $CONFIG_STATUS
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
rm -f conftest.vals
mv conftest.tail conftest.vals
done
rm -f conftest.vals
cat >> $CONFIG_STATUS <<\EOF
rm -f conftest.frag conftest.h
echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
cat conftest.in >> conftest.h
rm -f conftest.in
if cmp -s $ac_file conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
rm -f conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
mv conftest.h $ac_file
fi
fi; done
EOF
cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF
exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
gopher-3.0.15/COPYING 0000664 0000000 0000000 00000043110 10762617110 011007 0 ustar GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
gopher-3.0.15/debian/ 0000775 0000000 0000000 00000000000 12655456440 011211 5 ustar gopher-3.0.15/debian/rules 0000775 0000000 0000000 00000006051 12621147342 012262 0 ustar #!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=4
# This has to be exported to make some magic below work.
export DH_OPTIONS
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
autoconf
autoheader
ln -vs /usr/share/gnulib/lib/getloadavg.c .
./configure --prefix=/usr --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info --disable-auth \
--sysconfdir=/etc
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
-$(MAKE) clean
-rm -f `find . -name "config.cache"`
-rm -f config.status
-rm -f `find . -name "config.log"`
-rm -f Makefile.config gopher/Makefile gopher/locales/Makefile \
Makefile config.h doc/Makefile \
gophfilt/Makefile object/Makefile getloadavg.c
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/gopher.
$(MAKE) install prefix=`pwd`/debian/gopher/usr \
PREFIX=`pwd`/debian/gopher/usr \
DESTDIR=`pwd`/debian/gopher
chmod -R a-x debian/gopher/etc
#dh_movefiles
chmod u+x debian/gopher/etc/gopher debian/gopher/etc
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: DH_OPTIONS=-i
binary-indep: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installpam
dh_installinit
dh_installcron
dh_installlogrotate
# dh_installmanpages
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_link
dh_compress
dh_fixperms
# You may want to make some executables suid here.
dh_installdeb
# dh_perl
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
# Pass -a to all debhelper commands in this target to reduce clutter.
binary-arch: DH_OPTIONS=-a
binary-arch: build install
# Need this version of debhelper for DH_OPTIONS to work.
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installpam
dh_installinit
dh_installlogrotate
dh_installcron
# dh_installmanpages
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_strip
dh_link
dh_compress
dh_fixperms
# You may want to make some executables suid here.
dh_installdeb
# dh_makeshlibs
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-arch
.PHONY: build clean binary-arch binary install
gopher-3.0.15/debian/cron.d.ex 0000664 0000000 0000000 00000000121 10762617110 012712 0 ustar #
# Regular cron jobs for the gopher package
#
0 4 * * * root gopher_maintenance
gopher-3.0.15/debian/docs 0000664 0000000 0000000 00000000156 10762617110 012054 0 ustar README
doc/INSTALL
doc/TODO
doc/client.changes
doc/clientlogging.vms
doc/object.changes
doc/PLATFORMS
doc/FAQ
gopher-3.0.15/debian/menu.ex 0000664 0000000 0000000 00000000157 10762617110 012504 0 ustar ?package(gopher):needs=X11|text|vc|wm section=Apps/see-menu-manual\
title="gopher" command="/usr/bin/gopher"
gopher-3.0.15/debian/dirs 0000664 0000000 0000000 00000000125 10762617110 012061 0 ustar usr/bin
usr/sbin
usr/share/man/man1
usr/share/man/man5
usr/share/man/man8
etc/gopher
gopher-3.0.15/debian/startopts 0000664 0000000 0000000 00000001414 10762617110 013165 0 ustar # Put options for gopherd in here. Set options to "" to not set
# or follow the comments. If chroot is enabled, you wiill not be able
# to use decoders unless you copy them under your gopher root. The
# same goes for calling other scripts, and there may be logging
# difficulties.
# Set DONTCHROOT to -c if you don't want to use chroot.
# DONTCHROOT="-c"
DONTCHROOT=""
# The username that you run gopher as. Leave blank to run as root.
# USEUID=""
USEUID="-u gopher"
# The option file for gopher.
OPTIONFILE="-o /etc/gopherd/gopherd.conf"
# Logging. Set to the empty string to disable.
#LOGGING=""
LOGGING="-l /var/log/gopherd.log"
# The home for gopher.
GOPHERHOME="/var/gopher"
# Gopher's port.
GOPHERPORT="70"
# Any other options to pass along.
OTHEROPTS=""
gopher-3.0.15/debian/copyright 0000664 0000000 0000000 00000002456 10762617110 013141 0 ustar This package was debianized by John Goerzen on
Thu, 17 Aug 2000 15:16:07 -0500.
It was downloaded from gopher://quux.org/1/devel/gopher
Old Upstream Author(s): University of Minnesota
Current Upstream Authors: John Goerzen and the gopher team
Copyright:
Gopher software distribution for UNIX
Copyright (C) 1991-2000 University of Minnesota
Copyright (C) 2000-2005 John Goerzen and the gopher developers
This package (Gopher software distribution for UNIX)
originally had different copying restrictions.
It is now distributed under the GPL.
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
Debian GNU/Linux users can find the GPL in
/usr/share/common-licenses/GPL.
gopher-3.0.15/debian/conffiles 0000664 0000000 0000000 00000000000 10762617110 013060 0 ustar gopher-3.0.15/debian/ex.doc-base.package 0000664 0000000 0000000 00000000774 10762617110 014614 0 ustar Document: gopher
Title: Debian gopher Manual
Author:
Abstract: This manual describes what gopher is
and how it can be used to
manage online manuals on Debian systems.
Section: unknown
Format: debiandoc-sgml
Files: /usr/share/doc/gopher/gopher.sgml.gz
Format: postscript
Files: /usr/share/doc/gopher/gopher.ps.gz
Format: text
Files: /usr/share/doc/gopher/gopher.text.gz
Format: HTML
Index: /usr/share/doc/gopher/html/index.html
Files: /usr/share/doc/gopher/html/*.html
gopher-3.0.15/debian/compat 0000664 0000000 0000000 00000000002 12621232727 012400 0 ustar 5
gopher-3.0.15/debian/control 0000664 0000000 0000000 00000001172 12621147342 012604 0 ustar Source: gopher
Section: net
Priority: optional
Maintainer: John Goerzen
Standards-Version: 3.6.2
Build-Depends: debhelper (>= 4.0.0), ncurses-dev, autoconf, gnulib
Package: gopher
Provides: gopher-client
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Distributed Hypertext Client, Gopher protocol
This package contains the client for the distributed global directory
and hypertext system known as gopher. This is a text-based (ncurses)
client from the University of Minnesota. It also supports the gopher+
protocol, as well as links to ftp, http, and other external viewers.
gopher-3.0.15/debian/changelog 0000644 0000000 0000000 00000035364 12655456440 013074 0 ustar gopher (3.0.15build1) xenial; urgency=medium
* No-change rebuild for ncurses6 transition.
-- Matthias Klose Sat, 06 Feb 2016 20:52:48 +0000
gopher (3.0.15) unstable; urgency=medium
* Correct possible segfault in option parsing. Closes #715977, #715978.
-- John Goerzen Thu, 12 Nov 2015 19:00:08 -0600
gopher (3.0.14) unstable; urgency=medium
* Fix Debian (Closes: #798758) thanks to patch from Axel Beckert
+ Use autoconf and gnulib instead of autoconf2.13.
+ debian/rules: configure-stamp is a dependency of build-stamp, not build.
+ debian/rules: Add symlink to /usr/share/gnulib/lib/getloadavg.c and
remove it again in the clean target.
-- John Goerzen Thu, 12 Nov 2015 11:47:19 -0600
gopher (3.0.13) unstable; urgency=low
* More changes to download.c to prefer getcwd() to get_current_dir_name().
Closes: #366560.
-- John Goerzen Sat, 17 Jun 2006 11:10:31 -0500
gopher (3.0.12) unstable; urgency=low
* Applied patch to make it build for Hurd. Closes: #346447.
-- John Goerzen Tue, 9 May 2006 10:37:49 -0500
gopher (3.0.11) unstable; urgency=high
* [security] Fix for client buffer overflows [CAN-2005-2772].
-- John Goerzen Thu, 22 Sep 2005 05:24:02 -0500
gopher (3.0.10) unstable; urgency=low
* Version 3.0.8 fixed the security bug that was later submitted
as CAN-2005-1853 and DSA-770-1.
* The upload for this changelog notice was requested by the Debian
testing-security team.
-- John Goerzen Sat, 30 Jul 2005 16:16:07 -0500
gopher (3.0.9) unstable; urgency=low
* Updated version number in patchlevel.h. (Oops, it still says 3.0.5)
-- John Goerzen Wed, 20 Jul 2005 05:55:50 -0500
gopher (3.0.8) unstable; urgency=low
* Fix compile error with gcc 3.4. Closes: #258752.
* Fixed warnings relating to prototypes. In download.c,
prefer getcwd() to get_current_dir_name(). Closes: #226552.
* No longer crash on problems piping to external programs.
Thanks, Goeran Weinholt, for the patch. Closes: #128990.
* Install makes dirs for manpages if they don't already exist.
Combined with other fixes in this version and prior versions,
all bugs in 142913 are resolved. Closes: #142913.
* [debian] Removed build-deps on build-essential packages.
Closes: #262423.
* [debian] Updated standards-version and to new debhelper.
* Fixed a small memory leak in download.c.
* Fix potential insecure /tmp usage in gopher.c.
* Use socklen_t instead of int for socket length operations,
avoiding warnings about incorrect signedness.
* Updated copyright files.
-- John Goerzen Wed, 20 Jul 2005 05:41:40 -0500
gopher (3.0.7) unstable; urgency=low
* Use Autoconf 2.13 on Debian systems. Closes: #206183.
-- John Goerzen Mon, 25 Aug 2003 12:59:02 -0500
gopher (3.0.6) unstable; urgency=low
* Deprecated gopherd in favor of PyGopherd.
-- John Goerzen Mon, 18 Aug 2003 12:11:17 -0500
gopher (3.0.5) unstable; urgency=low
* Integrated my patch to 3.0.4 for Solaris compilation.
* Logging with chroot has long since been fixed; added a note to
startopts about other chroot stuff. Closes: #82590, #82591.
* Gopherd sometimes sent "+INFO " instead of "+INFO: ". Fixed.
Closes: #142912.
* doc/Makefile.in: Install manpages 0644 instead of 0755.
-- John Goerzen Fri, 26 Apr 2002 09:09:55 -0500
gopher (3.0.4) unstable; urgency=low
* MAJOR rewrite of regex support. This should make gopher
compile and work better on several platforms.
* Added regcomp and regree func checks to configure.in and
regenerated configure and config.h
* Removed the DOMAIN configure support, DOMAIN_NAME in gopherd,
backupdomain in Socket.c, etc. This should prevent the no.domain.name
problem that people have been seeing. Regenerated configure stuff.
* Added line for .png to gopherd.conf.in
* Added note about UFS builds on MacOS X to doc/PLATFORMS
* Added FAQ and modified debian/docs
* Updated gopherd.8 with information about type 'i'
* Fixed gopher's URL handling -- it was missing the type character.
Closes: #138337.
* Another regex change. Let's hope this fixes things for Solaris.
* Fixed to properly calculated first arg to select in gopherd.c
-- John Goerzen Tue, 19 Mar 2002 13:08:39 -0500
gopher (3.0.3) unstable; urgency=low
* Patches for FreeBSD:
* Test in configure for stdlib.h
* Include stdlib.h if it's available in Malloc.h
* Don't include malloc.h if it's missing in Malloc.h
* Don't include strcasestr if it's present in util.c and util.h
* Actually use our configure.in test for malloc.h in object/* files.
* New configure.in tests for regexp.h and libgen.h
* Regex.c: define __GOPHER_REGEX_C__ for extern support in Regex.h
* Regex.c: For __APPLE__, REGEX_param is regexp *.
* Regex.h: Move the lengthy SYSV regex test to top of file
* Regex.h: Wrap libgen.h include in HAVE_LIBGEN_H
* Regex.h: Enclose REGEX_param=regcomp in parens to avoid warnings
* Regex.h: Add extern for REGEX_param.
* Regex.h: Darwin is unlike anything else. Support it with
__APPLE__.
* STRstring.h: Include malloc.h only if actually here.
* Ditto for Stdlib.h.
* Added /etc/logrotate.d/gopherd to gopherd.conffiles.
Closes: #132804.
-- John Goerzen Tue, 12 Feb 2002 07:45:00 -0500
gopher (3.0.2) unstable; urgency=low
* gopher: Removed processing of . at end of text files. It would stop
downloading when it would see ".\n" in a file. Will need to modify
gopher/ourutils.c:937 area to deal with this properly -- ignore
.\n if it's at the end of the file, otherwise preserve it.
Reported by Ashok Aiyar
* Did the modification as described above.
* Updated README.
* Global change gopher@boombox.micro.umn.edu -> gopher@complete.org
* Removed ./GPL. This info is now in the file COPYING.
* Changes to work with Solaris:
* configure.in: Now looks for strings.h and string.h
* object/Regex.h: Now include re_comp.h if available.
Include regex.h only if re_comp.h is unavailable.
Define the SYSVREGEX stuff only if HAVE_RE_COMP_H is not defined
* object/String.h: Include string.h and strings.h based on configure
test.
Reports from Don Fike
* Added doc/PLATFORMS and updated debian/docs
* gopherd.conf's include of gopherdlocal.conf was hardcoded to /etc.
Now use configure's sysconfdir to generate it. Moved gopherd.conf
to gopherd.conf.in, modified Makefile.in to support this, removed
gopherd.conf from source tree. Reported by Kevin Griffin
* Added lines to gopherd.conf.in for .ogg and .mp2 files.
Suggestion from Kevin Griffin
* Using $(INSTALL) from subdirectories broke on systems
where install-sh was used because $(INSTALL) would always
resolve to ./install-sh. Replaced all instances of
$(INSTALL) with @INSTALL@ (autoconf would provide the correct
path) and removed INSTALL from Makefile.config. Reported
by Don Fike on Solaris 2.6.
* Updated our copy of install-sh with the one from
a current automake.
* Updated patchlevel.h for release of 3.0.2.
-- John Goerzen Fri, 11 Jan 2002 07:45:00 -0500
gopher (3.0.1) unstable; urgency=low
* Installation routines modified -- pass -d to install to create
config dirs. This should fix installation problems.
* Use sysconfigdir rather that $(DESTDIR)/etc for config files.
* Fix a bug with specifying the gopher host on the command line.
-- John Goerzen Thu, 10 Jan 2002 07:30:00 -0500
gopher (3.0.0-1) unstable; urgency=low
* Patched to work with Hurd. Closes: #115511. Uses
suggestions from James Morrison
but not his patch.
* gopher.c, gopherd/error.c, gopher/download.c:
Modified to use HAVE_STRERROR
* configure.in: Modified with checks for sys/param.h, HURD header files,
get_current_dir_name, etc.
* configure.h.in, configure: rebuilt.
* Moved the current UMN Copyright notice in "COPYING" into "copyright"
* Updated copyright files, etc. with current info.
* Updated the locales with semi-current copyright stuff.
* Updated greeting in gopher and gopherd.
* This is Gopher 3.0.0, the Furry Terror release.
-- John Goerzen Tue, 8 Jan 2002 15:31:00 -0500
gopher (2.3.1-15) unstable; urgency=low
* NetBSD port effort began.
* Added crypt.h to configure.in's list of headers to look for.
Reran autoconf/autoheader.
* Modified gopherd/AUTH.h to include crypt.h only if it's available
and to include unistd.h if it's available. (NetBSD)
* Integrated patches from David Allen
(may have been done earlier anyway)
* config.h.in: rebuilt by autoheader
* configure: rebuilt by autoconf
* configure.in:
* Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
* Added checkes for term.h, re_comp.h, regex.h
* gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
* gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
* Use REGEXLIBS
* gopher/globals.h, gopher/gopher.c: Remove sys_errlist
* object/GSgopherobj.c: Removed #include, now use
"Regex.h" that has proper regex determining logic
* object/Regex.h: Moved regex.h include to here. Make it conditional
based on configure test. Add conditional re_comp.h include.
* gopherd/gopherd.c: Add init of view and filter after setjmp
to eliminate clobbering due to longjmp and a warning. Cast
parameters to *printf to long as appropriate.
* AUTH.h: Add missing AUTHITEMSprocessLine prototype
* AUTH.h: Add a check to prevent including twice.
* gopherdconf.c: Add a missing prototype.
* AUTH.c: add missing include of GGroup.h
* download.c: Added cast to long for some *printf's
* Now compiles with only one warning on NetBSD.
* This is Gopher 20020108-01.cvs
* object/Regex.h: now conditionally includes sys/types.h for regex.h
* This is Gopher 20020108-02.cvs
-- John Goerzen Tue, 8 Jan 2002 13:11:00 -0500
gopher (2.3.1-14) unstable; urgency=low
* Added build-depends on autoconf. Closes: #113255.
-- John Goerzen Thu, 1 Nov 2001 12:49:00 -0500
gopher (2.3.1-13) unstable; urgency=low
* Added Build-Depends. Closes: #94237.
-- John Goerzen Mon, 23 Apr 2001 11:00:04 -0500
gopher (2.3.1-12) unstable; urgency=low
* Only chown /var/gopher if it's just created. Closes: #89557.
-- John Goerzen Fri, 6 Apr 2001 15:35:16 -0500
gopher (2.3.1-11) unstable; urgency=low
* Many sprintf -> snprintf changes.
-- John Goerzen Wed, 17 Jan 2001 15:22:09 -0500
gopher (2.3.1-10) unstable; urgency=low
* Added mp3 MIME type. Closes: #81529.
* Now logs about chroot status on server startup.
-- John Goerzen Wed, 17 Jan 2001 13:11:25 -0500
gopher (2.3.1-9) unstable; urgency=low
* Fixed potential buffer overflows. Closes: #82602.
-- John Goerzen Wed, 17 Jan 2001 12:12:51 -0500
gopher (2.3.1-8) unstable; urgency=low
* Update to latest code in CVS, much from
David Allen
* Fixed dh_testversion to 2.0.103. Closes: #79883.
-- John Goerzen Sat, 6 Jan 2001 20:06:01 -0500
gopher (2.3.1-7) unstable; urgency=low
* A new debian rev to fix the access: problem in the gopherdlocal.conf.
-- John Goerzen Tue, 19 Dec 2000 23:40:09 -0500
gopher (2.3.1-6) unstable; urgency=low
* Added many excellent code patches and cleanups from
David Allen .
-- John Goerzen Tue, 19 Dec 2000 20:18:09 -0500
gopher (2.3.1-5) unstable; urgency=low
* Additional code modifications and fixes.
-- John Goerzen Mon, 18 Dec 2000 17:03:56 -0500
gopher (2.3.1-4) unstable; urgency=low
* Disable authentication for the moment due to security concerns.
-- John Goerzen Tue, 17 Oct 2000 23:49:20 -0500
gopher (2.3.1-3) unstable; urgency=low
* Added startopts as a gopherd conffile.
-- John Goerzen Tue, 22 Aug 2000 22:25:25 -0500
gopher (2.3.1-2) unstable; urgency=low
* Modify postinst to be easier for people to use if they already have
a gopher user.
* Fixed a bug in the restart option for the init script.
* Made debian/copyright more verbose.
-- John Goerzen Tue, 22 Aug 2000 21:57:26 -0500
gopher (2.3.1-1) unstable; urgency=low
* Initial re-release. Package had been yanked after 1995 due to licensing.
* UMN has just GPL'd gopher.
* This package contains the security fix from bugtraq.
* I have patched it to chroot() and setuid() earlier for better
security.
SIDE EFFECT: logging will not work if chroot() is used.
* The extension chopping code was buggy, so I have removed it.
* Made many fixes to eliminate compiler warnings and errors.
* Removed redefinitions of sys_errlist
* Included more header files to bring in relevant prototypes
* Modified to use Debian paths
* Modified configure.in to look for -lcrypt
* Modified Makefile.config.in to use -Wall
* Removed -DSETPROCTITLE from configure.in to make start-stop-daemon
work better.
* Added logrotate
* Wrote Debian support from scratch.
* AUTH.h includes crypt.h
* gopherd/Makefile.in uses separate conffile dir (Debian path)
* STRstring.h had a paren problem; gcc on alpha brought it out. Fixed.
* String.h was missing some header files.
* Other fixes.
-- John Goerzen Thu, 17 Aug 2000 15:16:07 -0500
Thu Feb 9 21:32:43 1995 Ted Hajek
* gopherd/Makefile (install): Fixed syntax error in the
installation of gopherdlocal.conf.
* gopher/CURcurses.h: Changed inclusion of curses.h to inclusion
of "ncurses/curses.h". Hopefully this will solve strange problems
with terminal features.
Wed Jul 31 17:31:11 MET DST 1996 Michael Meskes
* Renamed function ustat in g_ustat to get gopherd compile with ELF
libc
* Corrected version number (Bugs #1718, #1851, #3965)
* Added Architecture, Priority and Section field (Bug#3933)
* Changed debian.rules file for new naming scheme
* Removed 'RECOMMENDS: freeWAIS' line (Bug #1717)
* Corrected extended description (Bug #3668, #3683)
* Changed weekly cron script (Bug #3262)
* Compress manpages
Local variables:
mode: debian-changelog
End:
gopher-3.0.15/debian/manpage.1.ex 0000664 0000000 0000000 00000003547 10762617110 013315 0 ustar .\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH GOPHER SECTION "August 17, 2000"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
gopher \- program to do something
.SH SYNOPSIS
.B gopher
.RI [ options ] " files" ...
.br
.B bar
.RI [ options ] " files" ...
.SH DESCRIPTION
This manual page documents briefly the
.B gopher
and
.B bar
commands.
This manual page was written for the Debian GNU/Linux distribution
because the original program does not have a manual page.
Instead, it has documentation in the GNU Info format; see below.
.PP
.\" TeX users may be more comfortable with the \fB\fP and
.\" \fI\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBgopher\fP is a program that...
.SH OPTIONS
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.SH SEE ALSO
.BR bar (1),
.BR baz (1).
.br
The programs are documented fully by
.IR "The Rise and Fall of a Fooish Bar" ,
available via the Info system.
.SH AUTHOR
This manual page was written by unknown ,
for the Debian GNU/Linux system (but may be used by others).
gopher-3.0.15/debian/manpage.sgml.ex 0000664 0000000 0000000 00000007771 10762617110 014122 0 ustar
FIRSTNAME">
SURNAME">
August 17, 2000">
SECTION">
jgoerzen@complete.org">
GOPHER">
Debian GNU/Linux">
GNU">
]>
&dhemail;
&dhfirstname;
&dhsurname;
2000&dhusername;
&dhdate;
&dhucpackage;
&dhsection;
&dhpackage;program to do something&dhpackage;DESCRIPTIONThis manual page documents briefly the
&dhpackage; and bar
commands.This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in the &gnu;
Info format; see below.&dhpackage; is a program that...OPTIONSThese programs follow the usual GNU command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
Info files.Show summary of options.Show version of program.SEE ALSObar (1), baz (1).The programs are documented fully by The Rise and
Fall of a Fooish Bar available via the
Info system.AUTHORThis manual page was written by &dhusername; &dhemail; for
the &debian; system (but may be used by others).
gopher-3.0.15/make.com 0000664 0000000 0000000 00000001706 10762617110 011376 0 ustar $ v = 'f$verify(0)'
$!********************************************************************
$ IF P1 .EQS. ""
$ THEN
$ type/nopage sys$input:
Usage:
@make UCX
@make WOLLONGONG
@make MULTINET
@make CMUIP
@make NETLIB
@make TCPWARE
$ exit
$ ENDIF
$!
$ ON CONTROL_Y THEN GOTO CLEANUP
$ ON ERROR THEN GOTO CLEANUP
$ v1 = f$verify(1)
$ set default [.object]
$ v1 = 'f$verify(0)'
$ @compile 'P1' 'P2'
$ @link 'P1' 'P2'
$!
$ v1 = f$verify(1)
$ set default [-.gopher]
$ v1 = 'f$verify(0)'
$ @compile 'P1' 'P2'
$ @link 'P1' 'P2'
$!
$ v1 = f$verify(1)
$ set default [-.gophfilt]
$ v1 = 'f$verify(0)'
$ @make_gophfilt 'P1' 'P2'
$ IF P2 .eqs. "DEBUG"
$ THEN
$ v1 = f$verify(1)
$ set default [-]
$ v1 = 'f$verify(0)'
$ goto CLEANUP
$ ENDIF
$!
$ v1 = f$verify(1)
$ set default [-.gopher.locales]
$ v1 = 'f$verify(0)'
$ @make
$!
$ v1 = f$verify(1)
$ set default [-.-]
$ v1 = 'f$verify(0)'
$!
$ CLEANUP:
$ v1 = f$verify(v)
$exit
gopher-3.0.15/config.sub 0000664 0000000 0000000 00000043113 10762617110 011737 0 ustar #! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS (if any).
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
| arme[lb] | pyramid \
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
| powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
| pdp11 | mips64el | mips64orion | mips64orionel \
| sparc)
basic_machine=$basic_machine-unknown
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigados)
basic_machine=m68k-cbm
os=-amigados
;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[345]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv32
;;
i[345]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv4
;;
i[345]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv
;;
i[345]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-solaris2
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
miniframe)
basic_machine=m68000-convergent
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
np1)
basic_machine=np1-gould
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | p6)
# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
basic_machine=i586-intel
;;
pentium-* | p5-* | p6-*)
# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
k5)
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
basic_machine=i586-amd
;;
nexen)
# We don't have specific support for Nexgen yet, so just call it a Pentium
basic_machine=i586-nexgen
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
basic_machine=mips-mips
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-unixware* | svr4*)
os=-sysv4
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
| -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
| -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-ctix* | -uts*)
os=-sysv
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-semi)
os=-aout
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-ibm)
os=-aix
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigados
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-lynxos*)
vendor=lynx
;;
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxworks*)
vendor=wrs
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
gopher-3.0.15/gophfilt/ 0000775 0000000 0000000 00000000000 12621233142 011564 5 ustar gopher-3.0.15/gophfilt/tryit.com 0000664 0000000 0000000 00000002460 10762617110 013446 0 ustar $ v = 'f$verify(0)'
$!********************************************************************
$! F.Macrides 15-Dec-1994 Enable DEBUG build via P2.
$! F.Macrides 01-Dec-1994 Initial version.
$!********************************************************************
$! MODULE: tryit.com
$! Example DCL script for use with gophfilt
$!********************************************************************/
$ set noon
$ IF f$type(gophfilt) .eqs. ""
$ THEN
$ v = f$verify(1)
$!***************************************************
$! define gophfilt as a foreign command:
$!
$! gophfilt :== $device[directory]gophfilt.exe
$!
$ v = 'f$verify(0)'
$ exit
$!
$ ENDIF
$ v = f$verify(1)
$!**************************************************
$! Pass filename as P1 if you want output to a file:
$!
$ if P1 .nes. "" then define sys$output "''P1'"
$!
$!************************
$! Try it with qualifiers:
$!
$ gophfilt -t 0 -p "0/Information About Gopher/about"-
-h gopher.tc.umn.edu -s 70
$!
$!*******************
$! Try it with a URL:
$!
$ gophfilt "gopher://gopher.tc.umn.edu:70/00/Information%20About%20Gopher/about"
$!
$!*******************************************************
$! Try it with tabbed stream input from the command file:
$!
$ gophfilt
0 0/Information About Gopher/about gopher.tc.umn.edu 70
$!
$ v = 'f$verify(0)'
$ exit
gopher-3.0.15/gophfilt/gophfilt.c 0000664 0000000 0000000 00000012267 10762617110 013561 0 ustar /********************************************************************
*
* @(#)gophfilt.c 1.2
*
*********************************************************************
* MODULE: gophfilt.c
* Semi-traditional unix filter for gophering.
*********************************************************************
*/
#include
#include "Stdlib.h"
#include
#include "conf.h"
#include "string.h"
#include "GSgopherobj.h"
GopherObj *Oneshot;
int DEBUG = 0;
SIGRETTYPE timeout();
/*** for getopt processing ***/
extern char *optarg;
extern int optind;
#ifdef VMS
int
DCLsystem(command)
char *command;
{
if(command && strcmp(command, ""))
fprintf(stdout, "Cannot execute: %s\n", command);
else
fprintf(stdout, "Cannot spawn.\n");
return(0);
}
#endif /* VMS */
int
main(argc, argv)
int argc;
char *argv[];
{
int manual = 0;
int path = 0;
int type = 0;
unsigned timer = 10;
char *host = CLIENT1_HOST;
int port = CLIENT1_PORT;
char *item = "";
int c, x = 0;
int numread, sockfd;
char buf[1024];
/* Allocate the Gopher object structure */
Oneshot = GSnew();
while ((c = getopt(argc, argv, "h:s:p:i:t:T:")) != -1)
switch (c) {
case 's':
port = atoi(optarg);
manual++;
break;
case 'p':
GSsetPath(Oneshot, optarg);
manual++;
path++;
break;
case 'h':
host = optarg;
manual++;
break;
case 'T':
timer = (unsigned)atoi(optarg);
break;
case 't':
GSsetType(Oneshot, *optarg);
manual++;
type++;
break;
case 'i':
item = optarg;
manual++;
break;
default:
#ifdef VMS
fprintf(stdout, "Error in parsing command line arguments.\n");
exit(0);
#else
return(-1);
#endif
}
/**** Get a URL from the command line, if present ****/
if (optind < argc && strchr(argv[optind], ':') != NULL) {
x=GSfromURL(Oneshot, argv[optind], AFTP_HOST, AFTP_PORT, x);
manual+=x;
if (x & G_PATH)
path++;
if (x & G_TYPE)
type++;
if (x & G_HOST)
host = GSgetHost(Oneshot);
if (x & G_PORT)
port = GSgetPort(Oneshot);
}
/* Set the port to either the default or one provided */
GSsetPort(Oneshot, port);
GSsetHost(Oneshot, host);
/* See if the minimum stuff was provided */
if (manual && (!path || !type)) {
#ifdef VMS
fprintf(stdout,
"Manual operation and insufficient parameters were provided.\n");
exit(0);
#else
return(-2); /* error if not */
#endif
}
/* Get the selector item from stdin if not already filled in by hand */
if (!manual) {
if (GSfromNet(Oneshot, 0) < 0) {
/* Error if cannot get it */
#ifdef VMS
fprintf(stdout,
"Piped operation and unable to read selector from stdin.\n");
exit(0);
#else
return(-3);
#endif
}
}
/** Get the kind of file from the first character **/
/** Filter out files that we can't deal with **/
switch (GSgetType(Oneshot)) {
case A_FILE:
case A_DIRECTORY:
case A_MACHEX:
case A_PCBIN:
case A_CSO:
case A_INDEX:
case A_SOUND:
case A_UNIXBIN:
case A_GIF:
case A_HTML:
case A_MIME:
case A_IMAGE:
break;
default:
#ifdef VMS
fprintf(stdout, "Unsupported item type requested.\n");
exit(0);
#else
return(-4);
#endif
}
/* Connect to the specified server */
if ((sockfd = GSconnect(Oneshot)) <0) {
#ifdef VMS
fprintf(stdout,
"Unable to connect to specified host and port combination.\n");
exit(0);
#else
return(-5);
#endif
}
/** Send out the request **/
writestring(sockfd, GSgetPath(Oneshot));
if (strlen(item)) {
writestring(sockfd, "\t");
writestring(sockfd, item);
}
writestring(sockfd, "\r\n");
/* Set an alarm in case we get nothing */
(void)signal(SIGALRM, timeout);
(void)alarm(timer);
switch (GSgetType(Oneshot)) {
case A_FILE: /* contents of a plain file */
case A_DIRECTORY: /* listing of a directory */
case A_MACHEX: /* results of a search */
case A_INDEX:
/* Text ends with a lonesome '.' on a line */
while (readline(sockfd, buf, sizeof(buf)) > 0) {
(void)alarm((unsigned)0);
(void)alarm(timer);
ZapCRLF(buf);
if (*buf == '.' && *(buf+1) == '\0')
break;
fputs(buf, stdout);
putc('\n', stdout);
}
break;
case A_SOUND: /* Binary stuff */
case A_IMAGE:
case A_GIF:
case A_UNIXBIN:
case A_PCBIN:
/* Binary stuff we just read til it's gone */
while ((numread = readn(sockfd, buf, sizeof buf)) > 0) {
(void)alarm((unsigned)0);
(void)alarm(timer);
if (fwrite(buf, numread, 1, stdout) == 0) {
close(sockfd);
#ifdef VMS
fprintf(stderr, "Error encountered writing to stdout.\n");
#else
return(-6);
#endif
}
}
break;
}
close(sockfd);
(void)alarm((unsigned)0);
#ifdef VMS
exit(1);
#else
return(0);
#endif
}
/*SUBTTL timeout() - Alarm expired while awaiting data */
/*
*/
SIGRETTYPE timeout()
{
#ifdef VMS
fprintf(stdout, "Timeout occurred while waiting for more data.\n");
exit(0);
#else
exit(-7);
#endif
}
gopher-3.0.15/gophfilt/make_gophfilt.com 0000664 0000000 0000000 00000004650 10762617110 015107 0 ustar $ vg = 'f$verify(0)'
$!********************************************************************
$! F.Macrides 15-Dec-1994 Enable DEBUG build via P2.
$! F.Macrides 01-Dec-1994 Initial version.
$!********************************************************************
$! MODULE: makefilt.com
$! compiling and linking script for gophfilt
$!********************************************************************/
$!
$ IF P1 .EQS. ""
$ THEN
$ type/nopage sys$input:
Usage:
@compile UCX
@compile WOLLONGONG
@compile MULTINET
@compile CMUIP
@compile NETLIB
@compile TCPWARE
$ exit
$ ENDIF
$ IF P2 .EQS. "DEBUG"
$ THEN
$ write sys$output "Compiling gophfilt with DEBUG..."
$ debug := "/obj=gophfilt.objd/debug/noopt"
$ ELSE
$ debug := ""
$ ENDIF
$!
$ ON CONTROL_Y THEN GOTO CLEANUP
$ ON ERROR THEN GOTO CLEANUP
$!
$ IF P1 .eqs. "TCPWARE"
$ THEN
$ write sys$output "Compiling gophfilt with UCX emulation..."
$ transport := "UCX"
$ ELSE
$ transport := "''P1'"
$ ENDIF
$!
$ IF f$trnlnm("VAXCMSG") .eqs. "DECC$MSG" .or. -
f$trnlnm("DECC$CC_DEFAULT") .eqs. "/DECC"
$ THEN
$ optfile := "''P1'_DECC"
$ vg1 = f$verify(1)
$! DECC:
$ define/nolog C$USER_INCLUDE [-],[-.object]
$ define/nolog DECC$USER_INCLUDE [-],[-.object]
$ vg1 = 'f$verify(0)'
$ IF transport .eqs. "UCX"
$ THEN
$ vg1 = f$verify(1)
$ cc/prefix=(all,except=(setlocale))-
/warning=(disable=implicitfunc)-
/define=('transport'=1,__VMS_CURSES)-
'debug' gophfilt.c
$ vg1 = 'f$verify(0)'
$ ELSE
$ vg1 = f$verify(1)
$ cc/prefix=(all,except=(connect,gethostbyname,htons,inet_addr,-
setsockopt,socket,setlocale))-
/warning=(disable=implicitfunc)-
/define=('transport'=1,__VMS_CURSES)-
'debug' gophfilt.c
$ vg1 = 'f$verify(0)'
$ ENDIF
$ ELSE
$ optfile := "''P1'_VAXC"
$ vg1 = f$verify(1)
$! VAXC:
$ cc/include=([-],[-.object])/define=('transport'=1)-
'debug' gophfilt.c
$ vg1 = 'f$verify(0)'
$ ENDIF
$!
$ IF P2 .eqs. "DEBUG"
$ THEN
$ vg1 = f$verify(1)
$!
$ link/debug/exe=gophfilt_debug-
gophfilt.objd,[-.object]libgopher_debug/lib,-
sys$library:vaxccurse/lib,-
sys$disk:[-.gopher.vmsopts]'optfile'/opt
$!
$ vg1 = 'f$verify(0)'
$ ELSE
$ vg1 = f$verify(1)
$!
$ link gophfilt.obj,[-.object]libgopher/lib,-
sys$library:vaxccurse/lib,-
sys$disk:[-.gopher.vmsopts]'optfile'/opt
$!
$ vg1 = 'f$verify(0)'
$ ENDIF
$!
$ CLEANUP:
$ vg1 = f$verify(vg)
$exit
gopher-3.0.15/gophfilt/Makefile.in 0000664 0000000 0000000 00000005406 10762617110 013643 0 ustar #********************************************************************
# $Author: jgoerzen $
# $Revision: 1.3 $
# $Date: 2002/01/11 15:55:59 $
# $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gophfilt/Makefile.in,v $
# $State: Exp $
#
# Paul Lindner, University of Minnesota CIS.
#
# Copyright 1991, 1992 by the Regents of the University of Minnesota
# see the file "Copyright" in the distribution for conditions of use.
#********************************************************************
# MODULE: Makefile
# Makefile for gopher filter client
#*********************************************************************
# Revision History:
# $Log: Makefile.in,v $
# Revision 1.3 2002/01/11 15:55:59 jgoerzen
# * Using $(INSTALL) from subdirectories broke on systems
# where install-sh was used because $(INSTALL) would always
# resolve to ./install-sh. Replaced all instances of
# $(INSTALL) with @INSTALL@ (autoconf would provide the correct
# path) and removed INSTALL from Makefile.config. Reported
# by Don Fike on Solaris 2.6.
# * Updated our copy of install-sh with the one from
# a current automake.
#
# Revision 1.2 2002/01/08 17:36:14 jgoerzen
# Finally builds!
#
# Changes:
#
# * config.h.in: rebuilt by autoheader
#
# * configure: rebuilt by autoconf
#
# * configure.in:
# * Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
# * Added checkes for term.h, re_comp.h, regex.h
#
# * gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
#
# * gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
# * Use REGEXLIBS
#
# * gopher/globals.h, gopher/gopher.c: Remove sys_errlist
#
# * object/GSgopherobj.c: Removed #include, now use
# "Regex.h" that has proper regex determining logic
#
# * object/Regex.h: Moved regex.h include to here. Make it conditional
# based on configure test. Add conditional re_comp.h include.
#
# Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
# Import from UMN Gopher 2.3.1 after GPLization
#
# Revision 1.1 1996/01/06 00:33:31 lindner
# rel 2.3
#
#********************************************************************/
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
include ../Makefile.config
OBJS = gophfilt.o
CCFLAGS = $(OPT) $(INTLOPTS) -I.. -I$(top_srcdir) -I$(top_srcdir)/object
TARGET = gophfilt
all: $(TARGET)
.c.o:
$(CC) $(CCFLAGS) -c $<
../object/libgopher.a:
(cd ..; $(MAKE) $(MFLAGS) objects)
$(TARGET) : $(OBJS) ../object/libgopher.a
$(CC) $(LDFLAGS) -o $@ $(OBJS) ../object/libgopher.a @REGEXLIBS@ @LIBS@
install : all
-mv $(CLIENTDIR)/$(TARGET) $(CLIENTDIR)/$(TARGET).old
@INSTALL@ $(TARGET) $(CLIENTDIR)
clean:
-rm -f $(TARGET) $(OBJS) *.out *~ core
$(OBJS): $(srcdir)/../object/GSgopherobj.h $(srcdir)/../conf.h
gopher-3.0.15/Makefile.in 0000664 0000000 0000000 00000013650 10762617110 012027 0 ustar #********************************************************************
# $Author: jgoerzen $
# $Revision: 1.10 $
# $Date: 2002/04/26 13:33:33 $
# $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/Makefile.in,v $
# $State: Exp $
#
# Paul Lindner, University of Minnesota CIS.
#
# Copyright 1991, 1992 by the Regents of the University of Minnesota
# see the file "Copyright" in the distribution for conditions of use.
#********************************************************************
# MODULE: Makefile
# Makefile for entire gopher distribution.
#*********************************************************************
# Revision History:
# $Log: Makefile.in,v $
# Revision 1.10 2002/04/26 13:33:33 jgoerzen
# Removed glib MIME stuff. We'll move to Pygopherd first.
#
# Revision 1.8 2002/01/28 03:38:58 jgoerzen
# Patches for FreeBSD:
# * Test in configure for stdlib.h
# * Include stdlib.h if it's available in Malloc.h
# * Don't include malloc.h if it's missing in Malloc.h
# * Don't include strcasestr if it's present in util.c and util.h
#
# Revision 1.7 2002/01/09 02:56:09 jgoerzen
# Updated archive target again
#
# Revision 1.6 2002/01/09 02:53:12 jgoerzen
# Fixed over-zealous Makefile.in problem.
#
# Revision 1.5 2002/01/09 00:47:05 jgoerzen
# Fixed archive target in Makefile.in
# MANIFEST updated by make archive
#
# Revision 1.4 2002/01/09 00:43:30 jgoerzen
# Updated
#
# Revision 1.3 2002/01/08 16:49:42 jgoerzen
# Modified distclean to be better behaved.
#
# Revision 1.2 2002/01/08 16:44:19 jgoerzen
# configure.in: Modified to check for crypt.h
# Reran autoconf & autoheader
# Makefile.in: Modified to be better with distclean
#
# Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
# Import from UMN Gopher 2.3.1 after GPLization
#
# Revision 3.1 1996/01/04 18:52:02 lindner
# Updates for autoconf
#
# Revision 3.15 1994/12/07 23:58:19 lindner
# Fix for VMS zip builder
#
# Revision 3.14 1994/11/18 22:25:39 lindner
# Fix for quicktar
#
# Revision 3.13 1994/08/19 17:02:06 lindner
# Remove ZIP file before creating it..
#
# Revision 3.12 1994/01/07 20:52:01 lindner
# pl11
#
# Revision 3.11 1993/08/19 20:31:54 lindner
# minor fixes for quicktar
#
# Revision 3.10 1993/08/17 21:58:11 lindner
# Fix for dependencies, all
#
# Revision 3.9 1993/08/12 06:34:23 lindner
# Added quicktar..
#
# Revision 3.8 1993/08/05 22:22:40 lindner
# warning message for archive
#
# Revision 3.7 1993/07/27 05:32:28 lindner
# added gophfilt and zip stuff
#
# Revision 3.6 1993/07/21 16:15:58 lindner
# Added tags target, install for shared libraries
#
# Revision 3.5 1993/04/15 22:00:52 lindner
# Move to looking for ui for WAIS stuff
#
# Revision 3.4 1993/03/18 23:11:15 lindner
# 1.2b3 release
#
# Revision 3.3 1993/02/19 21:41:58 lindner
# Fix to automatically copy Makefile.config.dist when making a distribution.
#
# Revision 3.2 1993/02/19 21:24:24 lindner
# Mods for CVS
#
# Revision 3.1.1.1 1993/02/11 18:02:49 lindner
# Gopher+1.2beta release
#
# Revision 1.3 1992/12/29 23:30:22 lindner
# Removed all references to fanout and mindexd, it's in gopherd now..
#
# Revision 1.2 1992/12/11 19:32:00 lindner
# make tar now uses gnu tar, ignores RCS directorys and symbolic links
#
# Revision 1.1 1992/12/11 19:01:43 lindner
# Gopher1.1 Release
#
#********************************************************************/
SHELL = /bin/sh
@SET_MAKE@
all: objects client gopherfilter
@echo "Welcome to Gopher"
#### Start of system configuration section. ####
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
${srcdir}/configure: configure.in
cd ${srcdir} && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: stamp-h.in
${srcdir}/stamp-h.in: configure.in
cd ${srcdir} && autoheader
echo timestamp > ${srcdir}/stamp-h.in
config.h: stamp-h
stamp-h: config.h.in config.status
./config.status
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
include Makefile.config
client: gopher/gopher
gopherfilter: gophfilt/gophfilt
objects: object/libgopher.a
# gopher is dependant on conf.h - (as are other things)
gopher/gopher: object/libgopher.a conf.h $(srcdir)/gopher/*c $(srcdir)/gopher/*h
@echo "Making client"
(cd gopher; $(MAKE) $(MFLAGS) all)
gophfilt/gophfilt: object/libgopher.a conf.h $(srcdir)/gophfilt/*c
@echo "Making gophfilt"
(cd gophfilt; $(MAKE) $(MFLAGS) all)
object/libgopher.a: $(srcdir)/object/*c $(srcdir)/object/*h
@echo "Making Objects"
(cd object; $(MAKE) $(MFLAGS) all)
install:
(cd object; $(MAKE) $(MFLAGS) install);
(cd gopher; $(MAKE) $(MFLAGS) install);
(cd gophfilt; $(MAKE) $(MFLAGS) install);
(cd doc; $(MAKE) $(MFLAGS) install)
clean:
(cd gopher; $(MAKE) $(MFLAGS) clean)
(cd object; $(MAKE) $(MFLAGS) clean)
(cd gophfilt; $(MAKE) $(MFLAGS) clean)
(cd doc; $(MAKE) $(MFLAGS) clean)
-rm -f "examples/Sample Directory/wais-index/index."*
distclean: spotless
-rm -f Makefile Makefile.config
spotless: clean
-rm -f config.log config.cache config.h config.status
-rm -f object/Makefile gopher/Makefile
-rm -f gopher/locales/Makefile doc/Makefile gophfilt/Makefile
-rm -rf debian/stamp*
-rm -rf debian/tmp
-rm -f *~
archive: distclean
-rm -f ir ui bin MANIFEST
touch MANIFEST
HERE=`basename $$PWD`; \
echo $$HERE ; \
cd .. ; \
find $$HERE -type f -print |grep -v '\.o$$' |grep -v '~$$' |grep -v 'CVS' >$$HERE/MANIFEST ; \
tar -T $$HERE/MANIFEST -czvf $$HERE.tar.gz ;\
rm -f $$HERE.zip ; \
egrep -v '^test' <$$HERE/MANIFEST | zip -@ $$HERE.zip
@echo Built $$HERE.tar.gz and $$HERE.zip
@echo "Did you remember to update the patchlevel.h Paul?..."
@echo "Hmmm... Hmmmm...."
quicktar:
HERE=`basename $$PWD`; \
touch MANIFEST ; \
cd .. ; \
find $$HERE -type f -print |grep -v '.o$$' |grep -v '~$$' |grep -v 'CVS' >$$HERE/MANIFEST ; \
/usr/gnu/bin/tar -T $$HERE/MANIFEST -cZvf $$HERE.tar.Z ;
tags:
etags `find . -print | egrep '\.[ch]$$'`
gopher-3.0.15/object/ 0000775 0000000 0000000 00000000000 12621233142 011216 5 ustar gopher-3.0.15/object/Stat.h 0000664 0000000 0000000 00000001774 10762617110 012320 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.1 $
* $Date: 2000/08/19 00:28:56 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Stat.h,v $
* $Status: $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: Stat.h
* Portable method of getting struct stat and friends
*********************************************************************
* Revision History:
* $Log: Stat.h,v $
* Revision 1.1 2000/08/19 00:28:56 jgoerzen
* Initial revision
*
* Revision 3.1 1994/06/29 05:46:45 lindner
* Portable stat.h file
*
*
*********************************************************************/
#ifndef G_STAT_H
#define G_STAT_H
# ifdef VMS
# include
# else
# include
# endif
#endif
gopher-3.0.15/object/BLblock.h 0000664 0000000 0000000 00000007523 10762617110 012713 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.2 $
* $Date: 2000/12/20 01:19:20 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/BLblock.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992,1993 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: BLblock.h
* Header file and abstraction of a gopher+ block
*********************************************************************
* Revision History:
* $Log: BLblock.h,v $
* Revision 1.2 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.5 1995/09/26 05:16:30 lindner
* more fixes...
*
* Revision 3.4 1995/09/25 22:07:16 lindner
* Ansification
*
* Revision 3.3 1995/02/27 17:45:32 lindner
* Use enums for block structures
*
* Revision 3.2 1993/03/26 19:50:41 lindner
* Mitra fixes for better/clearer fromNet code
*
* Revision 3.1.1.1 1993/02/11 18:03:06 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1993/01/31 00:31:12 lindner
* Initial revision
*
*
*********************************************************************/
#ifndef BLBLOCK_H
#define BLBLOCK_H
#include "STRstring.h"
#include "STAarray.h"
#include "boolean.h"
#include "util.h"
/** Return Values for *fromNet() functions **/
#define SOFTERROR -1
#define HARDERROR -2
#define MORECOMING 1
#define FOUNDEOF 0
typedef struct block_struct Blockobj;
typedef DynArray BlockArray;
#include "GSgopherobj.h"
/** The different types of blocks **/
enum blocktype {
BLOCK_UNKNOWN =0,
BLOCK_VIEW =1,
BLOCK_ASK =2,
BLOCK_ABSTRACT =3,
BLOCK_ADMIN =4
};
typedef enum blocktype BlockType;
/** The block data is a union, it can either be a filename or the
** actual data in a STRarray, or a gopher reference.
**/
union BlockData_union {
String *filename;
StrArray *text;
GopherObj *gs;
};
typedef union BlockData_union BlockData;
enum blockdatatype {
BDATA_NONE =0,
BDATA_FILE =1,
BDATA_TEXT =2,
BDATA_GREF =3
};
typedef enum blockdatatype BlockDataType;
struct block_struct
{
BlockType btype;
String *Blockname;
BlockDataType datatype;
BlockData data;
};
/****** Macros/data access ********/
#define BLgetName(a) (STRget((a)->Blockname))
#define BLsetName(a,b) (STRset((a)->Blockname,(b)))
#define BLgetBlocktype(a) (STRget((a)->btype))
#define BLsetBlocktype(a,b) (STRset((a)->btype,(b)))
#define BLgetDatatype(a) ((a)->datatype)
/**** Prototype declarations. ****/
Blockobj *BLnew();
void BLdestroy(Blockobj *bl);
void BLinit(Blockobj *bl);
void BLcpy(Blockobj *dest, Blockobj *orig);
int BLgetNumLines(Blockobj *bl);
void BLsetFile(Blockobj *bl, char *filename);
void BLsetGref(Blockobj *bl, GopherObj *);
void BLsetText(Blockobj *bl, StrArray *sta);
char * BLgetLine(Blockobj *bl, int lineno);
void BLtoNet(Blockobj *bl, int fd, boolean showheader);
int BLfromNet(Blockobj *bl, int fd, char *blockname);
int BLAsearch(BlockArray *bla, char *bname);
void BLaddText(Blockobj *bl, char *text);
/*************************************************************
** Define a dynamic block array
**/
#include "DAarray.h"
#define BLAnew(a) (DAnew((a),BLnew,BLinit,BLdestroy,BLcpy))
#define BLAinit(a) (DAinit((a)))
#define BLAgetTop(a) (DAgetTop(a))
#define BLAgetEntry(a,b) (Blockobj*)(DAgetEntry(a,b))
#define BLApush(a,b) (DApush((DynArray*)(a),(char*)(b)))
#define BLAdestroy(a) (DAdestroy(a))
#define BLAcpy(a,b) (DAcpy(a,b))
#endif
gopher-3.0.15/object/util.h 0000664 0000000 0000000 00000005652 10762617110 012361 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.5 $
* $Date: 2002/02/12 21:24:21 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/util.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: util.h
* Header file for routines in util.c
*********************************************************************
* Revision History:
* $Log: util.h,v $
* Revision 1.5 2002/02/12 21:24:21 jgoerzen
* Removed __USE_GNU -- it conflicted
*
* Revision 1.4 2002/02/12 21:22:56 jgoerzen
* Added __USE_GNU def
*
* Revision 1.3 2002/02/12 21:20:14 jgoerzen
* Made files using strcasecmp() include util.h
*
* Revision 1.2 2002/01/28 03:38:58 jgoerzen
* Patches for FreeBSD:
* * Test in configure for stdlib.h
* * Include stdlib.h if it's available in Malloc.h
* * Don't include malloc.h if it's missing in Malloc.h
* * Don't include strcasestr if it's present in util.c and util.h
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.5 1995/09/25 22:07:26 lindner
* Ansification
*
* Revision 3.4 1995/04/15 07:07:40 lindner
* Add ControlC handling feature...
*
* Revision 3.3 1994/01/21 04:20:40 lindner
* Better forward prototypes
*
* Revision 3.2 1993/03/18 22:28:46 lindner
* Updated protos
*
* Revision 3.1.1.1 1993/02/11 18:03:06 lindner
* Gopher+1.2beta release
*
* Revision 2.1 1992/12/21 19:43:15 lindner
* Added prototype for skip_whitespace
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef __GOPHER_UTIL_H__
#define __GOPHER_UTIL_H__
#include
#include "config.h"
/*
* Definitions of stuff in util.c
*/
int readn(int fd, char *ptr, int nbytes);
int writen(int fd, char *ptr, int nbytes);
int writestring(int, char*);
int readrecvbuf(int sockfd, char *buf, int len);
int readline(int fd, char *ptr, int maxlen);
int readtoken(int fd, char *ptr, int maxlen, char zechar);
int sreadword(char *input, char *output, int maxlen);
void ZapCRLF(char * );
void Fromhexstr(char * , char *);
void Tohexstr(char *input, char *output);
void Hexall(char *input, char *output);
#ifndef HAVE_STRCASESTR
char *strcasestr(char *inputline, char *match);
#endif
char *skip_whitespace(char *);
/*
* Interrupt stuff
*/
#include "boolean.h"
#include
extern boolean ControlCpressed;
extern jmp_buf Jmpenv;
void controlc(int sig);
void controlcJmp(int sig);
int interruptable_read(int fd, char *ptr, int nbytes);
int primeControlc();
void reprimeControlc();
#endif /* __GOPHER_UTIL_H__ */
gopher-3.0.15/object/Stdlib.h 0000664 0000000 0000000 00000004222 10762617110 012615 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.3 $
* $Date: 2002/02/12 19:54:18 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Stdlib.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: Stdlib.h
* Include stdlib.h on systems that have it.
*********************************************************************
* Revision History:
* $Log: Stdlib.h,v $
* Revision 1.3 2002/02/12 19:54:18 jgoerzen
* Updated with regex fixes
*
* Revision 1.2 2000/08/23 00:03:59 jgoerzen
* Updates
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.6 1996/01/04 18:26:50 lindner
* Updates for autoconf
*
* Revision 3.5 1994/04/07 17:26:26 lindner
* Fix for pyramids
*
* Revision 3.4 1994/03/07 04:42:05 lindner
* Add sys/types.h and compatible.h
*
* Revision 3.3 1993/07/07 19:28:04 lindner
* Mods for SGIs
*
* Revision 3.2 1993/06/15 06:07:16 lindner
* Mods for VMS
*
* Revision 3.1.1.1 1993/02/11 18:03:04 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef GSTDLIB_H
#define GSTDLIB_H
#include "compatible.h"
/** These definitely need stdlib.h **/
#if defined(STDC_HEADERS)
# ifndef sony_news /** Ack! sonynews is STDC but no stdlib! **/
# include
# endif
#else
/** These definitely *don't* want stdlib.h **/
# if !defined(mips) && !defined(sequent) && !defined(n16) && !defined(NeXT) && !defined(ultrix) && !defined(UMAX43) && !defined(sony_news) && !defined(pyr)
# include
# endif
#endif
#if !defined(VMS)
# include
#ifdef HAVE_STDLIB_H
#include
#endif
#ifdef HAVE_MALLOC_H
#include
#endif
#include
#endif
#endif /* GSTDLIB_H */
gopher-3.0.15/object/Wait.h 0000664 0000000 0000000 00000005166 10762617110 012310 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.1 $
* $Date: 2000/08/19 00:28:56 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Wait.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: Wait.h
* Routines that portably define waitpid()
*********************************************************************
* Revision History:
* $Log: Wait.h,v $
* Revision 1.1 2000/08/19 00:28:56 jgoerzen
* Initial revision
*
* Revision 3.10 1996/01/04 18:22:57 lindner
* Updated for autoconf
*
* Revision 3.9 1995/02/06 22:10:13 lindner
* Fix for systems without waitpid and wait3
*
* Revision 3.8 1994/06/29 06:35:52 lindner
* Add sequent to list of machines without waitpid()
* Use POSIX macros if present (Coopersmith)
*
* Revision 3.7 1994/04/14 15:44:22 lindner
* Add Gwaitstatus for VMS
*
* Revision 3.6 1994/04/08 19:15:46 lindner
* Fix for old union wait stuff
*
* Revision 3.5 1994/03/08 03:23:23 lindner
* Waitpid for vms
*
* Revision 3.4 1993/11/02 06:16:58 lindner
* Fix for epix
*
* Revision 3.3 1993/07/20 23:19:41 lindner
* Use waitpid, not wait3
*
* Revision 3.2 1993/05/05 18:40:16 lindner
* Solaris mods
*
* Revision 3.1.1.1 1993/02/11 18:03:04 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
/*
* A header file to portably include the stuff for doing waitpid() etal
*/
#include "Stdlib.h" /* for pid_t */
#ifdef VMS
# define NO_WAITPID_WAIT3
# include
#endif
#ifdef NO_WAITPID_WAIT3
# define Portawait int
pid_t waitpid();
# define Gwaitstatus(a) (a)
#else
# include
# include
# include
/** These don't know what waitpid() is.. Naughty! **/
# if !defined(HAVE_WAITPID) && defined(HAVE_WAIT3)
typedef union wait Portawait;
# define waitpid(a,b,c) wait3(b,c,NULL)
# define Gwaitstatus(a) ((a).w_status)
# else
/*** Everything else mostly does.. ***/
typedef int Portawait;
# if defined(WIFEXITED) && defined(WEXITSTATUS) && defined(WIFSIGNALED) && defined(WTERMSIG)
# define Gwaitstatus(a) (WIFEXITED(a) ? WEXITSTATUS(a) : (WIFSIGNALED(a) ? WTERMSIG(a) : 0))
# else
# define Gwaitstatus(a) (a)
# endif
# endif
#endif /* VMS */
gopher-3.0.15/object/GDgopherdir.h 0000664 0000000 0000000 00000006510 10762617110 013574 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.1 $
* $Date: 2000/08/19 00:28:56 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/GDgopherdir.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: GDgopherdir.h
* Header file/abstraction of a gopher directory
*********************************************************************
* Revision History:
* $Log: GDgopherdir.h,v $
* Revision 1.1 2000/08/19 00:28:56 jgoerzen
* Initial revision
*
* Revision 3.7 1995/10/31 16:47:57 lindner
* Switch to void+ pointer
*
* Revision 3.6 1995/09/25 22:07:17 lindner
* Ansification
*
* Revision 3.5 1994/07/21 22:26:37 lindner
* Alan's GDlocation stuff
*
* Revision 3.4 1994/01/21 04:47:20 lindner
* Add function prototypes
*
* Revision 3.3 1994/01/10 03:29:07 lindner
* New Method GDsetNumitems()
*
* Revision 3.2 1993/04/15 21:35:59 lindner
* Changed protos
*
* Revision 3.1.1.1 1993/02/11 18:03:03 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef GDGOPHERDIR_H
#define GDGOPHERDIR_H
#include "GSgopherobj.h"
#include "DAarray.h"
/****************************************************************
** A Gopher directory structure...
** Features dynamic growth among other things...
**
*****************************************************************/
struct g_dir_struct {
String *Title;
GopherObj *Location;
DynArray *Gophers;
int currentitem;
};
typedef struct g_dir_struct GopherDirObj;
typedef struct g_dir_struct *GopherDirObjp;
#define GDgetEntry(a,b) ((GopherObj *)(DAgetEntry((a)->Gophers,(b))))
#define GDgetTitle(a) (STRget((a)->Title))
#define GDsetTitle(a,b) (STRset((a)->Title,b))
#define GDgetLocation(a) ((a)->Location)
#define GDgetNumitems(a) (DAgetNumitems((a)->Gophers))
#define GDsetNumitems(a,b) (DAsetTop((a)->Gophers,(b)))
#define GDsetCurrentItem(a,b) ((a)->currentitem=b)
#define GDgetCurrentItem(a) ((a)->currentitem)
/*** Real live functions declared in GDgopherdir.c ***/
GopherDirObj *GDnew(int size);
void GDdestroy(GopherDirObj *);
void GDinit(GopherDirObj *);
void GDsetLocation(GopherDirObj *gd, GopherObj *gs);
void GDaddGS(GopherDirObj *gd, GopherObj *gs);
void GDaddGSmerge(GopherDirObj *gd, GopherObj *gs);
void GDsort(GopherDirObj *);
void GDtoNet(GopherDirObj *gd, int sockfd, GSformat fmt, char *ticket,
void (*prefcn)());
void GDplustoNet(GopherDirObj *gd, int sockfd, char **filter,
char *ticket);
void GDfromNet(GopherDirObj *gd, int sockfd, int (*eachitem)());
int GDplusfromNet(GopherDirObj *gd, int fd, int (*eachitem)());
void GDgrow();
void GDfromLink(GopherDirObj *, FileIO *, char *, int, char*, char*);
void GDtoLink(GopherDirObj *gd, int fd);
GopherDirObj *GDdeleteGS(GopherDirObj *gd, int j);
int GDSearch(GopherDirObj *gd, char *text);
#endif /* GDGOPHERDIR_H */
gopher-3.0.15/object/Locale.c 0000664 0000000 0000000 00000032276 10762617110 012600 0 ustar /**********************************************************************
* $Id: Locale.c,v 1.2 2001/01/17 21:16:35 jgoerzen Exp $
*
* Paul Lindner, University of Minnesota DCS
*
* Copyright 1994 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
**********************************************************************
* MODULE: Locale.c
* These routines make using the international messages facilities easier.
*
* This interface could be applied to methods other than X/Open coding
* (VMS etc..)
**********************************************************************
* $Log: Locale.c,v $
* Revision 1.2 2001/01/17 21:16:35 jgoerzen
* More psinrtf -> snprintf changes
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.9 1994/12/05 22:44:42 lindner
* Added VMS code from F. Macrides for specifying the default language
* via the GOPHERMSGS_DEFAULT definition in conf.h, for when a series of
* languages have been made available by setting the DCL logical
* LC_MESSAGES to the * wildcard.
*
* Added code for specifying the device where shared images of message
* files will be found, via the GOPHERMSGS_DEV definition in conf.h.
*
* Blocked potential ACCVIO's for VMSers who misunderstand how to set up
* the messaging and do it wrong.
*
* Revision 3.8 1994/11/24 08:10:20 lindner
* sundry compiler fixes
*
* Revision 3.7 1994/11/17 06:34:00 lindner
* Fixes for VMS internationalization
*
* Revision 3.6 1994/08/19 16:27:51 lindner
* Alan's mega-patch for Locale stuff
*
* Revision 3.5 1994/07/25 14:00:35 lindner
* Add std comments
*
*/
#include "Locale.h"
#ifdef GINTERNATIONAL
#include "Stdlib.h"
#include "String.h"
#include "DAarray.h"
#include "STRstring.h"
#include "fileio.h"
#include
nl_catd Gcatd = (nl_catd) -1;
#ifdef NO_XPGCAT
/** if we're not using the X/Open message catalogs, we have to keep
track of the locale **/
String *msgLocale = NULL;
#endif /* NO_XPGCAT */
/*************** DynArray of messages ***************/
typedef DynArray GtxtArray;
GtxtArray *GtxtMsgs = (GtxtArray *) NULL;
#define GtxtNew STRnew
#define GtxtInit STRinit
#define GtxtCopy STRcpy
#define GtxtDestroy STRdestroy
/*************** Public interfaces ***************/
char *
Gtxt (defaultString, msgNumber)
char *defaultString;
int msgNumber;
{
String *msgString;
if ( (Gcatd == (nl_catd) -1) )
return defaultString;
if ( GtxtMsgs != NULL ) {
if (DAgetNumitems(GtxtMsgs) < msgNumber) {
DAgrow(GtxtMsgs, msgNumber);
}
msgString = (String *) DAgetEntry(GtxtMsgs, msgNumber - 1);
#ifndef NO_XPGCAT
if (STRlen(msgString) == 0) {
STRset(msgString,
catgets(Gcatd, NL_SETD, msgNumber, defaultString));
}
#endif
if (STRget(msgString) != NULL)
return (STRget(msgString));
}
#ifdef NO_XPGCAT
return defaultString;
#else
return (catgets(Gcatd, NL_SETD, msgNumber, defaultString));
#endif
}
#ifdef flags
#undef flags
#endif
nl_catd
Gtxtopen (catname, flags)
char *catname;
int flags; /* not used */
{
#ifdef NO_XPGCAT
FileIO *fio = NULL;
char quotechar = '\0';
char inputline[1024];
#endif /*NO_XPGCAT*/
if (GtxtMsgs != NULL) {
DAdestroy(GtxtMsgs);
}
#ifdef NO_XPGCAT
if (strchr(catname,'/') != NULL) { /* file path name */
fio = FIOopenUFS(catname, O_RDONLY, 0);
} else if ( (msgLocale != NULL) && (STRlen(msgLocale) > 0) ) {
snprintf(inputline, sizeof(inputline),
"%s/%s.msg", LOCALEDIR, STRget(msgLocale));
fio = FIOopenUFS(inputline, O_RDONLY, 0);
}
if (fio != NULL) {
GtxtMsgs = (GtxtArray *) DAnew(10, GtxtNew, GtxtInit,
GtxtDestroy, GtxtCopy);
if (GtxtMsgs == NULL) {
FIOclose(fio);
Gcatd = -1;
return Gcatd;
}
while (FIOreadline(fio, inputline, sizeof(inputline))) {
if (*inputline == '$') {
if (strncmp(inputline + 1, "quote ", 6)==0)
quotechar = *(inputline + 7);
} else if (isdigit(*inputline)) {
char *cp, *cp2;
int msgNumber;
msgNumber = atoi(inputline);
if (msgNumber != 0) {
if (quotechar != '\0') {
cp = strchr(inputline, quotechar);
if (cp != NULL) {
cp2 = cp++;
do {
cp2 = strchr(cp2 + 1, quotechar);
} while ((cp2 != NULL) && (*(cp2-1) == '\\'));
if (cp2 != NULL)
*cp2 = '\0';
}
} else {
cp = inputline;
while (isdigit(*cp))
cp++;
cp++; /* skip exactly one char after number */
cp2 = cp + strlen(cp);
if (*cp2 == '\n') /* strip trailing return */
*cp2 = '\0';
}
if (cp != NULL) {
if (DAgetNumitems(GtxtMsgs) < msgNumber) {
DAgrow(GtxtMsgs, msgNumber);
}
STRset((String *)
DAgetEntry(GtxtMsgs, msgNumber - 1), cp);
}
}
}
}
FIOclose(fio);
Gcatd = 1; /* random positive number */
}
else
Gcatd = -1;
#else
Gcatd = catopen(catname, flags);
if (Gcatd != (nl_catd) -1) {
GtxtMsgs = (GtxtArray *) DAnew(10, GtxtNew, GtxtInit,
GtxtDestroy, GtxtCopy);
}
#endif /* NO_XPGCAT */
return Gcatd;
}
#ifndef VMS
char *
Gtxtlocale(type, str)
int type;
char *str;
{
#ifdef NO_XPGCAT
# ifdef LC_MESSAGES
if ( (type == LC_ALL) || (type == LC_MESSAGES) ) {
# else
if (type == LC_ALL) {
# endif
if (*str == '\0') { /* load from LC_MESSAGES or LANG env var */
char *cp;
cp = getenv("LC_MESSAGES");
if (cp == NULL)
cp = getenv("LANG");
if (cp != NULL) {
if (msgLocale == NULL)
msgLocale = STRnew();
STRset(msgLocale, str);
}
} else {
if (msgLocale == NULL)
msgLocale = STRnew();
STRset(msgLocale, str);
}
}
#endif /* NO_XPGCAT */
#ifndef NO_LOCALE
return (setlocale(type,str));
#else
if (msgLocale == NULL)
return NULL;
else
return STRget(msgLocale);
#endif /* NO_LOCALE */
}
#else /* VMS */
#include "[-]conf.h"
#include "GDgopherDir.h"
#include "GSgopherObj.h"
#include
#include
int GTXT_facility=0;
char *GTXT_language;
#ifndef GOPHERMSGS_DEFAULT
#define GOPHERMSGS_DEFAULT "- none -"
#endif /* GOPHERMSGS_DEFAULT */
#ifndef GOPHERMSGS_DEV
#define GOPHERMSGS_DEV "GopherP_Dir:.EXE"
#endif /* GOPHERMSGS_DEV */
extern GopherDirObj *setlocale_LangDir;
/*
** Emulate catgets() by securing a VMS message
*/
char *
catgets(junk1, junk2, code, msg_default)
int junk1;
int junk2;
int code;
char *msg_default;
{
struct dsc$descriptor_s buf_;
static
char buf[512];
int i;
int x;
/* Reconfigure code as VMS error condition */
code = (GTXT_facility<<16) + (code << 3) + 3;
code |= 0x08008000;
buf_.dsc$b_dtype = DSC$K_DTYPE_T;
buf_.dsc$b_class = DSC$K_CLASS_S;
buf_.dsc$a_pointer = buf;
buf_.dsc$w_length = sizeof(buf);
memset(buf,'\0',sizeof(buf));
i = 0;
x = SYS$GETMSG(code, &i, &buf_, 1, 0);
if ((x & 1) && (x != SS$_MSGNOTFND)) {
buf[i] = '\0';
return(buf);
}
return(msg_default);
}
/*
** Emulate catopen() by locating and activating a VMS message file
*/
nl_catd
catopen(char *filespec, int junk)
{
struct dsc$descriptor_s filespec_;
struct dsc$descriptor_s symbol_;
unsigned long value;
int status;
$DESCRIPTOR(image_,GOPHERMSGS_DEV);
char *file;
char *cp;
filespec_.dsc$b_dtype = symbol_.dsc$b_dtype = DSC$K_DTYPE_T;
filespec_.dsc$b_class = symbol_.dsc$b_class = DSC$K_CLASS_S;
if ((cp=strstr(filespec, "GOPHER_MSG")) == NULL)
return(SS$_IVLOGNAM);
file = (char *)malloc(sizeof(char)*(strlen(cp)+1));
strcpy(file,cp);
GTXT_language = strstr(file,"_MSG") + strlen("_MSG");
cp = strrchr(GTXT_language,'.');
if (cp)
*cp = '\0';
symbol_.dsc$a_pointer = (char *)malloc(sizeof(char)*(strlen("GOPHER_LANG")
+1+strlen(GTXT_language)));
strcpy(symbol_.dsc$a_pointer,"GOPHER_LANG");
strcat(symbol_.dsc$a_pointer,GTXT_language);
symbol_.dsc$w_length = strlen(symbol_.dsc$a_pointer);
filespec_.dsc$a_pointer = file;
filespec_.dsc$w_length = strlen(filespec_.dsc$a_pointer);
status = LIB$FIND_IMAGE_SYMBOL(&filespec_,&symbol_,&value,&image_);
free(symbol_.dsc$a_pointer);
free(file);
if (status == SS$_NORMAL) {
GTXT_facility = value;
return( (nl_catd) 1);
}
else
return ( (nl_catd) -1 );
}
/*
** This procedure secures the LC_MESSAGES logical or symbol or SYS$LANGUAGE
** system logical and inserts it into the GopherP_Dir:gopher_msg_%s.exe
** filespec. If not defined, "*" is inserted, triggering a wildcard search
** of message files. The filespec is then searched for, and for each
** matching filespec found, the message number 222 is retrieved and inserted
** into a menu list. If no menu list entries are retrieved, Gtxt() is
** disabled, causing the default message to be returned. If only one menu
** list entry is retrieved, the message file it came from is chosen as the
** process level message file and Gtxt() is enabled to read it. If more
** than one menu list entry is retrieved, the menu is offered to the user,
** and the choice they make is set as the process level message file and
** Gtxt() is enabled to read it.
*/
#include
#include
void
rsetlocale(int facility)
{
Gcatd = (nl_catd) 1;
GTXT_facility = facility;
if (GtxtMsgs != NULL)
DAdestroy(GtxtMsgs);
GtxtMsgs = (GtxtArray *) DAnew(10, GtxtNew, GtxtInit,
GtxtDestroy, GtxtCopy);
}
void
setlocale(char *x, char *y)
{
int status;
int defaultLang = -1;
char fname[256], *cp;
char command[256];
char iso_language[33];
GopherObj *tmpgs = NULL;
static struct
dsc$descriptor_s language_ = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0};
static struct FAB wild_fab;
static struct NAM wild_nam;
static char fullname[256];
static char expanded[256];
static char result[256];
iso_language[0] = '\0';
if (getenv("LC_MESSAGES") != NULL)
strcpy(iso_language,getenv("LC_MESSAGES"));
else { /* Test SYS$LANGUAGE using LIB$GET_USERS_LANGUAGE() */
language_.dsc$w_length = sizeof(iso_language)-1;
language_.dsc$a_pointer = iso_language;
if (SS$_NORMAL == (status = LIB$GET_USERS_LANGUAGE(&language_)))
iso_language[language_.dsc$w_length] = '\0';
else
iso_language[0] = '\0';
}
while (iso_language[0] != '\0' &&
iso_language[strlen(iso_language)-1] == ' ')
iso_language[strlen(iso_language)-1] = '\0';
if (iso_language[0] == '\0')
strcpy(iso_language,"*");
if ((cp=strchr(GOPHERMSGS_DEV, ':')) != NULL) {
strcpy(fname, GOPHERMSGS_DEV);
sprintf(cp=strchr(fname, ':'), ":gopher_msg_%s.exe", iso_language);
} else {
snprintf(fname, sizeof(fname),
"GopherP_Dir:gopher_msg_%s.exe", iso_language);
}
/* Scan for fname; on a hit, activate the image and get menu message */
wild_fab = cc$rms_fab;
wild_nam = cc$rms_nam;
wild_fab.fab$b_fac = FAB$M_GET;
wild_fab.fab$l_fop = FAB$V_NAM;
wild_fab.fab$l_nam = &wild_nam;
wild_fab.fab$l_dna = fname;
wild_fab.fab$b_dns = strlen(wild_fab.fab$l_dna);
wild_nam.nam$l_esa = expanded;
wild_nam.nam$l_rsa = result;
wild_nam.nam$b_ess = wild_nam.nam$b_rss = 255;
wild_fab.fab$l_fna = fullname;
wild_fab.fab$b_fns = fullname[0] = expanded[0] = result[0] = 0;
if ((status = SYS$PARSE(&wild_fab)) != RMS$_NORMAL)
return; /* The while loop will hang if wild_fab is invalid */
Gcatd = (nl_catd) 1; /* Always try to get the msg here. */
while (status!=RMS$_NMF && status!=RMS$_FNF) {
if ((( status = SYS$SEARCH(&wild_fab)) &1) != 1)
continue;
result[wild_nam.nam$b_rsl] = '\0';
if ((nl_catd)1 != catopen(result,0))
continue;
strcpy(command,Gtxt("",232));
if (strlen(command)) { /* An available language */
if (setlocale_LangDir == NULL) {
setlocale_LangDir = GDnew(32); /* 1st language */
GDsetTitle(setlocale_LangDir,"");
}
tmpgs = GSnew(); /* Store language menu item */
GSsetTitle(tmpgs, command);
strcpy(command+1,result);
GSsetType(tmpgs, command[0] = A_LANGUAGE);
GSsetPath(tmpgs, command);
GSsetHost(tmpgs,"0.0.0.0");
GSsetPort(tmpgs,GTXT_facility);
GDaddGS(setlocale_LangDir, tmpgs);
GSdestroy(tmpgs);
if (strcmp(GTXT_language+1,GOPHERMSGS_DEFAULT)==0) {
defaultLang = GDgetNumitems(setlocale_LangDir) - 1;
}
}
}
Gcatd = (nl_catd) -1; /* By default, never bother trying a message file */
if (setlocale_LangDir) {
/* We have one or more available languages */
if (GDgetNumitems(setlocale_LangDir)==1) {
status = 0; /* Only one choice */
rsetlocale(GSgetPort(GDgetEntry(setlocale_LangDir,0)));
GDdestroy(setlocale_LangDir);
setlocale_LangDir = NULL;
}
else if (defaultLang != -1) /* No choice for now. */
rsetlocale(GSgetPort(GDgetEntry(setlocale_LangDir,defaultLang)));
else { /* Two or more choices. */
status = setlocale_screen();
rsetlocale(GSgetPort(GDgetEntry(setlocale_LangDir,status)));
}
}
}
void
Gtxtlocale(a,b)
char *a, *b;
{
setlocale(a,b);
}
#endif /* VMS */
#endif /* GINTERNATIONAL */
gopher-3.0.15/object/Malloc.h 0000664 0000000 0000000 00000005417 10762617110 012612 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.3 $
* $Date: 2002/01/28 03:38:58 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Malloc.h,v $
* $Status: $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: Malloc.h
* Portable method of getting malloc definitions
*********************************************************************
* Revision History:
* $Log: Malloc.h,v $
* Revision 1.3 2002/01/28 03:38:58 jgoerzen
* Patches for FreeBSD:
* * Test in configure for stdlib.h
* * Include stdlib.h if it's available in Malloc.h
* * Don't include malloc.h if it's missing in Malloc.h
* * Don't include strcasestr if it's present in util.c and util.h
*
* Revision 1.2 2000/08/23 00:03:59 jgoerzen
* Updates
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.9 1996/01/04 18:25:38 lindner
* Updates for autoconf
*
* Revision 3.8 1995/06/30 20:30:01 lindner
* NewMEM define
*
* Revision 3.7 1994/06/29 06:37:55 lindner
* ...
*
* Revision 3.6 1994/06/29 05:44:17 lindner
* Make sure to only include malloc.h once
*
* Revision 3.5 1994/05/24 05:42:17 lindner
* Fix for old field version of DECC
*
* Revision 3.4 1994/05/19 14:25:24 lindner
* faster VMS VAXC malloc
*
* Revision 3.3 1993/10/19 20:46:35 lindner
* use stdio.h in Malloc.h to get NULL if necessary
*
* Revision 3.2 1993/10/11 17:23:32 lindner
* Better malloc fix for systems without NULL
*
* Revision 3.1.1.1 1993/02/11 18:03:03 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef G_MALLOC_H
#define G_MALLOC_H
/*
* Just enough to get us memory allocation and NULL
*
* Ick, portable code is ugly!
*/
#include "Stdlib.h"
#ifdef HAVE_MALLOC_H
#include
#endif
#ifdef HAVE_STDLIB_H
#include
#endif
/* Usually can get NULL from stdio.h */
#ifndef NULL
#include
#endif
/* Punt! */
#ifndef NULL
#define NULL ((void*) 0)
#endif
#ifdef HAVE_MALLOC_H
# include
#endif
/* memory management for VAXC */
#if defined(VMS) && defined(VAXC) && !defined(__DECC)
# include
# define malloc VAXC$MALLOC_OPT
# define calloc VAXC$CALLOC_OPT
# define free VAXC$FREE_OPT
# define cfree VAXC$CFREE_OPT
# define realloc VAXC$REALLOC_OPT
#endif /* VMS and VAXC */
#define NewMEM(a) ((a*)malloc(sizeof(a)))
#endif /* G_MALLOC_H */
gopher-3.0.15/object/fileio.c 0000664 0000000 0000000 00000045670 10762617110 012652 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.2 $
* $Date: 2000/12/20 01:19:20 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/fileio.c,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 92, 93, 94 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: fileio.c
* Socket/file input output routines.
*********************************************************************
* Revision History:
* $Log: fileio.c,v $
* Revision 1.2 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.41 1996/01/04 18:25:12 lindner
* Updates for autoconf
*
* Revision 3.40 1995/11/03 18:01:28 lindner
* Fix for waitpid stuff
*
* Revision 3.39 1995/09/25 22:07:23 lindner
* Ansification
*
* Revision 3.38 1995/06/12 15:32:41 lindner
* Close correct file descriptor
*
* Revision 3.37 1995/06/08 05:17:54 lindner
* From Fote: Deal with UCX's funny EPIPE return value on EOF
* immediately after each socket_read().
*
* Ensure that file is closed on fstat() error in FIOopenUFS()
*
* Revision 3.36 1995/04/15 06:53:39 lindner
* Different way of returning errors
*
* Revision 3.35 1995/03/09 05:28:19 lindner
* Insure files get closed in FIO routines
*
* Revision 3.34 1995/02/27 17:45:52 lindner
* Fix for sco
*
* Revision 3.33 1995/01/02 21:09:46 lindner
* Fix for UCX menu ordering
*
* Revision 3.32 1994/12/20 17:09:46 lindner
* Fix for binary file retrievals
*
* Revision 3.31 1994/12/03 02:14:13 lindner
* Correct fix for waitpid() code
*
* Revision 3.30 1994/12/02 00:37:05 lindner
* Fix for mail and misc process execution
*
* Revision 3.29 1994/12/01 00:30:13 lindner
* Remove EINTR wait for FIOwaitpid.. sigh..
*
* Revision 3.28 1994/11/29 06:30:04 lindner
* Make waitpid keep going after an interrupted system call
*
* Revision 3.27 1994/11/29 04:59:38 lindner
* Fix for broken shell scripts with Shell Index type
*
* Revision 3.26 1994/10/21 02:42:47 lindner
* fix for 0 length files
*
* Revision 3.25 1994/10/19 03:33:57 lindner
* Fix nasty bug, combine more code...
*
* Revision 3.24 1994/10/13 05:26:16 lindner
* Compiler complaint fixes
*
* Revision 3.23 1994/09/29 19:54:57 lindner
* Routines to use memory mapped I/O
*
* Revision 3.22 1994/07/21 22:19:37 lindner
* Add filename new and change debug msg
*
* Revision 3.21 1994/06/29 06:43:04 lindner
* Remove VMS message about reversed values, initialize filename
*
* Revision 3.20 1994/05/25 20:57:20 lindner
* Fix for piped play commands
*
* Revision 3.19 1994/04/25 03:44:42 lindner
* Don't block empty FIOsystem() command on VMS. That's what's used for
* the '!' or '$' commands, and they've already be checked for permission
* in Gopher.c.
*
* Reversed DCLsystem() return values in CURCurses.c, and eliminated the
* reversing kludge in FIOsystem().
*
* Fixed break of open() for Alpha. (all From F.Macrides)
*
* Revision 3.18 1994/04/25 03:37:00 lindner
* Modifications for Debug() and mismatched NULL arguments, added Debugmsg
*
* Revision 3.17 1994/04/25 02:18:46 lindner
* Fix for gcc-Wall
*
* Revision 3.16 1994/04/14 18:14:49 lindner
* Fix for closing null files
*
* Revision 3.15 1994/04/14 15:44:55 lindner
* Remove duplicate variable
*
* Revision 3.14 1994/04/08 21:07:34 lindner
* Put back a variable
*
* Revision 3.13 1994/04/08 20:05:57 lindner
* gcc -Wall fixes
*
* Revision 3.12 1994/04/08 19:15:47 lindner
* Fix for old union wait stuff
*
* Revision 3.11 1994/04/07 22:51:24 lindner
* Fix for typecast
*
* Revision 3.10 1994/04/01 04:43:31 lindner
* Fixes for memory leak in argv, and exit status
*
* Revision 3.9 1994/03/30 21:37:48 lindner
* Fix for AIX that doesn't #define unix..
*
* Revision 3.8 1994/03/11 00:10:52 lindner
* Fix for FIOopenUFS()
*
* Revision 3.7 1994/03/09 16:57:56 lindner
* Fix for other vms system() call
*
* Revision 3.6 1994/03/09 02:11:49 lindner
* Use DCLsystem for VMS
*
* Revision 3.5 1994/03/08 17:23:17 lindner
* Fix for return vals
*
* Revision 3.4 1994/03/08 06:17:15 lindner
* Nuke compiler warnings
*
* Revision 3.3 1994/03/08 03:22:39 lindner
* Additions for process management
*
* Revision 3.2 1994/03/04 17:43:36 lindner
* Fix for weird error
*
* Revision 3.1 1994/02/20 16:20:48 lindner
* New object based versions of buffered io routines
*
*
*********************************************************************/
#include "fileio.h"
#include "Malloc.h"
#include
#include "Debug.h"
#include "Wait.h"
#include "String.h"
#include "Stdlib.h"
#include "compatible.h"
#ifdef VMS
# include
#else
# include
#endif
#ifdef MMAP_IO
# include
# ifndef MAP_FILE
# define MAP_FILE 0
# endif
#endif
static char ** FIOgetargv(char *cmd);
/*
* Cache of used fios
*/
static FileIO* FIOusedfios[FIOMAXOFILES];
static int FIOnumusedfios = -1;
/*
* Pop a recently used item.
*/
static FileIO *FIOpopUsedfio()
{
if (FIOnumusedfios > 0) {
return(FIOusedfios[--FIOnumusedfios]);
} else
return(NULL);
}
/*
* Push an item on our recently used stack.
*/
static boolean FIOpushUsedfio(FileIO *oldfio)
{
if (FIOnumusedfios < FIOMAXOFILES) {
FIOusedfios[FIOnumusedfios++] = oldfio;
return(0);
} else
return(-1);
}
static FileIO *
FIOnew()
{
FileIO *temp;
if (FIOnumusedfios == -1) {
int i;
/* Initialize the usedfios struct the first time through */
for (i=0; i < FIOMAXOFILES; i++) {
FIOusedfios[i] = NULL;
}
FIOnumusedfios=0;
}
temp = FIOpopUsedfio();
if (temp == NULL) {
temp = (FileIO *) malloc(sizeof(FileIO));
temp->filename = STRnew();
} else {
STRinit(temp->filename);
}
temp->issocket = -1;
temp->pid = -1;
temp->fd = (pid_t) -1;
temp->buf = NULL;
temp->bufindex = -1;
temp->bufdatasize = -1;
temp->filename = STRnew();
return(temp);
}
/*
* Should only be called by FIOclose* functions really..
*/
void
FIOdestroy(FileIO *fio)
{
if (FIOpushUsedfio(fio)) {
/** No space in cache. **/
free(fio);
}
}
/*
* Open a file, initialize data structures.
*/
FileIO *
FIOopenUFS(char *fname, int flags, int mode)
{
int fd;
FileIO *fio;
struct stat buf;
if (fname == NULL)
return(NULL);
/* Okay, try and open up the file */
fd = open(fname, flags, mode );
if (fd < 0)
return(NULL); /* Couldn't open file */
if (fstat(fd, &buf)) {
close(fd);
return(NULL); /* Couldn't open anything */
}
fio = FIOnew();
FIOsetSocket(fio, FALSE);
FIOsetFilename(fio, fname);
FIOsetfd(fio,fd);
return(fio);
}
/*
* Start FIO routines on an already open file descriptor
*/
FileIO*
FIOopenfd(int fd, boolean issocket)
{
FileIO *fio;
fio = FIOnew();
FIOsetfd(fio, fd);
FIOsetSocket(fio, issocket);
return(fio);
}
FileIO*
FIOopenProcess(char *prog, char **args, char *rw)
{
int pfd[2];
int pid;
FileIO *fio;
if (prog == NULL)
return(NULL);
fio = FIOnew();
dup(0); /*** Arghh!! pipe doesn't work right when all fds are closed! */
if (pipe(pfd) < 0)
return(NULL);
switch (pid = vfork()) {
case -1: /* Error */
(void) close(pfd[0]);
(void) close(pfd[1]);
break;
case 0: /* Child */
if (rw == NULL || *rw == '\0') {
/** mimic system(), don't do anything **/
(void) close(pfd[0]);
(void) close(pfd[1]);
}
else if (*rw == 'r') {
if (pfd[1] != 1) {
dup2(pfd[1], 1);
(void) close(pfd[1]);
}
(void) close(pfd[0]);
} else {
if (pfd[0] != 0) {
dup2(pfd[0], 0);
(void) close(pfd[0]);
}
(void) close(pfd[1]);
}
#ifdef VMS
execv(prog, args);
#else
/** Unix **/
if (*prog == '/')
execv(prog, args);
else
execvp(prog, args); /* search the path for the command */
#endif
_exit(1);
}
/* parent.. */
if (rw == NULL || *rw == '\0') {
/** Don't do anything, mimic system() **/
FIOsetfd(fio, -1);
(void) close(pfd[0]);
(void) close(pfd[1]);
} else if (*rw == 'r') {
FIOsetfd(fio, pfd[0]);
(void) close(pfd[1]);
} else {
FIOsetfd(fio, pfd[1]);
(void) close(pfd[0]);
}
FIOsetPid(fio, pid);
FIOsetSocket(fio, FALSE);
return(fio);
}
/*
* Close a file/socket/process
*/
int
FIOclose(FileIO *fio)
{
int result;
if (fio == NULL)
return(0);
if (FIOgetPid(fio) >= 0) {
close(FIOgetfd(fio));
result = FIOwaitpid(fio);
FIOdestroy(fio);
return(result);
}
#ifdef MMAP_IO
/** Unmap memory mapped I/O stuff here.. **/
if (FIOgetFilename(fio) != NULL && fio->buf != NULL)
munmap(fio->buf, FIOgetBufDsize(fio));
#endif
result = FIOisSocket(fio) ? socket_close(FIOgetfd(fio)) :
close(FIOgetfd(fio));
FIOdestroy(fio);
return(result);
}
/*
* A portable waitpid fcn that returns the exit value of the child process
*
* Should be better about stopped and signaled processes....
*/
int
FIOwaitpid(FileIO *fio)
{
Portawait status;
pid_t result;
do {
errno = 0;
result = waitpid(FIOgetPid(fio), &status, 0);
} while (result != FIOgetPid(fio) && (errno == ECHILD));
return(Gwaitstatus(status) & 0xf);
}
/*
* write n bytes to an fd..
*
* returns -1 on error.
*/
int
FIOwriten(FileIO *fio, char *ptr, int nbytes)
{
int nleft, nwritten;
int fd = FIOgetfd(fio);
nleft = nbytes;
while(nleft > 0) {
nwritten = FIOisSocket(fio) ? socket_write(fd, ptr, nleft) :
write(fd, ptr, nleft);
if (nwritten <= 0)
return(nwritten); /* error */
nleft -= nwritten;
ptr += nwritten;
}
return(nbytes - nleft);
}
/*
* write a string to a FileDescriptor, eventually buffer outgoing input
*
* If write fails a -1 is returned. Otherwise zero is returned.
*/
int
FIOwritestring(FileIO *fio, char *str)
{
int length;
Debug("writing: %s\n",str);
if (str == NULL)
return(0);
length = strlen(str);
if (FIOwriten(fio, str, length) != length) {
Debugmsg("writestring: writen failed\n");
return(-1);
}
else
return(0);
}
#ifdef MMAP_IO
static int
FIOreadbuf_mmap(FileIO *fio, char *newbuf, int newbuflen)
{
struct stat buf;
char *bytes;
if (FIOgetFilename(fio) != NULL) {
/** Do MMAP IO if we can... **/
if (fio->buf == NULL) {
if (fstat(FIOgetfd(fio), &buf)) {
close(FIOgetfd(fio));
return(-1);
}
if (buf.st_size == 0)
return(0);
FIOsetBufDsize(fio, buf.st_size);
FIOsetBufIndex(fio, 0);
bytes = mmap(0, buf.st_size, PROT_READ,
MAP_SHARED | MAP_FILE,
FIOgetfd(fio), 0);
#ifdef HAVE_MADVISE
madvise(bytes, buf.st_size, MADV_SEQUENTIAL);
#endif
if (bytes == (caddr_t) -1)
return(-1);
fio->buf = bytes;
}
if (FIOgetBufIndex(fio) == -1)
return(0);
/** Okay, lets return some data... **/
if (FIOgetBufIndex(fio) >= FIOgetBufDsize(fio))
return(0);
if ((FIOgetBufIndex(fio) + newbuflen) > FIOgetBufDsize(fio)) {
newbuflen = FIOgetBufDsize(fio) - FIOgetBufIndex(fio);
}
memcpy(newbuf, fio->buf+FIOgetBufIndex(fio), newbuflen);
FIOsetBufIndex(fio, FIOgetBufIndex(fio) + newbuflen);
return(newbuflen);
}
/** This is an error condition **/
return(-1);
}
#endif
/*
* Read through a buffer, more efficient for character at a time
* processing. Not so good for block binary transfers
*/
int
FIOreadbuf(FileIO *fio, char *newbuf, int newbuflen)
{
int len;
int fd = FIOgetfd(fio);
char *recvbuf;
int bytesread = 0;
#ifdef MMAP_IO
if (FIOisMMAPable(fio)) {
return(FIOreadbuf_mmap(fio,newbuf, newbuflen));
}
#endif
if (FIOgetBufIndex(fio) == -1) {
if (fio->buf == NULL)
fio->buf = (char *) malloc(sizeof(char) * FIOBUFSIZE);
len = FIOisSocket(fio) ? socket_read(fd, fio->buf, FIOBUFSIZE) :
read(fd, fio->buf, FIOBUFSIZE);
#if defined(FIO_NOMULTIEOF)
if (len < 0 && errno == EPIPE) { /** EOF **/
FIOsetBufIndex(fio,-1);
return(0);
}
#endif
FIOsetBufDsize(fio, len);
FIOsetBufIndex(fio, 0);
if (len == 0) {
FIOsetBufIndex(fio,-1);
return(bytesread); /** EOF **/
}
}
recvbuf = fio->buf;
while (newbuflen--) {
*newbuf++ = recvbuf[FIOgetBufIndex(fio)++];
bytesread++;
if (FIOgetBufIndex(fio) == FIOgetBufDsize(fio) && newbuflen != 0) {
/** Read another buffer **/
len = FIOisSocket(fio) ? socket_read(fd, fio->buf, FIOBUFSIZE) :
read(fd, fio->buf, FIOBUFSIZE);
#if defined(FIO_NOMULTIEOF)
if (len < 0 && errno == EPIPE) { /** EOF **/
len = 0;
errno = 0;
}
#endif
if (len == 0) {
FIOsetBufIndex(fio,-1);
return(bytesread); /** EOF **/
}
if (len < 0)
return(len); /** Error **/
FIOsetBufDsize(fio, len);
FIOsetBufIndex(fio, 0);
} else if (FIOgetBufIndex(fio) >= FIOgetBufDsize(fio))
/* Read a new buffer next time through */
FIOsetBufIndex(fio, -1);
}
return(bytesread);
}
/* Read 'n' bytes from a descriptor, non buffered direct into the storage. */
int
FIOreadn(FileIO *fio, char *ptr, int nbytes)
{
int nleft, nread;
int fd = FIOgetfd(fio);
nleft = nbytes;
while (nleft > 0) {
nread = FIOisSocket(fio) ? socket_read(fd, ptr, nleft) :
read(fd, ptr, nleft);
#if defined(FIO_NOMULTIEOF)
if (nread < 0 && errno == EPIPE) { /** EOF **/
nread = 0;
errno = 0;
}
#endif
if (nread < 0)
return(nread); /* error, return < 0 */
else if (nread == 0) /* EOF */
break;
nleft -= nread;
ptr += nread;
}
return(nbytes - nleft);
}
/*
* Read a line from the file/socket, Read the line one byte at a time,
* looking for the newline. We store the newline in the buffer,
* then follow it with a null (the same as fgets(3)).
* We return the number of characters up to, but not including,
* the null (the same as strlen(3))
*/
int
FIOreadline(FileIO *fio, char *ptr, int maxlen)
{
int bytesread;
int rc;
char c;
for (bytesread=1; bytesread < maxlen; bytesread++) {
if ( (rc = FIOreadbuf(fio, &c, 1)) == 1) {
*ptr++ = c;
if (c == '\n')
break;
}
else if (rc == 0) {
if (bytesread == 1)
return(0); /* EOF, no data read */
else
break; /* EOF, some data was read */
}
else
return(rc); /* error */
}
*ptr = 0; /* Tack a NULL on the end */
Debug("FIOreadline: %s\n", (ptr-bytesread));
return(bytesread);
}
/*
* This does the same as readline, except that all newlines and
* carriage returns are automatically zapped.
*
* More efficient than doing a readline and a ZapCRLF
*/
int
FIOreadlinezap(FileIO *fio, char *ptr, int maxlen)
{
int len;
len = FIOreadtoken(fio, ptr, maxlen, '\n');
ptr += len;
ptr --;
if (len && *ptr == '\r') {
ptr[len] = '\0';
len--;
}
return(len);
}
/*
* Read a line from the file/socket, Read the line one byte at a time,
* looking for the token. We nuke the token from the returned string.
* We return the number of characters up to, but not including,
* the null (the same as strlen(3))
*/
int
FIOreadtoken(FileIO *fio, char *ptr, int maxlen, char zechar)
{
int bytesread;
int rc;
char c;
for (bytesread=1; bytesread < maxlen; bytesread++) {
rc = FIOreadbuf(fio, &c, 1);
if (rc == 1) {
*ptr++ = c;
if (c == zechar) {
*(ptr - 1) = '\0';
break;
}
}
else if (rc == 0) {
if (bytesread == 1)
return(0); /* EOF, no data read */
else
break; /* EOF, some data was read */
}
else
return(rc); /* error */
}
*ptr = 0; /* Tack a NULL on the end */
Debug("readtoken: %s\n", (ptr-bytesread));
return(bytesread);
}
static int
FIOexecv(char *prog, char **args)
{
FileIO *fio;
int result;
#ifdef VMS
int i = 0;
char buffer[1024];
/* DCL hog heaven */
strcpy(buffer, prog);
strcat(buffer, " ");
while (i++) {
if (args[i] == NULL)
break;
strcat(buffer, args[i]);
strcat(buffer, " ");
}
result = DCLsystem(buffer);
#else
fio = FIOopenProcess(prog, args, NULL);
result = FIOclose(fio);
#endif /* VMS */
return(result);
}
/*
* Do the minimal shell/dcl processing
*/
static char **
FIOgetargv(char *cmd)
{
int inquote = 0;
int insquote = 0;
int i;
static char *argv[256]; /* Sufficient for now.. */
int argc = 0;
char buf[256];
char *cp = buf;
if (cmd == NULL || strlen(cmd) >= 245)
return(NULL);
for (i=0; cmd[i] != '\0'; i++) {
switch (cmd[i]) {
case ' ': case '\t':
/* Separators */
if (insquote || inquote) {
*cp = cmd[i]; cp++;
break;
} else {
*cp = '\0';
argv[argc++] = strdup(buf);
cp = buf;
/** Get rid of any other whitespace **/
while (cmd[i+1] == ' ' || cmd[i+1] == '\t')
i++;
}
break;
case '"':
if (!insquote)
inquote = 1-inquote;
break;
case '\'':
if (!inquote)
insquote = 1-insquote;
break;
case '\\':
/* Quote next character if not in quotes */
if (insquote || inquote) {
*cp = cmd[i]; cp++;
} else {
*cp = cmd[i+1]; cp++; i++;
}
break;
default:
*cp = cmd[i]; cp++;
break;
}
}
if (buf != cp) {
*cp = '\0';
argv[argc++] = strdup(buf);
}
argv[argc] = NULL;
return(argv);
}
/*
* An emulation of the system() call without the shell
* returns the exit status of the child
*/
int
FIOsystem(char *cmd)
{
char **argv;
int result, i;
#ifdef VMS
return(DCLsystem(cmd));
#else
if (cmd == NULL || *cmd == '\0')
return(-1);
argv = FIOgetargv(cmd);
result = FIOexecv(argv[0], argv);
for (i=0; argv[i] != NULL; i++)
free(argv[i]);
return(result);
#endif
}
/*
* Similar to popen...
*/
FileIO
*FIOopenCmdline(char *cmd, char *rw)
{
char **argv;
FileIO *fio;
if (cmd == NULL)
return(NULL);
if (*cmd == '|')
cmd++;
argv = FIOgetargv(cmd);
fio = FIOopenProcess(argv[0], argv, rw);
return(fio);
}
gopher-3.0.15/object/fileio.h 0000664 0000000 0000000 00000012211 10762617110 012640 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.2 $
* $Date: 2000/12/20 01:19:20 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/fileio.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 92, 93, 94 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: fileio.h
* Abstration of socket/file input output routines.
*********************************************************************
* Revision History:
* $Log: fileio.h,v $
* Revision 1.2 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.16 1996/01/04 18:25:00 lindner
* Updates for autoconf
*
* Revision 3.15 1995/09/25 22:07:24 lindner
* Ansification
*
* Revision 3.14 1995/04/15 06:51:18 lindner
* Use interruptable_read
*
* Revision 3.13 1995/02/06 22:12:52 lindner
* Smaller max for fileio structs
*
* Revision 3.12 1994/10/18 21:39:06 lindner
* NeXT doesn't have mmap
*
* Revision 3.11 1994/09/29 19:54:24 lindner
* Add definition for Memory mapped I/O
*
* Revision 3.10 1994/08/19 16:29:37 lindner
* Add definition for memory mapped I/O
*
* Revision 3.9 1994/07/21 17:30:44 lindner
* Mods for Xenix
*
* Revision 3.8 1994/04/25 03:40:07 lindner
* VMS socket stuff still wasn't working..
*
* Revision 3.7 1994/04/22 06:42:02 lindner
* better compatibility checking
*
* Revision 3.6 1994/04/13 04:28:23 lindner
* add vms compatible.h
*
* Revision 3.5 1994/04/01 04:43:55 lindner
* fixes for VMS includes
*
* Revision 3.4 1994/03/17 04:36:32 lindner
* Fix for UCX
*
* Revision 3.3 1994/03/11 00:09:14 lindner
* Fix for UCX
*
* Revision 3.2 1994/03/08 03:21:18 lindner
* Mods for opening processes without sh
*
* Revision 3.1 1994/02/20 16:20:50 lindner
* New object based versions of buffered io routines
*
*
*********************************************************************/
#ifndef FILEIO_H
#define FILEIO_H
#include "STRstring.h"
#include "boolean.h"
#include "Stdlib.h"
#include "util.h"
#ifdef VMS
# include
# include
# include
#else
# ifdef M_XENIX
# include
# include
# include
# else
# include
# endif
#endif /* VMS */
#include "compatible.h"
struct fileio_struct
{
int bufindex;
int bufdatasize;
int bytepos;
char *buf;
boolean issocket;
String *filename;
int fd;
pid_t pid;
};
typedef struct fileio_struct FileIO;
#define FIOBUFSIZE 4096
#define FIOMAXOFILES 64
#define FIOisSocket(a) ((a)->issocket)
#define FIOgetPid(a) ((a)->pid)
#define FIOgetfd(a) ((a)->fd)
#define FIOgetFilename(a) (STRget((a)->filename))
#define FIOgetBufIndex(a) ((a)->bufindex)
#define FIOgetBufDsize(a) ((a)->bufdatasize)
#define FIOsetfd(a,b) ((a)->fd=(b))
#define FIOsetPid(a,b) ((a)->pid=(b))
#define FIOsetSocket(a,b) ((a)->issocket=(b))
#define FIOsetFilename(a,b) (STRset((a)->filename,(b)))
#define FIOsetBufIndex(a,b) ((a)->bufindex = (b))
#define FIOsetBufDsize(a,b) ((a)->bufdatasize = (b))
#define FIOisMMAPable(a) (FIOgetFilename(a) != NULL)
/*
* Optionally use BSD memory mapped I/O
*/
#if defined(HAVE_MMAP)
# define MMAP_IO
#endif
/*
* More elegant way of doing socket writes than ifdefs everywhere
*/
#if defined(VMS)
int DCLsystem(/* char */);
# define system(a) DCLsystem(a)
/** Note that Multinet already has socket_* **/
# if defined(WOLLONGONG) || defined(CMUIP) || defined(NETLIB)
# define socket_write netwrite
# define socket_read netread
# define socket_close netclose
# endif
# if defined(UCX)
# define socket_write write
# define socket_read read
# define socket_close close
# endif
/** Note that Wollongong is like Multinet for EPIPE handling **/
# if defined(UCX) || defined(CMUIP) || defined(NETLIB)
# define FIO_NOMULTIEOF
# endif
#else
/* Unix systems */
# define socket_write write
# define socket_read interruptable_read
# define socket_close close
#endif
/** Forward Declarations **/
FileIO *FIOopenUFS(char *fname, int flags, int mode);
FileIO *FIOopenfd(int fd, int issocket);
FileIO *FIOopenProcess(char *prog, char **args, char *rw);
FileIO *FIOopenCmdline(char *cmd, char *rw);
int FIOclose(FileIO *fio);
int FIOwriten(FileIO *fio, char *ptr, int nbytes);
int FIOwritestring(FileIO *, char *);
int FIOreadbuf(FileIO *fio, char *newbuf, int newbuflen);
int FIOreadn(FileIO *fio, char *ptr, int nbytes);
int FIOreadline(FileIO *fio, char *ptr, int maxlen);
int FIOreadlinezap(FileIO *fio, char *ptr, int maxlen);
int FIOreadtoken(FileIO *fio, char *ptr, int maxlen, char zechar);
int FIOwaitpid(FileIO *fio);
int FIOsystem(char *cmd);
void FIOdestroy(FileIO *fio);
#endif
gopher-3.0.15/object/DAarray.h 0000664 0000000 0000000 00000003325 10762617110 012722 0 ustar /********************************************************************
* lindner
* 3.1.1.1
* 1993/02/11 18:03:06
* /home/mudhoney/GopherSrc/CVS/gopher+/object/DAarray.h,v
* Exp
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: DAarray.h
* Dynamic Array Header file/abstraction
*********************************************************************
* Revision History:
* DAarray.h,v
* Revision 3.1.1.1 1993/02/11 18:03:06 lindner
* Gopher+1.2beta release
*
* Revision 1.2 1992/12/21 20:04:04 lindner
* Added DAcpy()
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef DAARRAY_H
#define DAARRAY_H
/*
* A dynamic array class
*/
struct da_struct {
char **objects; /** Should be void** perhaps */
int Top;
int maxsize;
char * (*newfn)();
void (*initfn)();
void (*destroyfn)();
char * (*copyfn)();
};
typedef struct da_struct DynArray;
#define DAgetEntry(a,b) (((a)->objects[b]))
#define DAgetTop(a) ((a)->Top)
#define DAsetTop(a,b) ((a)->Top=(b))
#define DAgetNumitems(a) ((a)->Top)
DynArray *DAnew();
void DAdestroy(DynArray *da);
void DAinit(DynArray *da);
void DApush(DynArray *da, char *obj);
char * DApop(DynArray *da);
void DAsort(DynArray *da, int (*sortfn)());
void DAgrow(DynArray *da, int size);
void DAsort(DynArray *da, int (*sortfn)());
void DAcpy(DynArray *dest, DynArray *orig);
#endif
gopher-3.0.15/object/RBTree.h 0000664 0000000 0000000 00000005213 10762617110 012520 0 ustar /**********************************************************************
* $Author: jgoerzen $
* $Revision: 1.1 $
* $Date: 2000/08/19 00:28:56 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/RBTree.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1995 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: RBTree.h
* Definition of a Red-Black balanced tree container.
*********************************************************************
* Revision History:
* $Log: RBTree.h,v $
* Revision 1.1 2000/08/19 00:28:56 jgoerzen
* Initial revision
*
* Revision 3.2 1995/10/31 16:48:21 lindner
* Better readability, fix bugs..
*
* Revision 3.1 1995/06/30 20:31:04 lindner
* New red-black tree code
*
**********************************************************************/
#include "boolean.h"
enum direction {LEFT, RIGHT, NOWHERE };
enum nodecolor {RED, BLACK};
typedef enum direction direction;
typedef enum nodecolor nodecolor;
struct RBTree_node_struct {
char *data;
struct RBTree_node_struct *l_child;
struct RBTree_node_struct *r_child;
nodecolor rb_right;
nodecolor rb_left;
direction last_pass;
};
typedef struct RBTree_node_struct RBTree_node;
#define RBTsetRBright(a,v) ((a)->rb_right=(v)) /* Sets ptr to black or Red */
#define RBTsetRBleft(a,v) ((a)->rb_left=(v))
#define RBTgetRBright(a) ((a)->rb_right)
#define RBTgetRBleft(a) ((a)->rb_left)
#define RBTgetDirection(a) ((a)->last_pass)
#define RBTsetDirection(a,v) ((a)->last_pass=(v))
#define RBTattachLeftNode(a,v) ((a)->l_child = (v))
#define RBTattachRightNode(a,v) ((a)->r_child = (v))
#define RBTgetRight(a) ((a)->r_child)
#define RBTgetLeft(a) ((a)->l_child)
#define RBTaddData(a,v) ((a)->data=(v))
#define RBTgetData(a) ((a)->data)
/**********************************************************************/
struct RBTree_struct {
RBTree_node *entry;
int (*cmpfn)();
void (*initfn)();
void (*destroyfn)();
char * (*copyfn)();
};
typedef struct RBTree_struct RBTree;
/*** For the top level tree structure ***/
#define RBTsetEntry(a,v) ((a)->entry = (v))
#define RBTgetEntry(a) ((a)->entry)
#define RBTcmp(a,b,c) ((a)->cmpfn(b,c))
#define RBTdestroyfcn(a,b) ((a)->destroyfn(RBTgetData(b)))
RBTree *RBTnew();
void RBTdestroy(RBTree *rbt);
void RBTtraverse(RBTree *rbt, void (*func)());
char *RBTfind(RBTree *rbt, char* data);
void RBTinsert(RBTree *rbt, char *data);
gopher-3.0.15/object/String.h 0000664 0000000 0000000 00000005565 10762617110 012655 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.4 $
* $Date: 2002/01/10 18:43:18 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/String.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: String.h
* Header file that automagically includes string/strings.h
*********************************************************************
* Revision History:
* $Log: String.h,v $
* Revision 1.4 2002/01/10 18:43:18 jgoerzen
* * Changes to work with Solaris:
* * configure.in: Now looks for strings.h and string.h
* * object/Regex.h: Now include re_comp.h if available.
* Include regex.h only if re_comp.h is unavailable.
* Define the SYSVREGEX stuff only if HAVE_RE_COMP_H is not defined
* * object/String.h: Include string.h and strings.h based on configure
* test.
*
* Revision 1.3 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.2.1 2000/12/18 23:04:29 mdallen
* removed nested comments from unused include
*
* Revision 1.2 2000/08/19 01:36:18 jgoerzen
* include more relevant header files.
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.8 1996/01/04 18:23:43 lindner
* Updates for autoconf
*
* Revision 3.7 1994/07/21 22:08:24 lindner
* include both string and strings on suns
*
* Revision 3.6 1994/06/29 06:38:27 lindner
* Remove extra include of string.h
*
* Revision 3.5 1994/04/07 17:26:46 lindner
* Fix for pyramids
*
* Revision 3.4 1994/03/08 04:03:52 lindner
* Fix for missing strdup forward declaration
*
* Revision 3.3 1993/06/15 06:09:50 lindner
* Fixes for multiple includes and prettification
*
* Revision 3.2 1993/05/05 18:39:49 lindner
* Solaris and VMS mods
*
* Revision 3.1.1.1 1993/02/11 18:03:04 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef GSTRINGS_H
#define GSTRINGS_H
/* string.h == Sys V & ANSI C
strings.h == BSD
Though your milage may vary...
*/
#if 0
#include "compatible.h" /* For strdup, etal */
#endif /* 0 */
#ifdef __convex__
# include
#endif
#ifdef HAVE_STRING_H
/* Define __USE_GNU for string.h so strcasestr gets included.
(also _GNU_SOURCE for other systems) */
#define __USE_GNU
#define _GNU_SOURCE
#include
#undef __USE_GNU
#undef _GNU_SOURCE
#endif
#ifdef HAVE_STRINGS_H
#include
#endif
#include
#include
#endif /* GSTRINGS_H */
gopher-3.0.15/object/url.c 0000664 0000000 0000000 00000021767 10762617110 012206 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.4 $
* $Date: 2002/03/19 16:57:41 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/url.c,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: url.c
* Simplified method of getting urls..
*********************************************************************
* Revision History:
* $Log: url.c,v $
* Revision 1.4 2002/03/19 16:57:41 jgoerzen
* Fixed type handling.
*
* Revision 1.3 2001/01/17 21:16:35 jgoerzen
* More psinrtf -> snprintf changes
*
* Revision 1.2 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.19 1995/10/31 16:53:57 lindner
* Small fix for ftp urls..
*
* Revision 3.18 1995/09/25 22:07:24 lindner
* Ansification
*
* Revision 3.17 1995/08/29 07:13:07 lindner
* Add tickets to urls
*
* Revision 3.16 1995/02/06 22:10:47 lindner
* Fix for systems without strstr, compiler casts
*
* Revision 3.15 1994/12/05 22:47:19 lindner
* Fixed settings of Gopher Type in URLparse()
*
* Revision 3.14 1994/11/18 22:45:55 lindner
* Remove unused variable
*
* Revision 3.13 1994/11/18 21:41:48 lindner
* Fix order of FTP arguments
*
* Revision 3.12 1994/11/13 06:30:06 lindner
* Expanded URL parsing routines
*
* Revision 3.11 1994/10/13 05:25:56 lindner
* Compiler complaint fixes
*
* Revision 3.10 1994/08/19 16:28:30 lindner
* More hexification of URL strings
*
* Revision 3.9 1994/07/25 03:51:41 lindner
* Compiler fix
*
* Revision 3.8 1994/07/21 22:17:20 lindner
* Add ftp urls
*
* Revision 3.7 1994/03/04 17:42:57 lindner
* Fixes from Alan Coopersmith
*
* Revision 3.6 1994/01/21 04:25:41 lindner
* Add support for tn3270 and better gopher url handling
*
* Revision 3.5 1993/12/30 04:18:08 lindner
* translate telnet url correctly
*
* Revision 3.4 1993/12/27 16:14:03 lindner
* Enlarge buffer size, make html docs on gopher server into http: refs
*
* Revision 3.3 1993/11/02 06:14:09 lindner
* Add url html hack
*
*
*********************************************************************/
#include "url.h"
#include "GSgopherobj.h"
#include "Malloc.h"
#include "String.h"
#include "compatible.h"
Url *
URLnew()
{
Url *temp;
temp = (Url *) malloc(sizeof(Url));
temp->url = STRnew();
temp->Host = STRnew();
temp->Port = -1;
temp->Path = STRnew();
temp->User = STRnew();
temp->Pass = STRnew();
temp->Gtype = '\0';
URLsetService(temp, unset);
return(temp);
}
void
URLdestroy(Url *url)
{
STRdestroy(url->url);
STRdestroy(url->Host);
STRdestroy(url->Path);
STRdestroy(url->User);
STRdestroy(url->Pass);
free(url);
}
/*
* Make a default url from the current Gopher Object...
*/
void
URLfromGS(Url *url, GopherObj *gs, char *ticket)
{
char u[2048], *path, *cp;
*u = '\0';
path = GSgetPath(gs);
if (GSgetHost(gs) == NULL)
return;
if ((GSgetType(gs) == A_TN3270) || (GSgetType(gs) == A_TELNET)) {
/* [telnet|tn3270]://[host]@[login]:[port] */
if (GSgetType(gs) == A_TELNET)
strcpy(u,"telnet://");
else
strcpy(u,"tn3270://");
Tohexstr(GSgetHost(gs), u + 9);
if ( (path != NULL) && (*path != '\0') ) {
cp = u + strlen(u);
*(cp++) = '@';
Tohexstr(path, cp);
}
snprintf(u + strlen(u),
sizeof(u) - strlen(u) - 1,
":%d", GSgetPort(gs));
}
else if (path != NULL)
{
if (strncmp(path, "GET /", 5) == 0) {
/* http://[host]:[port][path without "GET "] */
strcpy(u, "http://");
Tohexstr(GSgetHost(gs), u+7);
snprintf(u + strlen(u),
sizeof(u) - strlen(u) - 1,
":%d", GSgetPort(gs));
Tohexstr(path + 4, u + strlen(u));
} else if (strncmp(path, "ftp:", 4) == 0) {
/** ftp://[host]/[pathname]; **/
char *atsign;
if (path[4] == '/' && path [5] == '/') {
strcpy(u, path);
} else {
strcpy(u, "ftp://");
strcat(u, path + 4);
atsign = strchr(u, '@');
if (atsign != NULL)
Tohexstr( path + (atsign-u)-1, atsign );
}
} else {
/* gopher://[host]:[port]/[type][path] */
strcpy(u, "gopher://");
Tohexstr(GSgetHost(gs), u + 9);
snprintf(u + strlen(u),
sizeof(u) - strlen(u) - 1,
":%d/%c", GSgetPort(gs), GSgetType(gs));
if (ticket != NULL && strlen(ticket) > 0)
Tohexstr(ticket, u+strlen(u));
Tohexstr(path, u + strlen(u));
}
}
URLset(url, u);
}
/*
* Hack gopher directories into an HTML type...
*/
void
URLmakeHTML(Url *url)
{
char *cp = URLget(url);
if (cp == NULL)
return;
if (strncmp(cp, "gopher://", 9) != 0)
return;
/** find the type character **/
cp = strchr(cp+10, '/');
if (cp ==NULL)
return;
/** Test link for current host **/
/* host = cp+10;
if (strcasecmp(host, hostname) != 0)
return;*/
cp ++;
/** cp is now pointed at the type character **/
if (*cp == '1' && *(cp+1) == '1') {
/** It's a directory **/
*cp = 'h';
*(cp+1) = 'h';
}
}
/*
* Get the transport of the specified URL
*/
UrlServiceType
URLgetService(Url *url)
{
UrlServiceType st;
if (url->service == unset) {
char *urlcp;
urlcp = URLget(url);
if (urlcp == NULL)
return(unknown);
st = unknown;
if (strncasecmp("ftp:", urlcp, 4)==0)
st = ftp;
else if (strncasecmp(urlcp, "gopher:", 7)==0)
st = gopher;
else if (strncasecmp(urlcp, "telnet:", 7)==0)
st = telnet;
else if (strncasecmp(urlcp, "tn3270:", 7)==0)
st = tn3270;
else if (strncasecmp(urlcp, "http:", 5)==0)
st = http;
URLsetService(url, st);
}
return(url->service);
}
static boolean
URLparse(Url *url)
{
char *cp, *cp2, *cp3, *urlcp;
UrlServiceType serviceType;
serviceType = URLgetService(url);
if (serviceType == unknown)
return(FALSE);
urlcp = URLget(url);
if (urlcp == NULL)
return(FALSE);
urlcp = strdup(urlcp); /* This lets us scribble on the string */
cp = strstr(urlcp, "://"); /* skip over servicetype + "://" */
if (cp == NULL)
return(FALSE);
cp += 3;
cp3 = strchr(cp, '/'); /* end of login:passwd@host:port/ section */
if (cp3 == NULL) {
cp3 = cp + strlen(cp) + 1; /* No slash at the end... */
URLsetPath(url, "/");
} else {
Fromhexstr(cp3, cp3);
URLsetPath(url,cp3);
*(cp3++) = '\0'; /* trunc the host part, remove sep slash, now
cp3 points at the type. */
}
if (serviceType == gopher) {
if (cp3 != NULL && (int)strlen(cp3) > 1) {
URLsetGophType(url, *(cp3++));
URLsetPath(url,cp3++);
} else {
URLsetGophType(url, '1');
}
}
/*
* Find Username/pass for ftp/telnet
*/
cp2 = strchr(cp, '@');
if ((cp2 != NULL) && (cp2 < cp3)) {
char *pass;
*cp2 = '\0';
cp2++;
pass = strchr(cp, ':');
if ((pass != NULL) && (pass < cp3)) {
*pass = '\0';
pass++;
Fromhexstr(pass, pass);
URLsetPass(url, pass);
}
URLsetUser(url, cp);
cp = cp2; /** cp now points to hostname **/
}
/*
* Find port
*/
cp2 = strchr(cp, ':');
if ((cp2 != NULL) && (cp2 < cp3)) {
*cp2 = '\0';
cp2++;
URLsetPort(url, atoi(cp2));
URLsetHost(url, cp);
} else {
switch (serviceType) {
case http:
URLsetPort(url, 80);
break;
case telnet:
case tn3270:
URLsetPort(url, 23);
break;
case gopher:
URLsetPort(url, 70);
break;
case news:
URLsetPort(url, 119);
break;
case ftp:
case unset:
case unknown:
break;
}
URLsetHost(url, cp);
}
return(TRUE);
}
char *
URLgetHost(Url *url)
{
if (STRget(url->Host) == NULL)
URLparse(url);
return(STRget(url->Host));
}
int
URLgetPort(Url *url)
{
if (url->Port == -1)
URLparse(url);
return(url->Port);
}
char *
URLgetPath(Url *url)
{
if (STRget(url->Path) == NULL)
URLparse(url);
return(STRget(url->Path));
}
char *
URLgetUser(Url *url)
{
if (STRget(url->User) == NULL)
URLparse(url);
return(STRget(url->User));
}
char *
URLgetPass(Url *url)
{
if (STRget(url->Pass) == NULL)
URLparse(url);
return(STRget(url->Pass));
}
char
URLgetGophType(Url *url)
{
if (URLgetService(url) != gopher)
return('\0');
if (url->Gtype == '\0')
URLparse(url);
return(url->Gtype);
}
gopher-3.0.15/object/url.h 0000664 0000000 0000000 00000005071 10762617110 012201 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.2 $
* $Date: 2000/12/20 01:19:20 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/url.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: url.h
* Simplified method of getting urls..
*********************************************************************
* Revision History:
* $Log: url.h,v $
* Revision 1.2 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.5 1995/09/25 22:07:25 lindner
* Ansification
*
* Revision 3.4 1995/08/29 07:13:07 lindner
* Add tickets to urls
*
* Revision 3.3 1994/11/13 06:30:12 lindner
* Expanded URL parsing routines
*
* Revision 3.2 1993/11/02 06:14:11 lindner
* Add url html hack
*
*********************************************************************/
#ifndef URL_H
#define URL_H
#include "STRstring.h"
#include "util.h"
typedef enum {gopher, http, ftp, telnet, tn3270, news, unset,unknown}
UrlServiceType;
struct url_struct {
String* url;
UrlServiceType service;
String* Host;
int Port;
String* Path;
String* User;
String* Pass;
/** Gopher specific information **/
char Gtype;
};
typedef struct url_struct Url;
#define URLget(a) (STRget((a)->url))
#define URLset(a,b) (STRset((a)->url,(b)))
#define URLsetGophType(a,b) ((a)->Gtype=(b))
#define URLsetPort(a,b) ((a)->Port=(b))
#define URLsetPath(a,b) (STRset((a)->Path, (b)))
#define URLsetHost(a,b) (STRset((a)->Host, (b)))
#define URLsetUser(a,b) (STRset((a)->User, (b)))
#define URLsetPass(a,b) (STRset((a)->Pass, (b)))
#define URLsetService(a,b) ((a)->service=(b))
#include "GSgopherobj.h"
UrlServiceType URLgetService();
Url *URLnew();
void URLdestroy();
void URLfromGS(Url *url, GopherObj *gs, char *ticket);
void URLmakeHTML(Url *url);
char *URLgetTransport(Url *url);
char *URLgetHost(Url *url);
int URLgetPort(Url *url);
char URLgetGophType(Url *url);
char *URLgetPath(Url *url);
char *URLgetHost(Url *url);
int URLgetPort(Url *url);
char *URLgetUser(Url *url);
char *URLgetPass(Url *url);
#endif /* URL_H */
gopher-3.0.15/object/Makefile.in 0000664 0000000 0000000 00000003453 10762617110 013275 0 ustar srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
include ../Makefile.config
CCFLAGS = $(OPT) @CFLAGS@ $(INTLOPTS) $(DEBUGGING) $(WAISTYPE) $(SOCKSFLAGS) -I.. -I$(srcdir) -I$(top_srcdir)
OBJS = STRstring.o GDgopherdir.o GSgopherobj.o \
DAarray.o VIews.o BLblock.o \
Sockets.o util.o compatible.o \
url.o Debug.o Regex.o \
fileio.o Locale.o RBTree.o
TARGET = libgopher.a libgopher.so.0.1
all: shared $(TARGET)
#
# Make shared library directories
#
shared:
@-if [ -f /lib/ld.so -a "$(SHAREDLIB)" = "sun" ]; \
then \
mkdir shared-sun; \
fi
touch shared
.c.o: $(OBJS)
@CC@ $(CCFLAGS) $(PIC) -c $<
@-if [ -d shared-sun ]; then \
echo "Building shared version of $@"; \
@CC@ $(CCFLAGS) -fPIC -o shared-sun/$@ -c $<; \
fi
#
# Stuff for shared libraries
#
libgopher.so.0.1: $(OBJS)
@-if [ -d shared-sun ]; then \
echo "Building shared library $@"; \
cd shared-sun; \
rm -f $@; \
ld -o $@ -assert pure-text $(OBJS);\
mv $@ ..; \
fi
libgopher.sa.0.1: $(OBJS)
;
libgopher.a: $(OBJS)
rm -f libgopher.a
ar rcv libgopher.a $(OBJS)
@RANLIB@ libgopher.a || true
clean:
-rm -f $(TARGET) $(OBJS) *.out *~ core TAGS \
*.sa.* shared
-rm -rf shared-sun
GSgopherobj.o: $(srcdir)/GSgopherobj.h
Locale.o: $(srcdir)/Locale.h $(srcdir)/Locale.c
@CC@ $(CCFLAGS) $(PIC) -DLOCALEDIR=\"$(CLIENTLIB)/gophernls\" -c $(srcdir)/Locale.c
@-if [ -d shared-sun ]; then \
echo "Building shared version of $@"; \
@CC@ $(CCFLAGS) -DLOCALEDIR=\"$(CLIENTLIB)/gophernls\" \
-fPIC -o shared-sun/$@ -c $(srcdir)/Locale.c; \
fi
#
#install shared libraries if need be..
#
install:
@-if [ -f *.so.* ]; then \
echo "Installing Sun shared gopher library" ;\
@INSTALL@ libgopher.so.0.1 $(CLIENTLIB); \
@INSTALL@ libgopher.a $(CLIENTLIB); \
fi
gopher-3.0.15/object/STAarray.h 0000664 0000000 0000000 00000003565 10762617110 013073 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.1 $
* $Date: 2000/08/19 00:28:56 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/STAarray.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: STAarray.h
* Header file, abstraction of a dynamic Strings array.
*********************************************************************
* Revision History:
* $Log: STAarray.h,v $
* Revision 1.1 2000/08/19 00:28:56 jgoerzen
* Initial revision
*
* Revision 3.4 1995/09/26 05:16:32 lindner
* more fixes...
*
* Revision 3.3 1993/07/27 00:30:13 lindner
* plus patch from Mitra
*
* Revision 3.2 1993/03/26 19:51:05 lindner
* Added STApop
*
* Revision 3.1.1.1 1993/02/11 18:03:07 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1993/01/31 00:34:40 lindner
* Initial revision
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef STAARRAY_H
#define STAARRAY_H
#include "STRstring.h"
#include "DAarray.h"
typedef DynArray StrArray;
#define STAnew(a) (DAnew((a),STRnew,STRinit,STRdestroy,STRcpy))
#define STAinit(a) (DAinit((a)))
#define STAgetTop(a) (DAgetTop(a))
#define STAgetEntry(a,b) (String*)(DAgetEntry(a,b))
/* Some places use STAgetEntry and then pretend they got a char* back)*/
#define STAgetText(a,b) (char*)(STRget(STAgetEntry(a,b)))
#define STApush(a,b) (DApush((DynArray*)(a),(char*)(b)))
#define STApop(a) (String*)(DApop(a))
#define STAdestroy(a) (DAdestroy(a))
#define STAcpy(a,b) (DAcpy(a,b))
#endif
gopher-3.0.15/object/RBTree.c 0000664 0000000 0000000 00000026634 10762617110 012525 0 ustar /**********************************************************************
* $Author: jgoerzen $
* $Revision: 1.2 $
* $Date: 2001/01/17 21:48:05 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/RBTree.c,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1995 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: RBTree.c
* Implementation of a Red-Black balanced tree container.
*********************************************************************
* Revision History:
* $Log: RBTree.c,v $
* Revision 1.2 2001/01/17 21:48:05 jgoerzen
* Many fixes and tune-ups. Now compiles cleanly with -Wall -Werror!
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.3 1995/10/31 16:48:21 lindner
* Better readability, fix bugs..
*
* Revision 3.2 1995/09/25 22:07:19 lindner
* Ansification
*
* Revision 3.1 1995/06/30 20:31:04 lindner
* New red-black tree code
*
**********************************************************************/
#include "RBTree.h"
#include "Malloc.h"
RBTree *mytree;
void printit();
/***********************************************************************
* Prototypes
*/
static void
RBTleft_right(RBTree *thetree,
RBTree_node *child,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent);
static void
RBTright_left(RBTree *thetree,
RBTree_node *child,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent);
static void
RBTright_right(RBTree *thetree,
RBTree_node * parent,
RBTree_node * grandparent,
RBTree_node * great_grandparent);
static void
RBTleft_left(RBTree *thetree,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent);
/**********************************************************************/
RBTree_node
*RBTNnew(void)
{
RBTree_node *temp;
temp = (RBTree_node*) malloc(sizeof(RBTree_node));
RBTsetDirection(temp, NOWHERE);
RBTsetRBright(temp, BLACK);
RBTsetRBleft(temp, BLACK);
RBTattachLeftNode(temp, NULL);
RBTattachRightNode(temp, NULL);
return(temp);
}
void
RBTdestroy_node(RBTree *thetree, RBTree_node *rbt_node)
{
if (rbt_node != NULL) {
RBTdestroy_node(thetree, RBTgetLeft(rbt_node));
RBTdestroy_node(thetree, RBTgetRight(rbt_node));
RBTdestroyfcn(thetree, rbt_node);
free(rbt_node);
}
}
static void
RBTred_sibling_ck(RBTree_node* child, RBTree_node * parent)
{
if ((RBTgetRBright(child) == RED) && (RBTgetRBleft(child) == RED))
{
/* if two red siblings change to black */
RBTsetRBright(child, BLACK);
RBTsetRBleft(child, BLACK);
/* if parent exists, change to red */
if (parent != NULL) {
if (RBTgetDirection(parent) == LEFT)
RBTsetRBleft(parent, RED);
else
RBTsetRBright(parent, RED);
}
}
}
/**********************************************************************/
static int
RBTbalance(RBTree *thetree,
RBTree_node *child,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent)
{
if (grandparent != NULL) { /* must have tree nodes to need rebalance*/
if (RBTgetDirection(parent) == LEFT) {
if (RBTgetRBleft(parent) == RED) {
if (RBTgetDirection(grandparent) == LEFT) {
if (RBTgetRBleft(grandparent) == RED) {
RBTleft_left(thetree, parent, grandparent,
great_grandparent);
return(TRUE);
}
} else {
if (RBTgetRBright(grandparent) == RED) {
RBTright_left(thetree, child, parent,
grandparent, great_grandparent);
return(TRUE);
}
}
}
} else if (RBTgetRBright(parent) == RED) {
if (RBTgetDirection(grandparent) == LEFT) {
if (RBTgetRBleft(grandparent) == RED) {
RBTleft_right(thetree, child, parent, grandparent,
great_grandparent);
return(TRUE);
}
} else {
if (RBTgetRBright(grandparent) == RED) {
RBTright_right(thetree, parent, grandparent,
great_grandparent);
return(TRUE);
}
}
}
}
return(FALSE);
}
/**********************************************************************/
static void
RBTleft_right(RBTree *thetree,
RBTree_node *child,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent)
{
RBTree_node *temp[2];
#ifdef RBT_TEST
printf("left_right called\n");
#endif
if (great_grandparent != NULL )
if (RBTgetDirection(great_grandparent) == RIGHT)
RBTattachRightNode(great_grandparent, child);
else
RBTattachLeftNode(great_grandparent, child);
else
RBTsetEntry(thetree, child);
temp[0] = RBTgetLeft(child);
temp[1] = RBTgetRight(child);
RBTattachLeftNode(grandparent, temp[1]);
RBTattachRightNode(parent, temp[0]);
RBTattachRightNode(child, grandparent);
RBTattachLeftNode(child, parent);
/* reset red_black fields */
RBTsetRBleft(grandparent, BLACK);
RBTsetRBright(parent, BLACK);
RBTsetRBleft(child, RED);
RBTsetRBright(child, RED);
}
/**********************************************************************/
static void
RBTright_left(RBTree *thetree,
RBTree_node *child,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent)
{
RBTree_node *temp[2];
#ifdef RBT_TEST
printf("right_left called\n");
#endif
if (great_grandparent != NULL )
if (RBTgetDirection(great_grandparent) == RIGHT)
RBTattachRightNode(great_grandparent, child);
else
RBTattachLeftNode(great_grandparent, child);
else
RBTsetEntry(thetree, child);
temp[0] = RBTgetLeft(child);
temp[1] = RBTgetRight(child);
RBTattachRightNode(grandparent, temp[0]);
RBTattachLeftNode(parent, temp[1]);
RBTattachLeftNode(child, grandparent);
RBTattachRightNode(child, parent);
/* reset red_black fields */
RBTsetRBright(grandparent, BLACK);
RBTsetRBleft(parent, BLACK);
RBTsetRBright(child, RED);
RBTsetRBleft(child, RED);
}
/**********************************************************************/
static void
RBTright_right(RBTree *thetree,
RBTree_node * parent,
RBTree_node * grandparent,
RBTree_node * great_grandparent)
{
RBTree_node *temp;
#ifdef RBT_TEST
printf("right_right called\n");
#endif
if (great_grandparent != NULL) {
if (RBTgetDirection(great_grandparent) == RIGHT)
RBTattachRightNode(great_grandparent, parent);
else
RBTattachLeftNode(great_grandparent, parent);
}
else
RBTsetEntry(thetree, parent);
temp = RBTgetLeft(parent);
RBTattachRightNode(grandparent, temp);
RBTattachLeftNode(parent, grandparent);
/* reset red_black fields appropriately */
RBTsetRBright(grandparent, BLACK);
RBTsetRBleft(parent, RED);
}
/**********************************************************************/
static void
RBTleft_left(RBTree *thetree,
RBTree_node *parent,
RBTree_node *grandparent,
RBTree_node *great_grandparent)
{
RBTree_node *temp;
#ifdef RBT_TEST
printf("left_left called\n");
#endif
if (great_grandparent != NULL)
RBTattachLeftNode(great_grandparent, parent);
else
RBTsetEntry(thetree, parent);
temp = RBTgetRight(parent);
RBTattachLeftNode(grandparent, temp);
RBTattachRightNode(parent, grandparent);
RBTsetRBleft(grandparent, BLACK);/* reset rb fields */
RBTsetRBright(parent, RED);
}
/**********************************************************************/
void
RBTinsert(RBTree *thetree, char *data)
{
RBTree_node *data_node ;
RBTree_node *local_root ;
RBTree_node *current ;
RBTree_node *parent = NULL;
RBTree_node *grandparent = NULL;
RBTree_node *great_grandparent = NULL ;
boolean balanced=FALSE;
data_node = RBTNnew(); /* create and initialize new node*/
RBTaddData(data_node, data);
local_root = RBTgetEntry(thetree);
if (local_root == NULL) { /* start a new tree */
RBTsetEntry(thetree, data_node);
return;
}
current = local_root; /* get ready to insert new node*/
while (current != NULL) {
/* check for two red siblings*/
RBTred_sibling_ck(current,parent);
if (!balanced) { /* only one rebalance per insertion*/
balanced = RBTbalance(thetree, current, parent,
grandparent, great_grandparent);
if (balanced == 0) {
/* if we haven't rebalanced update grandparent
* and great grand parent. ie if rebalancing have been
* done, all of these local ptrs execpt current are
* invalid.
*/
great_grandparent=grandparent;
grandparent=parent;
}
}
parent=current;
if (RBTcmp(thetree, RBTgetData(current), data) > 0) {
/* mark where we're moving and go left */
RBTsetDirection(current, LEFT);
current = RBTgetLeft(current);
} else {
/* mark where we're moving and go right */
RBTsetDirection(current, RIGHT);
current = RBTgetRight(current);
}
}
if (RBTgetDirection(parent) == LEFT) {
RBTattachLeftNode(parent, data_node);
RBTsetRBleft(parent, RED);
} else {
RBTattachRightNode(parent, data_node);
RBTsetRBright(parent, RED);
}
}
/**********************************************************************
* Functions for the top level tree structure...
*/
RBTree *
RBTnew(int (*cmpfunc)(), void (*destroyfn)())
{
RBTree *temp;
temp = (RBTree*) malloc(sizeof(RBTree));
if (temp == NULL)
return(NULL);
temp->cmpfn = cmpfunc;
temp->destroyfn = destroyfn;
temp->entry = NULL;
return(temp);
}
void
RBTdestroy(RBTree *rbt)
{
RBTdestroy_node(rbt, RBTgetEntry(rbt));
free(rbt);
}
static void
RBTinorder(RBTree_node *node, void (*func)())
{
if (node != NULL) {
RBTinorder(RBTgetLeft(node), func);
func(RBTgetData(node));
RBTinorder(RBTgetRight(node), func);
}
}
void
RBTtraverse(RBTree *rbt, void (*func)())
{
RBTinorder(RBTgetEntry(rbt), func);
}
char *
RBTfind(RBTree *rbt, char *data)
{
RBTree_node *rbt_node = RBTgetEntry(rbt);
int whichway;
while ((whichway = RBTcmp(rbt, data, RBTgetData(rbt_node))) != 0) {
if (whichway < 0)
rbt_node = RBTgetLeft(rbt_node);
else
rbt_node = RBTgetRight(rbt_node);
if (rbt_node == NULL)
return(NULL);
}
return(RBTgetData(rbt_node));
}
/**********************************************************************
* Test code below here....
*/
#ifdef RBT_TEST
#include
#include
static int count = 0;
void
printit(char *data)
{
printf("%s", data);
}
void
main()
{
FILE *foo;
char myline[256];
char *moo;
mytree = RBTnew(strcmp, free);
foo = fopen("testfile", "r");
while(fgets(myline, sizeof(myline), foo)) {
RBTinsert(mytree, strdup(myline));
/* RBTtraverse(mytree, printit);*/
}
/** Find an item **/
moo = RBTfind(mytree, "butterfly\n");
if (moo)
printf("Found %s\n", moo);
else
printf("Didn't find butterfly...\n");
RBTtraverse(mytree, printit);
RBTdestroy(mytree);
}
#endif
gopher-3.0.15/object/GDgopherdir.c 0000664 0000000 0000000 00000033146 10762617110 013574 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.1 $
* $Date: 2000/08/19 00:28:56 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/GDgopherdir.c,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: GDgopherdir.c
* Implement gopher directory routines
*********************************************************************
* Revision History:
* $Log: GDgopherdir.c,v $
* Revision 1.1 2000/08/19 00:28:56 jgoerzen
* Initial revision
*
* Revision 3.38 1996/01/04 18:26:51 lindner
* Updates for autoconf
*
* Revision 3.37 1995/10/31 16:47:47 lindner
* Switch to void+ pointer
*
* Revision 3.36 1995/09/26 05:16:32 lindner
* more fixes...
*
* Revision 3.35 1995/09/25 22:07:16 lindner
* Ansification
*
* Revision 3.34 1995/04/15 07:07:38 lindner
* Add ControlC handling feature...
*
* Revision 3.33 1995/02/17 18:34:09 lindner
* Fix stupid bug
*
* Revision 3.32 1995/02/16 22:32:43 lindner
* HTML icon support
*
* Revision 3.31 1995/02/13 19:09:25 lindner
* Fix for link updating
*
* Revision 3.30 1995/02/06 22:11:26 lindner
* Fix for GDsearch comparision
*
* Revision 3.29 1995/02/01 22:06:22 lindner
* Put back GDaddGSmerge, ugh.
*
* Revision 3.27 1994/10/18 21:36:34 lindner
* Remove unused variable
*
* Revision 3.26 1994/07/21 22:29:00 lindner
* misc hacks
*
* Revision 3.25 1994/07/06 03:01:30 lindner
* VMS doesn't have strcoll
*
* Revision 3.24 1994/06/29 06:47:51 lindner
* Use strcoll to sort if GINTERNATIONAL is defined
*
* Revision 3.23 1994/06/29 05:45:54 lindner
* Mods to pump tickets to the net
*
* Revision 3.22 1994/04/27 19:21:37 lindner
* Fix for semicolons after Debugmsg
*
* Revision 3.21 1994/04/25 03:36:56 lindner
* Modifications for Debug() and mismatched NULL arguments, added Debugmsg
*
* Revision 3.20 1994/04/21 21:24:57 lindner
* Fix fcn header
*
* Revision 3.19 1994/04/19 14:32:27 lindner
* Change GD and GSfromLink routines to use FIO
*
* Revision 3.18 1994/04/13 04:28:58 lindner
* Fix for Type=X items
*
* Revision 3.17 1994/02/20 16:28:19 lindner
* Remove dead code for GDtoNetHTML
*
* Revision 3.16 1994/01/10 03:27:28 lindner
* Better GDdeleteGS method, allow ignoring of items by doing a Type=X in a .names file
*
* Revision 3.15 1993/11/29 01:07:57 lindner
* In GDtoLink(), add FALSE argument to GStoLink() call in order to prevent
* the Admin and ModDate information from being saved in the user bookmark
* file. (Macrides)
*
* Revision 3.14 1993/11/02 06:15:15 lindner
* HTML additions
*
* Revision 3.13 1993/08/23 20:56:34 lindner
* Fix for empty directory in g+ client
*
* Revision 3.12 1993/08/19 20:51:33 lindner
* Mitra comments
*
* Revision 3.11 1993/08/19 20:24:04 lindner
* Mitra's Debug patch
*
* Revision 3.10 1993/07/29 20:02:16 lindner
* Removed dead variables
*
* Revision 3.9 1993/07/27 05:30:22 lindner
* Mondo Debug overhaul from Mitra
*
* Revision 3.8 1993/07/27 00:30:08 lindner
* plus patch from Mitra
*
* Revision 3.7 1993/07/14 20:37:08 lindner
* Negative numbering patches
*
* Revision 3.6 1993/06/22 06:07:17 lindner
* Added Domain= hacks..
*
* Revision 3.5 1993/04/15 21:35:12 lindner
* Debug code, better .Link processing, better GDfromNet()
*
* Revision 3.4 1993/03/26 19:50:44 lindner
* Mitra fixes for better/clearer fromNet code
*
* Revision 3.3 1993/03/24 17:04:49 lindner
* bad strcmp() can check unmalloced() mem, fixed
*
* Revision 3.2 1993/03/18 22:13:29 lindner
* filtering, compression fixes
*
* Revision 3.1 1993/02/11 18:03:01 lindner
* Initial revision
*
* Revision 2.1 1993/02/09 22:46:50 lindner
* Many additions for gopher+
*
* Revision 1.4 1993/01/31 00:22:51 lindner
* Changed GDaddGS to merge entries with the same path.
* Added GDplusfromNet() to siphon data from network.
* GDfromLink now knows about ~/ inside of Path=
* Changed GDSearch to ignore leading character.
*
* Revision 1.3 1992/12/19 04:44:09 lindner
* Added GDplustoNet()
*
* Revision 1.2 1992/12/16 20:37:04 lindner
* Added function GDsearch(), does a linear search of a gopher directory
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#include
#include "GDgopherdir.h"
#include "Malloc.h"
#include "util.h"
#include "String.h"
#include "fileio.h"
#include "Debug.h"
#include "fileio.h"
/***********************************************************************
** Stuff for GopherDirObjs
**
***********************************************************************/
GopherDirObj*
GDnew(int size)
{
GopherDirObj *temp;
temp = (GopherDirObj*) malloc(sizeof(GopherDirObj));
temp->Gophers = DAnew(size, GSnew, GSinit, GSdestroy, GScpy);
temp->Title = STRnew();
temp->Location = NULL;
temp->currentitem = 1;
GDinit(temp);
return(temp);
}
void
GDdestroy(GopherDirObj *gd)
{
DAdestroy(gd->Gophers);
if (gd->Location != NULL)
GSdestroy(gd->Location);
STRdestroy(gd->Title);
free(gd);
}
void
GDinit(GopherDirObj *gd)
{
DAinit(gd->Gophers);
STRinit(gd->Title);
gd->Location = NULL;
}
void
GDsetLocation(GopherDirObj *gd, GopherObj *gs)
{
if (gd->Location == NULL)
gd->Location = GSnew();
else
GSinit(gd->Location);
GScpy(gd->Location, gs);
}
/** This proc adds a GopherObj to a gopherdir.
It will attempt to merge two items if need be..
**/
void
GDaddGSmerge(GopherDirObj *gd, GopherObj *gs)
{
int num;
num = GDSearch(gd, GSgetPath(gs));
if (num == -1)
GDaddGS(gd, gs);
else {
if (GSgetType(gs) == 'X') {
gd = GDdeleteGS(gd, num);
} else
GSmerge(GDgetEntry(gd, num),gs);
}
}
/*
* This one never tries to merge
*/
void
GDaddGS(GopherDirObj *gd, GopherObj *gs)
{
if (GSgetType(gs) != 'X')
DApush(gd->Gophers, (char*)gs);
}
/*
* Really weird!!! We need this for qsort, don't know why we can't use
* GScmp...
*/
#define sgn(a) ((a) == 0 ? 0 : (a) < 0 ? -1 : 1)
static int
GSqsortcmp(GopherObj **gs1, GopherObj **gs2)
{
if (GSgetTitle(*gs1) == NULL)
return(1);
if (GSgetTitle(*gs2) == NULL)
return(-1);
/** No numbering set on either entry, or both numbered
entries have the same number **/
if (GSgetNum(*gs1) == GSgetNum(*gs2))
return(strcoll(GSgetTitle(*gs1), GSgetTitle(*gs2)));
/** If the signs are equal, compare the numbers conventionally **/
/** N.B. If the signs ARE equal, they cannot be 0 (otherwise we would **/
/** have had the above case, because only the sign of 0 is 0) */
if (sgn(GSgetNum(*gs1)) == sgn(GSgetNum(*gs2)))
return(GSgetNum(*gs1) < GSgetNum(*gs2) ? -1 : 1);
/** The signs must be different, so we can use a conventional test, **/
/** remembering only to say positive numbers go before negative ones **/
return(GSgetNum(*gs1) > GSgetNum(*gs2) ? -1 : 1);
}
/*
* Sorts a gopher directory
*/
void
GDsort(GopherDirObj *gd)
{
DAsort(gd->Gophers, GSqsortcmp);
}
void
GDtoNet(GopherDirObj *gd, int sockfd, GSformat fmt, char *ticket,
void (*prefcn)())
{
int i;
GopherObj *gs;
Debugmsg("GDplustoNet\n");
if (fmt == GSFORM_HTML) {
writestring(sockfd, "
\r\n");
}
for (i=0; i< GDgetNumitems(gd); i++) {
gs = GDgetEntry(gd, i);
if (fmt == GSFORM_HTML)
writestring(sockfd, "
");
if (prefcn)
prefcn(gs, sockfd);
GStoNet(GDgetEntry(gd, i), sockfd, fmt, ticket);
}
if (fmt == GSFORM_HTML) {
writestring(sockfd, "
\r\n");
}
}
void
GDplustoNet(GopherDirObj *gd, int sockfd, char **filter, char *ticket)
{
int i;
for (i=0; i< GDgetNumitems(gd); i++) {
GSplustoNet(GDgetEntry(gd, i), sockfd,filter, ticket);
}
}
/*
* Gopher+ counterpart to GDfromNet()
* returns number of items found
*/
int
GDplusfromNet(GopherDirObj *gd, int fd, int (*eachitem)())
{
static GopherObj *TempGopher = NULL;
int j, result;
char inputline[256];
Debugmsg("GDplusfromNet:: start\r\n");
if (TempGopher == NULL)
TempGopher = GSnew();
/** State: _begin_ **/
result = readrecvbuf(fd, inputline, 1);
if (result <=0)
return(0);
else if (*inputline == '.') {
/*** Read off the rest of the junk... ***/
readline(fd,inputline,sizeof(inputline));
return(0);
}
else if (*inputline != '+')
return(0);
Debugmsg("after readrecvbuf");
/** State _FirstPlus_ **/
result = readtoken(fd, inputline, sizeof(inputline), ':');
if (result <=0)
return(result);
Debugmsg("after readtoken");
if (strcmp(inputline, "INFO")!=0) {
return(0);
}
Debugmsg("after INFO");
/** Read the space **/
if (readrecvbuf(fd, inputline, 1) <=0)
return(HARDERROR);
/*** State _FirstINFO_ ***/
for (j=0; !ControlCpressed ; j++) {
Debugmsg("for start");
GSinit(TempGopher);
result = GSplusfromNet(TempGopher, fd);
switch (result) {
case MORECOMING:
GDaddGS(gd, TempGopher);
if (eachitem != NULL)
eachitem();
break;
case FOUNDEOF:
GDaddGS(gd, TempGopher);
return(j+1);
case HARDERROR: /** Give up reading - bad read or protocol error **/
return(j);
case SOFTERROR: /** This one was bad, but we can try for next **/
j= j-1;
if (j<0) j=0;
break;
}
} /* for */
/** only get here if Control C pressed **/
ControlCpressed = FALSE;
return(j);
}
/*
* Fill up a GopherDirObj with GopherObjs, given a gopher directory coming
* from sockfd.
*
* For each GopherObj retrieved, eachitem() is executed.
*
*/
void
GDfromNet(GopherDirObj *gd, int sockfd, int (*eachitem)())
{
static GopherObj *TempGopher;
int i;
char *cp1, *cp2;
Debugmsg("GDfromNet...");
if (TempGopher == NULL)
TempGopher = GSnew();
for (; !ControlCpressed ;) {
GSinit(TempGopher);
i = GSfromNet(TempGopher, sockfd);
/* In gopher+1.2b2 this routine clears up if GSfromNet returns
a failure, better to clear up in GSfromNet so that the
system returns in a known state - note that other callers of
GSfromNet didn't clean up and crashed! */
switch (i) {
case 0:
if (GSgetType(TempGopher) == '3' &&
((cp1 = GSgetTitle(TempGopher)) != NULL) &&
((cp2 = strchr(cp1, '\n')) != NULL)) {
GopherObj *TempG2;
do {
TempG2 = GSnew();
GScpy(TempG2, TempGopher);
GSsetType(TempG2, A_INFO);
GSsetTitle(TempG2, cp2+1);
*cp2 = '\0';
GSsetTitle(TempGopher, cp1);
GDaddGS(gd, TempGopher);
TempGopher = TempG2;
if ((cp1 = GSgetTitle(TempGopher)) == NULL)
break;
} while ((cp2 = strchr(cp1, '\n')) != NULL);
}
GDaddGS(gd, TempGopher);
if (eachitem != NULL) eachitem();
break;
case 1: /* . on a line by itself, nothing more */
return;
case SOFTERROR: /** Unknown object type **/
break;
case HARDERROR:
return;
}
}/* for */
if (ControlCpressed) {
ControlCpressed = FALSE;
}
}
/*
* Given an open file descriptor and an inited GopherDirobj,
* read in gopher links, and add them to a gopherdir
*/
void
GDfromLink(GopherDirObj *gd, FileIO *fio, char *host, int port,
char *directory, char *peer)
{
GopherObj *gs;
int result;
char *cp;
gs = GSnew();
while (1) {
GSinit(gs);
result = GSfromLink(gs, fio, host, port,directory, peer);
if (result == HARDERROR)
break;
if (result == SOFTERROR)
continue;
cp = GSgetPath(gs);
if (*cp == '.')
GDaddGSmerge(gd, gs);
else
GDaddGS(gd, gs);
if (result == FOUNDEOF)
break;
}
GSdestroy(gs);
}
void
GDtoLink(GopherDirObj *gd, int fd)
{
int i;
for (i=0; i< GDgetNumitems(gd); i++) {
GStoLink(GDgetEntry(gd, i), fd, FALSE);
}
}
/*** Search for a specific gopher item ***/
/* Note first char is G0 type and is ignored*/
int
GDSearch(GopherDirObj *gd, char *text)
{
int i;
GopherObj *gs;
int cplen;
char *cp;
Debug("GDSearch: %s;\n",text);
if (gd == NULL)
return(-1);
if (text == NULL)
return(-1);
if ((int) strlen(text) <= 1)
return(-1);
for (i=0; i< GDgetNumitems(gd); i++) {
gs = GDgetEntry(gd, i);
cp = GSgetPath(gs);
if (cp != NULL) {
cplen = strlen(cp);
if (cplen >1 && strcmp(text+1, cp+1) == 0) {
Debugmsg("Matched\n");
return(i);
}
}
}
Debugmsg("GDsearch: No Match\n");
return(-1);
}
/*
* Delete an item in a gopher GD.. Do it in place...
*/
GopherDirObj *
GDdeleteGS(GopherDirObj *gd, int j)
{
int i;
if (GDgetNumitems(gd) == j+1) {
/* Last item in the directory */
GSinit(GDgetEntry(gd,j));
GDsetNumitems(gd, j);
return(gd);
}
/** Okay, now let's copy the items down, one by one.. **/
for (i= j+1; i GDgetNumitems(gd)-1)
GDsetCurrentItem(gd, GDgetCurrentItem(gd)-1);
return(gd);
}
gopher-3.0.15/object/Debug.h 0000664 0000000 0000000 00000000667 10762617110 012433 0 ustar #ifndef DEBUG_H
#define DEBUG_H
#include "boolean.h"
extern boolean DEBUG;
#ifdef DEBUGGING
# include
# define Debug(str,val) if (DEBUG) { fprintf(stderr,str,val); }
# define Debugmsg(str) if (DEBUG) { fprintf(stderr,str); }
# define DebugGSplusPrint(gop,str) if (DEBUG) { GSplusPrint(gop,str); }
#else
# define Debug(str,val)
# define Debugmsg(str)
# define DebugGSplusPrint(gop,str)
#endif
#endif /* DEBUG_H */
gopher-3.0.15/object/GSgopherobj.c 0000664 0000000 0000000 00000144646 12621232663 013621 0 ustar /********************************************************************
* $Author: jgoerzen $
* $Revision: 1.8 $
* $Date: 2002/03/19 20:07:16 $
* $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/GSgopherobj.c,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: GSgopherobj.c
* Implement gopher directory functions.
*********************************************************************
* Revision History:
* $Log: GSgopherobj.c,v $
* Revision 1.8 2002/03/19 20:07:16 jgoerzen
* GSgopherobj.c: Moved Regex.h include up.
*
* Regex.c, Regex.h: continuing full rewrites.
*
* Revision 1.7 2002/01/08 17:36:14 jgoerzen
* Finally builds!
*
* Changes:
*
* * config.h.in: rebuilt by autoheader
*
* * configure: rebuilt by autoconf
*
* * configure.in:
* * Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
* * Added checkes for term.h, re_comp.h, regex.h
*
* * gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
*
* * gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
* * Use REGEXLIBS
*
* * gopher/globals.h, gopher/gopher.c: Remove sys_errlist
*
* * object/GSgopherobj.c: Removed #include, now use
* "Regex.h" that has proper regex determining logic
*
* * object/Regex.h: Moved regex.h include to here. Make it conditional
* based on configure test. Add conditional re_comp.h include.
*
* Revision 1.6 2001/01/17 21:48:05 jgoerzen
* Many fixes and tune-ups. Now compiles cleanly with -Wall -Werror!
*
* Revision 1.5 2001/01/17 21:16:35 jgoerzen
* More psinrtf -> snprintf changes
*
* Revision 1.4 2000/12/26 22:48:12 s2mdalle
*
* Changed GSsendHeader(int, int) => GSsendHeader(int, long) because the
* second argument is often the file size, and an int may not be
* sufficient depending on platform. Most calls use canned values of -1
* and -2 anyway.
*
* Revision 1.3 2000/12/20 01:19:20 jgoerzen
* Added patches from David Allen
*
* Revision 1.2 2000/08/23 00:18:41 jgoerzen
* Various bugfixes
*
* Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
* Import from UMN Gopher 2.3.1 after GPLization
*
* Revision 3.85 1995/11/10 22:26:26 lindner
* Fix for wierd relative gopher URLs
*
* Revision 3.84 1995/11/03 18:00:45 lindner
* Coen: changes
*
* Revision 3.83 1995/11/03 05:37:13 lindner
* Convert ------ to
*
* Revision 3.82 1995/10/04 22:30:45 lindner
* Add to the end of info lines
*
* Revision 3.81 1995/09/28 22:59:25 lindner
* Move nullword
*
* Revision 3.80 1995/09/25 22:07:18 lindner
* Ansification
*
* Revision 3.79 1995/08/29 07:13:06 lindner
* Add tickets to urls
*
* Revision 3.78 1995/06/12 15:33:41 lindner
* Add onlyhtml support
*
* Revision 3.77 1995/05/02 04:03:51 lindner
* Remove unused variable
*
* Revision 3.76 1995/04/15 07:07:19 lindner
* Fix for fcn prototype, check for error
*
* Revision 3.75 1995/02/22 05:30:25 lindner
* reintroduce gsinit to gsnew
*
* Revision 3.74 1995/02/17 18:29:37 lindner
* Abstract display support
*
* Revision 3.73 1995/02/16 22:32:44 lindner
* HTML icon support
*
* Revision 3.72 1995/02/07 07:12:55 lindner
* oops!
*
* Revision 3.71 1995/02/07 07:06:58 lindner
* performance fixes
*
* Revision 3.70 1995/02/06 22:13:52 lindner
* Performance fixes
*
* Revision 3.69 1995/02/02 17:14:46 lindner
* Fix for memory leaks and accesses
*
* Revision 3.68 1995/02/01 22:08:02 lindner
* Put back GSaddmerge
*
* Revision 3.67 1995/02/01 21:44:41 lindner
* Remove GSmerge fcns, Add message/rfc822 and application/gopher to GSisText
*
* Revision 3.66 1994/12/15 17:30:49 lindner
* Allow multi-line abstracts in link files, Fix for ftp URL generation
*
* Revision 3.65 1994/12/05 22:39:55 lindner
* Fix Name and Path settings in GSfromURL
*
* Revision 3.64 1994/11/17 06:33:58 lindner
* Fixes for VMS internationalization
*
* Revision 3.63 1994/11/13 06:30:48 lindner
* Better GSfromURL
*
* Revision 3.62 1994/10/24 22:15:53 lindner
* Add PDF type
*
* Revision 3.61 1994/10/18 21:37:03 lindner
* Make sure buf is set
*
* Revision 3.60 1994/10/13 05:27:18 lindner
* Compiler complaint fixes
*
* Revision 3.59 1994/09/29 19:26:45 lindner
* Fix for debug messages and NULL values
*
* Revision 3.58 1994/08/19 16:13:09 lindner
* mktime() etc, fixes from Alan Coopersmith
*
* Revision 3.57 1994/08/03 20:03:44 lindner
* Fix for adding ask stuff
*
* Revision 3.56 1994/07/31 04:57:20 lindner
* Fix for .names messup...
*
* Revision 3.55 1994/07/21 22:29:18 lindner
* misc hacks
*
* Revision 3.54 1994/07/06 19:21:34 lindner
* use strftime to get localized date and time
*
* Revision 3.53 1994/06/29 06:51:21 lindner
* ifdef GINTERNATIONAL, use strftime to localize the date string
* returned by GSgetModDate()
*
* in GSplusfromNet(), if there's anything in the ADMIN block other than
* Admin, ModDate, or TTL entries, save it for the client's showinfo()
* Server Information
*
* Move GSfromURL() return code definitions to header so other files can
* call it
*
* Fix GStoNetURL() & HTML display of directories
*
* Round sizes in GSaddView
*
* Make GSfromURL() lie and say all http: is HTML so the client
* passes it off to a http-speaking program anyway (assuming
* all HTML viewers speak http, that is) (Coopersmith)
*
* Revision 3.52 1994/06/29 05:45:56 lindner
* Mods to pump tickets to the net
*
* Revision 3.51 1994/05/25 20:57:46 lindner
* Remove unused var
*
* Revision 3.50 1994/05/06 02:29:46 lindner
* Fix from Robert Beckett for binhex files
*
* Revision 3.49 1994/04/25 03:36:58 lindner
* Modifications for Debug() and mismatched NULL arguments, added Debugmsg
*
* Revision 3.48 1994/04/25 02:26:30 lindner
* Fix for url problems
*
* Revision 3.47 1994/04/25 02:16:31 lindner
* Fix for |= mistype
*
* Revision 3.46 1994/04/22 06:41:35 lindner
* More pacbell hacks for Domain=
*
* Revision 3.45 1994/04/22 03:26:15 lindner
* pacbell hack
*
* Revision 3.44 1994/04/19 14:32:29 lindner
* Change GD and GSfromLink routines to use FIO
*
* Revision 3.43 1994/04/13 19:16:17 lindner
* Fix for ASK block bug
*
* Revision 3.42 1994/04/08 20:05:52 lindner
* gcc -Wall fixes
*
* Revision 3.41 1994/04/07 17:27:09 lindner
* Fix for pyramids
*
* Revision 3.40 1994/04/01 04:38:06 lindner
* Fix for conditional macros
*
* Revision 3.39 1994/03/31 22:48:55 lindner
* fix for Hgopher and ask requests
*
* Revision 3.38 1994/03/31 21:05:11 lindner
* More debug code, and fix for Socket return values
*
* Revision 3.37 1994/03/17 04:37:41 lindner
* Fix for spinning clients
*
* Revision 3.36 1994/03/08 15:56:17 lindner
* gcc -Wall fixes
*
* Revision 3.35 1994/03/04 17:59:16 lindner
* More URL fixes from A.C.
*
* Revision 3.34 1994/02/20 16:27:44 lindner
* Remove dead code for GDtoNetHTML
*
* Revision 3.33 1994/01/25 06:51:21 lindner
* Many additions for URL/HTML support, removed insidious dot at end of host..
*
* Revision 3.32 1994/01/10 03:28:12 lindner
* Allow bangs in Domain= lines, to negate classes of hosts
*
* Revision 3.31 1994/01/06 06:10:53 lindner
* fix for cvs entries
*
*
* Revision 3.30 1994/01/06 05:43:46 lindner
* Fix for type=1 and ask blocks.
*
* Revision 3.29 1993/12/27 16:25:39 lindner
* Add fix for appending a period to domain names
*
* Revision 3.28 1993/11/29 01:07:23 lindner
* In GSfromLink(), disable handling of "Domain_pat:" for VMS to keep the
* compiler from complaining about the lack of re_comp() and re_exec().
* "Domain_pat:" handling isn't needed in the client anyway. (Wolfe)
*
* Add "AddInfo" argument to GStoLink(). This option decides whether to
* add the Admin and ModDate fields to the basic information about the
* gopher object. Bookmarks should not include them, but requested
* technical information ('=' and '^') should. This change requires
* changes to gopher/gopher.c and object/GDgopherdir.c; see below.
* (Macrides)
*
* Revision 3.27 1993/11/05 07:24:46 lindner
* Allow Type=1? etc.. in .link files
*
* Revision 3.26 1993/11/04 04:50:50 lindner
* Add quotes around HREFs
*
* Revision 3.25 1993/11/04 02:10:47 lindner
* Added Domain_pat= line to check for a regexp domains
*
* Revision 3.24 1993/11/03 15:35:40 lindner
* Fix problems with bookmarks of gopher+ items
*
* Revision 3.23 1993/11/02 06:15:24 lindner
* HTML additions
*
* Revision 3.22 1993/10/26 17:49:50 lindner
* Fix for NULL view in GSisText()
*
* Revision 3.21 1993/10/22 20:02:33 lindner
* Add Movie (;) and Info (i) type support
*
* Revision 3.20 1993/09/18 04:44:41 lindner
* Additions to fix caching of Multiple view items
*
* Revision 3.19 1993/09/11 06:41:08 lindner
* Fix for picky compilers
*
* Revision 3.18 1993/09/11 06:32:52 lindner
* URL support
*
* Revision 3.17 1993/09/01 21:51:59 lindner
* Remove GSnewSet, better initialization in GSnew()
*
* Revision 3.16 1993/08/19 20:24:11 lindner
* Mitra's Debug patch
*
* Revision 3.15 1993/07/29 20:02:55 lindner
* Removed dead variables
*
* Revision 3.14 1993/07/27 20:17:25 lindner
* Fix improper bracketed debug output
*
* Revision 3.13 1993/07/27 05:30:23 lindner
* Mondo Debug overhaul from Mitra
*
* Revision 3.12 1993/07/27 00:30:09 lindner
* plus patch from Mitra
*
* Revision 3.11 1993/07/23 04:50:17 lindner
* Mods to allow abstract/admin setting in .names files
*
* Revision 3.10 1993/07/21 03:31:09 lindner
* Askdata can be stored locally, plus GSfromLink doesn't core dump with
* mangled items
*
* Revision 3.9 1993/07/14 20:37:11 lindner
* Negative numbering patches
*
* Revision 3.8 1993/07/07 19:30:12 lindner
* Split off socket based fcns to Sockets.c
*
* Revision 3.7 1993/07/06 20:22:40 lindner
* Added listener and accept fcns
*
* Revision 3.6 1993/06/22 06:07:14 lindner
* Added Domain= hacks..
*
* Revision 3.5 1993/04/15 17:44:52 lindner
* Fixed link processing, mods from Mitra
*
* Revision 3.4 1993/03/26 19:50:46 lindner
* Mitra fixes for better/clearer fromNet code
*
* Revision 3.3 1993/03/24 17:05:33 lindner
* Additions for Localfile for each GopherObj
*
* Revision 3.2 1993/03/18 22:15:50 lindner
* filtering, memory leaks fixed, GSmerge problems
*
*********************************************************************/
#include "GSgopherobj.h"
#if defined(mips) && defined(ultrix) /*** Gross hack, yuck! ***/
#define _SIZE_T
#endif
#include "String.h"
#include "STRstring.h"
#include "Regex.h"
#include
#include "compatible.h"
#include
#include "Malloc.h"
#include "Sockets.h"
#include "util.h"
#include "Debug.h"
#include "fileio.h"
#include
#ifdef pyr
unsigned long errno;
#endif
/*
* Make a new gopherobj... Should reuse destroyed GopherObjs...
*/
GopherObj *
GSnew()
{
GopherObj *temp;
temp = (GopherObj *) malloc(sizeof(GopherObj));
temp->Selstr = STRnew();
temp->Title = STRnew();
temp->Host = STRnew();
temp->Localfile = STRnew();
temp->Localview = STRnew();
temp->gplus = NULL;
temp->isask = FALSE;
temp->url = NULL;
GSinit(temp);
return(temp);
}
/*
* Initialize the gopherplus components of the object
* (Only called for a gplus item)
*/
void
GSplusnew(GopherObj *gs)
{
if (gs->gplus == NULL) {
gs->gplus = (GplusObj *) malloc(sizeof(GplusObj));
}
gs->gplus->Admin = STRnew();
gs->gplus->ModDate = STRnew();
gs->gplus->Views = VIAnew(10);
gs->gplus->OtherBlocks = BLAnew(5);
gs->gplus->Askdata = NULL;
}
/*** Destroy gopher object ***/
void
GSdestroy(GopherObj *gs)
{
STRdestroy(gs->Selstr);
STRdestroy(gs->Title);
STRdestroy(gs->Host);
if (GSgetLocalFile(gs) != NULL)
unlink(GSgetLocalFile(gs));
STRdestroy(gs->Localfile);
STRdestroy(gs->Localview);
GSplusdestroy(gs);
if (gs->url != NULL)
URLdestroy(gs->url);
free(gs);
}
/*** Destroy Gopher+ attributes ***/
void
GSplusdestroy(GopherObj *gs)
{
if (gs->gplus != NULL) {
STRdestroy(gs->gplus->Admin);
STRdestroy(gs->gplus->ModDate);
VIAdestroy(gs->gplus->Views);
BLAdestroy(gs->gplus->OtherBlocks);
(void)GSsetAskdata(gs, NULL);
free(gs->gplus);
gs->gplus = NULL;
}
}
/*
* Clear out all the crud
*/
void
GSinit(GopherObj *gs)
{
GSsetType(gs, '\0');
STRinit(gs->Title);
STRinit(gs->Selstr);
STRinit(gs->Host);
if (GSgetLocalFile(gs) != NULL)
unlink(GSgetLocalFile(gs));
STRinit(gs->Localfile);
STRinit(gs->Localview);
gs->ttl = -1;
gs->iPort = 0;
GSsetNum(gs, 0);
GSsetWeight(gs, 0);
GSsetGplus(gs,FALSE); /** Default is no gplus **/
GSsetAsk(gs, FALSE);
if (gs->url != NULL)
URLdestroy(gs->url);
gs->url = NULL;
GSplusInit(gs);
}
/*
* Clear out gopher+ crud if it exists
*/
void
GSplusInit(GopherObj *gs)
{
if (gs->gplus != NULL) {
STRinit(gs->gplus->Admin);
STRinit(gs->gplus->ModDate);
VIAinit(gs->gplus->Views);
STAinit(gs->gplus->OtherBlocks);
}
}
/*
* Set a URL for the gopherobject..
*/
void
GSsetURL(gs, url)
GopherObj *gs;
char *url;
{
if (gs->url == NULL)
gs->url = URLnew();
URLset(gs->url, url);
}
int
GSgetNumBlocks(GopherObj *gs)
{
if (gs->gplus == NULL)
return(-1);
return(BLAgetTop(gs->gplus->OtherBlocks));
}
Blockobj*
GSgetBlock(GopherObj *gs, int bnum)
{
if (gs->gplus == NULL || bnum < 0)
return(NULL);
return(BLAgetEntry(gs->gplus->OtherBlocks, bnum));
}
/*
* Return the number of views if item is gopher+
*/
int
GSgetNumViews(GopherObj *gs)
{
if (gs->gplus == NULL)
return(0);
return(VIAgetTop(gs->gplus->Views));
}
/*
* Find out what a specific view is
*/
VIewobj *
GSgetView(GopherObj *gs, int viewnum)
{
if (gs->gplus == NULL)
return(NULL);
return(VIAgetEntry(gs->gplus->Views, viewnum));
}
char *
GSgetURL(GopherObj *gs, char *ticket)
{
if (gs->url == NULL) {
gs->url = URLnew();
URLfromGS(gs->url, gs, ticket);
}
return(URLget(gs->url));
}
char *
GSgetURLhtml(GopherObj *gs, char *ticket)
{
char *cp = GSgetURL(gs, ticket);
char *cp2;
int views;
if ((cp != NULL) && (strncmp(cp, "gopher://", 9) == 0)) {
if ( GSgplusInited(gs) ) {
for (views=0; views< GSgetNumViews(gs); views++) {
if (!(strncasecmp(VIgetType(GSgetView(gs,views)),
"text/html", 9))) {
cp = strdup(cp);
/** find the type character **/
cp2 = strchr(cp+10, '/');
if (cp2 != NULL) {
*(++cp2) = 'h';
cp2++;
if (strncmp(cp2, "%2a",3)==0) {
/** validated item, skip forward... **/
cp2 = strstr(cp2, "%20");
if (cp2 != NULL) {
cp2 +=3;
cp2 = strstr(cp2, "%20");
if (cp2 != NULL) {
cp2+=3;
*cp2 = 'h';
}
}
} else
*cp2 = 'h';
}
}
}
}
if (strstr(cp, "/1validate%201") != NULL) {
cp = strdup(cp);
cp2 = strchr(cp+10, '/');
if (cp2 != NULL) {
*(++cp2) = 'h';
*(++cp2) = 'h';
*(cp2+11) = 'h';
}
}
else if (strstr(cp, "/hhalidate%201") != NULL) {
cp = strdup(cp);
cp2 = strchr(cp+10, '/');
*(cp2+13) = 'h';
} else if (*(GSgetPath(gs)) == '*') {
/** This is a validated item.. **/
;
}
}
return cp;
}
static char *
GStoNetURL(GopherObj *gs, char *url, char *ticket)
{
char *path, *ftphost, *ftppath;
*url = '\0';
path = GSgetPath(gs);
/** This is a server specific hack for now.. **/
if (path == NULL)
return(NULL);
if ((path != NULL) && (strncmp(path, "ftp://", 6) == 0)) {
strcpy(url, path);
return(url);
}
else if ((path != NULL) && (strncmp(path, "ftp:", 4) == 0) ) {
ftphost = path+4;
ftppath = strchr(ftphost, '@');
if (ftppath != NULL)
{
sprintf(url, "ftp://%.*s/", (int) (ftppath - ftphost), ftphost);
ftppath++;
/*** The rest is the file/path ***/
if (*ftppath == '/')
ftppath++;
strcat(url, ftppath);
return(url);
}
}
strcpy(url,GSgetURLhtml(gs,ticket));
return(url);
}
Blockobj*
GSfindBlock(GopherObj *gs, char *blockname)
{
int x;
x = BLAsearch(GSgetOtherBlocks(gs), blockname);
Debug("GSfind num is %d\n", x);
if (x < 0)
return(NULL);
else
return(GSgetBlock(gs, x));
}
void
GSsetBlock(GopherObj *gs, char *blockname, char *text, boolean appendIfPoss)
{
Blockobj *bl = NULL;
boolean newbl = FALSE;
Debug("GSsetBlock:%s;",blockname);
Debug("%s\r\n", text);
if (appendIfPoss)
bl = GSfindBlock(gs, blockname);
if (bl == NULL) {
newbl = TRUE;
bl = BLnew();
}
BLsetName(bl, blockname);
BLaddText(bl, text);
#ifdef DEBUGGING
if (DEBUG)
BLtoNet(bl, fileno(stderr), TRUE);
#endif
if (gs->gplus == NULL)
GSplusnew(gs);
if (newbl) {
BLApush(gs->gplus->OtherBlocks, bl);
BLdestroy(bl);
}
}
/*
* Set the Askdata, destroy if necessary..
*/
char **
GSsetAskdata(GopherObj *gs, char **askdata)
{
if (!GSgplusInited(gs))
return(NULL);
/** Destroy data if necessary **/
if (gs->gplus->Askdata != NULL) {
int i=0;
char **Askmoo = gs->gplus->Askdata;
while (Askmoo[i] != NULL) {
free(Askmoo[i++]);
}
free(Askmoo);
}
gs->gplus->Askdata = askdata;
return(askdata);
}
/*
* Set the administrator line as defined in Gopher+ protocol
* Name
*/
/* Converts the gopher+ moddate from to a struct tm ptr */
struct tm *
GSgetModDateTM(GopherObj *gs)
{
static struct tm time;
char *cp;
#ifndef NO_MKTIME
time_t converted;
#endif
if ( (gs->gplus == NULL) || (STRget(gs->gplus->ModDate) == NULL) )
return NULL;
cp = strchr(STRget(gs->gplus->ModDate), '<');
if (cp == NULL)
return NULL;
#define ASCII_TO_INT(a) (a - '0')
/* Should really do some sanity checking on the input here */
time.tm_year = ((ASCII_TO_INT(cp[1]) * 1000) + (ASCII_TO_INT(cp[2]) * 100)
+ (ASCII_TO_INT(cp[3]) * 10) + ASCII_TO_INT(cp[4]) ) - 1900;
time.tm_mon = (ASCII_TO_INT(cp[5]) * 10) + ASCII_TO_INT(cp[6]) - 1;
time.tm_mday = (ASCII_TO_INT(cp[7]) * 10) + ASCII_TO_INT(cp[8]);
time.tm_hour = (ASCII_TO_INT(cp[9]) * 10) + ASCII_TO_INT(cp[10]);
time.tm_min = (ASCII_TO_INT(cp[11]) * 10) + ASCII_TO_INT(cp[12]);
time.tm_sec = (ASCII_TO_INT(cp[13]) * 10) + ASCII_TO_INT(cp[14]);
time.tm_isdst = -1; /* make the system figure it out */
#ifndef NO_MKTIME
/* if mktime() is present, let it do sanity checking and day of
week setting for us */
converted = mktime(&time);
if (converted != -1)
return (localtime(&converted));
#endif
return (&time);
}
#if defined(VMS) || (defined(GINTERNATIONAL) && !defined(NO_STRFTIME))
/* In internationalized environments, convert the ModDate string to the
* native language when it's requested.
* If i18n is not on, the macro from GSgopherobj.h is used.
* (The i18n definition's are turned on or off in Locale.h)
*/
char *
GSgetModDate(GopherObj *gs)
{
char dateBuf[256];
char *datetime;
struct tm *modTime;
if ( (gs->gplus == NULL) || (STRget(gs->gplus->ModDate) == NULL) )
return NULL;
modTime = GSgetModDateTM(gs);
if ( (modTime != NULL) &&
strftime(dateBuf, sizeof(dateBuf) - 16, "%c ", modTime) )
{
datetime = strchr(STRget(gs->gplus->ModDate), '<');
if (datetime != NULL)
strncat(dateBuf, datetime, 16);
STRset(gs->gplus->ModDate, dateBuf);
}
return STRget(gs->gplus->ModDate);
}
#endif /* GINTERNATIONAL */
void
GSsetAdmin(GopherObj *gs, char *admin)
{
if (gs->gplus == NULL)
GSplusnew(gs);
STRset(gs->gplus->Admin, admin);
}
void
GSsetModDate(GopherObj *gs, char *str)
{
if (gs->gplus == NULL) GSplusnew(gs);
STRset(gs->gplus->ModDate, str);
}
/** Add a view for a specific gopherobj **/
void
GSaddView(GopherObj *gs, char *view, char *language, int estsize)
{
char tmpstr[64];
VIewobj *temp;
if (estsize > 960)
snprintf(tmpstr, sizeof(tmpstr), "%dk", (estsize + 512)/1024);
else
snprintf(tmpstr, sizeof(tmpstr), ".%dk", ((estsize+64)*10)/1024);
temp = VInew();
VIsetType(temp, view);
VIsetLang(temp, language);
VIsetSize(temp, tmpstr);
VIApush(gs->gplus->Views, temp);
VIdestroy(temp);
}
void
GSdelTopView(GopherObj *gs)
{
#define VIApop(a) (DApop((DynArray*)(a)))
VIApop(gs->gplus->Views);
}
void
GSaddBlock(GopherObj *gs, char *Blockname, char *file)
{
Blockobj *bl;
bl = BLnew();
BLsetName(bl, Blockname);
BLsetFile(bl, file);
;
if (gs->gplus == NULL)
GSplusnew(gs);
BLApush(gs->gplus->OtherBlocks, bl);
BLdestroy(bl);
}
/*
* Send a gopher reference into an fd
*/
static char *nullword = "(NULL)";
void
GStoNet(GopherObj *gs, int sockfd, GSformat fmt, char *ticket)
{
char buf[1024];
int i;
Blockobj *bl;
if (ticket == NULL)
ticket = "";
buf[0] = GSgetType(gs);
if (buf[0] == '\0') /* For example a .names with no Type */
buf[0] = '3';
if (fmt == GSFORM_G0) {
for (i=0; i< GSgetNumBlocks(gs); i++) {
bl = GSgetBlock(gs, i);
if (strcasecmp(BLgetName(bl), "ONLYHTML")==0)
return;
}
snprintf(buf + 1,
sizeof(buf) - 1,
"%s\t%s%s\t%s\t%d",
GSgetTitle(gs) ? GSgetTitle(gs) : nullword,
ticket ? ticket : nullword,
GSgetPath(gs) ? GSgetPath(gs) : nullword,
GSgetHost(gs) ? GSgetHost(gs) : nullword,
GSgetPort(gs));
if (GSisAsk(gs))
strcat(buf, "\t?\r\n");
else if (GSisGplus(gs))
strcat(buf, "\t+\r\n");
else
strcat(buf, "\r\n");
writestring(sockfd, buf);
Debug("GStoNet:%s", buf);
}
else if (fmt == GSFORM_GPLUS) {
;
}
else if (fmt == GSFORM_HTML) {
char url[256];
for (i=0; i < GSgetNumBlocks(gs); i++) {
bl = GSgetBlock(gs, i);
if (strcmp(BLgetName(bl), "NOHTML") == 0)
return;
}
if (GSgetType(gs) == A_INFO) {
writestring(sockfd, "