├── COPYING
├── MANIFEST
├── Makefile.config.in
├── Makefile.in
├── README
├── announcements
├── 3.0.0.html
├── 3.0.0.txt
└── 3.0.4.html
├── conf.h
├── config.guess
├── config.h.in
├── config.sub
├── configure
├── configure.in
├── copyright
├── debian
├── changelog
├── compat
├── conffiles
├── control
├── copyright
├── dirs
├── docs
├── rules
├── source
│ └── format
└── startopts
├── doc
├── FAQ
├── INSTALL
├── Makefile.in
├── PLATFORMS
├── TODO
├── client.changes
├── clientlogging.vms
├── gopher.1
├── gopherrc.5
├── gophfilt.1
└── object.changes
├── gopher
├── CURcurses.c
├── CURcurses.h
├── Makefile.in
├── compile.com
├── cso.c
├── cso.h
├── download.c
├── download.h
├── form.c
├── form.h
├── globals.c
├── globals.h
├── gopher.c
├── gopher.h
├── gopher.hlp
├── gopher.rc
├── gopher.tpu
├── gopherrc.c
├── gopherrc.h
├── gopherremote.rc
├── html2.c
├── html2.h
├── link.com
├── locales
│ ├── De_DE.msg
│ ├── Dk.msg
│ ├── En_US.msg
│ ├── Es_ES.msg
│ ├── Es_MX.msg
│ ├── Fr.msg
│ ├── It.msg
│ ├── Makefile.in
│ ├── README
│ ├── README.VMS
│ ├── Sv.msg
│ ├── gopher.hlp.Dk
│ ├── gopher.hlp.Es
│ ├── gopher.hlp.Fr
│ ├── gopher.hlp.It
│ ├── klingon.msg
│ ├── make.com
│ ├── message.tpu
│ └── piglatin.msg
├── makefile.vms
├── manager.c
├── manager.h
├── ourutils.c
├── ourutils.h
├── pager.c
├── pager.h
├── subprocs.c
├── upload.c
├── upload.h
├── version.h
└── vmsopts
│ ├── cmuip_decc.opt
│ ├── cmuip_vaxc.opt
│ ├── multinet_decc.opt
│ ├── multinet_vaxc.opt
│ ├── netlib_decc.opt
│ ├── netlib_vaxc.opt
│ ├── tcpware_decc.opt
│ ├── tcpware_vaxc.opt
│ ├── ucx_decc.opt
│ ├── ucx_vaxc.opt
│ ├── wollongong_decc.opt
│ └── wollongong_vaxc.opt
├── gophfilt
├── Makefile.in
├── gophfilt.c
├── make_gophfilt.com
└── tryit.com
├── install-sh
├── make.com
├── object
├── BLblock.c
├── BLblock.h
├── DAarray.c
├── DAarray.h
├── Debug.c
├── Debug.h
├── Dirent.h
├── GDgopherdir.c
├── GDgopherdir.h
├── GSgopherobj.c
├── GSgopherobj.h
├── Locale.c
├── Locale.h
├── Makefile.in
├── Malloc.h
├── RBTree.c
├── RBTree.h
├── Regex.c
├── Regex.h
├── STAarray.h
├── STRstring.c
├── STRstring.h
├── Sockets.c
├── Sockets.h
├── Stat.h
├── Stdlib.h
├── String.h
├── VIews.c
├── VIews.h
├── Wait.h
├── boolean.h
├── compatible.c
├── compatible.h
├── compile.com
├── fileio.c
├── fileio.h
├── getopt.c
├── link.com
├── ranlib
├── url.c
├── url.h
├── util.c
└── util.h
└── patchlevel.h
/README:
--------------------------------------------------------------------------------
1 | $Id: README,v 1.5 2002/02/12 21:30:03 jgoerzen Exp $
2 |
3 | This is the Gopher+ distribution based on the University of
4 | Minnesota's Internet Gopher+ distribution for UNIX machines.
5 | University of Minnesota actively developed this software until 1995.
6 | In 2000, they released it to the public under the GNU General Public
7 | License. This represents the latest version of their tree, as adopted
8 | by a group of programmers. A client for VMS is included but is not
9 | currently supported. Here's a breakdown by directory:
10 |
11 | announcements: Release notes, public announcements about Gopher, etc.
12 | Preserved here for posterity.
13 |
14 | coders: Files of note to Gopher developers.
15 |
16 | debian: Files to build gopher on Debian. Also,
17 | debian/changelog is the place to look for all recent
18 | changes.
19 |
20 | doc: The documentation for all parts of the distribution.
21 | Look here *first*. Important files:
22 | INSTALL -- Installation instructions
23 | *.changes -- Stuff that's changed from version to version
24 | man pages, etc.
25 | PLATFORMS -- Info on support of different platforms
26 | LOOK HERE IF YOU HAVE PROBLEMS COMPILING!
27 |
28 | gopher: The Internet Gopher+ Curses client.
29 |
30 | gophfilt: A Gopher "filter" program.
31 |
32 | test: A regression testing package, include sample data.
33 |
34 | Please look in the directory "doc" for more information about installing
35 | the various portions of the Internet Gopher. Specifically refer to
36 | the file INSTALL.
37 |
38 | This software is Copyright 1991-2000 by the Regents of the University
39 | of Minnesota. This software is Copyright (C) 2000-2002 by John
40 | Goerzen and the gopher developers. Please refer to the file
41 | "Copyright" for more information on restrictions of use. Bug reports,
42 | patches and comments may be sent to gopher@complete.org.
43 |
44 | The UMN team wishes recognize the help and code from the following people:
45 |
46 | UNIX network Programming W. Richard Stevens
47 | (For socket functions and error
48 | routines, now unrecognizeable :-) )
49 |
50 | elm Copyrighted by the USENET trust.
51 | (For UI cloning)
52 |
53 | WAIS Brewster and co. at Thinking Machines
54 | (er, now WAIS Inc.)
55 | (For our UNIX generic indexing stuff)
56 |
57 | and all of our users for their great suggestions and patches!
58 |
59 | See the files doc/*.changes for a long list of people who have
60 | submitted patches and code.
61 |
62 |
63 |
--------------------------------------------------------------------------------
/announcements/3.0.4.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Gopher (FurryTerror) 3.0.4 Released
5 |
6 |
7 |
8 | Gopher FurryTerror Released
9 |
10 | March 20, 2002
11 |
12 | Today we release the Internet Gopher Server and Client version
13 | 3.0.4, two months after the release of our 10th anniversary 3.0
14 | edition.
15 |
16 | Since version 3.0, the following major changes have occured:
17 |
18 |
19 | - [portability] Builds on MacOS X natively
20 |
- [portability] Builds on Solaris natively
21 |
- [portability] Fixes to make install target
22 |
- [portability] Many autoconf fixes
23 |
- [bugfix] Proper gopher URL handling
24 |
- [features] Out-of-box support for .ogg and .mp2 files
25 |
- [features] Generate useful gopherd.conf as part of build
26 |
- [portability] Major rewrite of regex system resulting in
27 | more portable code
28 |
- [bugfix] Don't prematurely stop reading some documents
29 |
- [portability] Builds on FreeBSD natively
30 |
- [features] New FAQ
31 |
32 | About Gopher
33 | To learn about Gopher, please visit The Gopher Project
34 | [gopher/web], A Brief Introduction to Gopherspace
36 | [gopher/web], or
38 | The Gopher Manifesto
39 | [gopher/web].
41 | Obtaining Gopher/Gopherd 3.0.4
42 | Debian sid users may run "apt-get install gopher gopherd" beginning on
43 | approximately March 22.
44 |
45 | The source distribution may be downloaded from:
46 |
54 |
55 | Release Notes
56 |
57 | - You are encouraged to use ./configure --disable-auth to
58 | build.
59 |
- BSD users should use "gmake" to build.
60 |
- MacOS X (and in fact, all) users should read doc/PLATFORMS.
61 |
62 |
63 |
64 |
65 |
66 | $Id: 3.0.4.html,v 1.3 2002/03/20 03:08:06 jgoerzen Exp $
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/configure.in:
--------------------------------------------------------------------------------
1 |
2 | # configure.in for gopher
3 | # Process this file with autoconf to produce a configure script.
4 |
5 | dnl
6 | dnl MACROS
7 | dnl
8 | define(UP_ASK_FOR,
9 | [echo "$2 ($3)?";
10 | read $1;
11 | if test "$$1" = "" ; then
12 | $1="$3";
13 | fi])dnl
14 |
15 |
16 | AC_INIT(gopher/gopher.c)
17 | echo "----------------------------------------------------------------------"
18 | echo "You are about to build the Gopher system for Unix"
19 | echo "Please read the file doc/INSTALL for full information on"
20 | echo "building Gopher"
21 | echo " "
22 | echo "Gopher is copyrighted software, see the file Copyright in"
23 | echo "the distribution for more information and limitations."
24 | echo "----------------------------------------------------------------------"
25 | echo " "
26 | dnl AC_CANONICAL_HOST
27 |
28 |
29 | AC_CONFIG_HEADER(config.h)
30 | dnl Checks for programs.
31 | AC_PROG_CC
32 | AC_PROG_INSTALL
33 | AC_PROG_LN_S
34 | AC_PROG_RANLIB
35 | AC_PROG_MAKE_SET
36 |
37 | dnl Checks for libraries.
38 | AC_CHECK_LIB(m, main)
39 |
40 | ######################################################################
41 | AC_SUBST(DEBUGGING)
42 | AC_ARG_ENABLE(debug, [ --disable-debug controls whether debug text is compilied in], DEBUGGING=$enableval, DEBUGGING="")
43 |
44 | if test "$DEBUGGING" = yes; then
45 | DEBUGGING="-DDEBUGGING"
46 | fi
47 |
48 | ######################################################################
49 | AC_SUBST(SOCKSLIBS)
50 | AC_SUBST(SOCKSFLAGS)
51 | HAVE_SOCKS=0
52 | AC_ARG_ENABLE(socks, [ --enable-socks use socks library, requires -lsocks], HAVE_SOCKS=1, HAVE_SOCKS=0)
53 |
54 | if test "$HAVE_SOCKS" = 1; then
55 | AC_CHECK_LIB(socks, main,
56 | SOCKSLIBS="-lsocks";
57 | SOCKSFLAGS="-Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect")
58 | fi
59 |
60 | ######################################################################
61 | AC_SUBST(GINTERNATIONAL)
62 | GINTERNATIONAL=""
63 | AC_ARG_ENABLE(locale, [ --enable-locale use international localized msgs for the client], GINTERNATIONAL="-DGINTERNATIONAL", GINTERNATIONAL="")
64 |
65 | ######################################################################
66 | AC_SUBST(GOPHER_DATA)
67 | GOPHER_DATA="/gopher-data"
68 | AC_ARG_ENABLE(datadir, [ --enable-datadir=dir enable custom datadir (/gopher-data)], GOPHER_DATA="$enableval", GOPHER_DATA="/gopher-data")
69 |
70 | ######################################################################
71 | AC_SUBST(GOPHER_PORT)
72 | GOPHER_PORT=70
73 | AC_ARG_ENABLE(port, [ --enable-port=portnum enable custom port (70)], GOPHER_PORT="$enableval", GOPHER_PORT=70)
74 |
75 | ######################################################################
76 | AC_SUBST(DLPATH)
77 | AC_SUBST(DLOBJS)
78 | AC_ARG_ENABLE(dl, [ --enable-dl=dlpathname use Tim Cook's dl databases], DLPATH="$enableval";DLOBJS="$enableval/getdesc.o $enableval/enddesc.o";SERVEROPTS="$SERVEROPTS -DDL",:)
79 |
80 | ######################################################################
81 | AC_SUBST(OPT)
82 | AC_ARG_ENABLE(opt, [ --enable-opt=args Special optimization flags to pass to the compiler], OPT="$enableval",OPT="$CFLAGS")
83 |
84 | ######################################################################
85 |
86 | dnl
87 | dnl LIBRARIES
88 | dnl
89 |
90 | # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
91 | # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
92 | # libsocket.so which has a bad implementation of gethostbyname (it
93 | # only looks in /etc/hosts), so we only look for -lsocket if we need
94 | # it.
95 | unset ac_cv_func_connect
96 | AC_CHECK_FUNC(connect, :,
97 | [case $LIBS in
98 | *-lnsl*) ;;
99 | *) AC_CHECK_LIB(nsl_s, main) ;;
100 | esac
101 | case $LIBS in
102 | *-lnsl*) ;;
103 | *) AC_CHECK_LIB(nsl, main) ;;
104 | esac
105 | case $LIBS in
106 | *-lsocket*) ;;
107 | *) AC_CHECK_LIB(socket, connect) ;;
108 | esac
109 | case $LIBS in
110 | *-linet*) ;;
111 | *) AC_CHECK_LIB(inet, connect) ;;
112 | esac
113 |
114 | unset ac_cv_func_connect
115 | AC_CHECK_FUNCS(connect)])
116 |
117 | AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
118 |
119 | ######################################################################
120 | dnl Check for WAIS
121 | with_wais=1
122 | AC_ARG_WITH(wais,[ --without-wais Don't try using WAIS (default: try)], with_wais=1, with_wais=0)
123 |
124 | AC_SUBST(REGEXLIBS)
125 | AC_SUBST(WAISTYPE)
126 | AC_SUBST(SEARCH)
127 |
128 | LDFLAGS=$OLDLDFLAGS
129 |
130 | AC_CHECK_LIB(compat, re_comp, REGEXLIBS="$REGEXLIBS -lcompat")
131 |
132 | ######################################################################
133 | AC_CHECK_LIB(malloc, main)
134 |
135 | AC_SUBST(CLIENTLIBS)
136 | AC_CHECK_LIB(curses, main, CLIENTLIBS="$CLIENTLIBS -lcurses")
137 | AC_CHECK_LIB(termcap, main, CLIENTLIBS="$CLIENTLIBS -ltermcap")
138 |
139 | dnl Checks for header files.
140 | AC_HEADER_DIRENT
141 | AC_HEADER_STDC
142 | AC_HEADER_SYS_WAIT
143 | AC_CHECK_HEADERS(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)
144 |
145 | dnl Checks for typedefs, structures, and compiler characteristics.
146 | AC_C_CONST
147 | AC_TYPE_UID_T
148 | AC_TYPE_PID_T
149 | AC_TYPE_SIZE_T
150 | AC_HEADER_TIME
151 | AC_STRUCT_TM
152 |
153 | dnl Checks for library functions.
154 | AC_PROG_GCC_TRADITIONAL
155 | AC_FUNC_MMAP
156 | dnl AC_FUNC_SETVBUF_REVERSED
157 | AC_TYPE_SIGNAL
158 | AC_FUNC_STRCOLL
159 | AC_FUNC_VFORK
160 | AC_FUNC_VPRINTF
161 | AC_FUNC_GETLOADAVG
162 |
163 | dnl Do this again so the AC_CHECK_FUNCS works.
164 |
165 | AC_CHECK_LIB(curses, main)
166 | AC_CHECK_LIB(termcap, main)
167 | AC_CHECK_FUNCS(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)
168 |
169 | AC_TRY_LINK([#include ], [getdtablesize();])
170 | AC_OUTPUT(Makefile Makefile.config object/Makefile gopher/Makefile gopher/locales/Makefile doc/Makefile gophfilt/Makefile)
171 |
172 |
--------------------------------------------------------------------------------
/copyright:
--------------------------------------------------------------------------------
1 | Gopher software distribution for UNIX
2 | Copyright (C) 1991-2000 University of Minnesota
3 | Copyright (C) 2000-2005 John Goerzen and other developers
4 |
5 | This package (Gopher software distribution for UNIX)
6 | originally had different copying restrictions.
7 | It is now distributed under the GPL.
8 |
9 | This program is free software; you can redistribute it and/or modify
10 | it under the terms of the GNU General Public License as published by
11 | the Free Software Foundation; either version 2 of the License, or
12 | (at your option) any later version.
13 |
14 | This program is distributed in the hope that it will be useful,
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | GNU General Public License for more details.
18 |
19 | You should have received a copy of the GNU General Public License
20 | along with this program; if not, write to the Free Software
21 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/debian/conffiles:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/debian/conffiles
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: gopher
2 | Section: net
3 | Priority: optional
4 | Maintainer: John Goerzen
5 | Standards-Version: 4.3.0
6 | Build-Depends: debhelper (>= 9), ncurses-dev, autoconf, gnulib
7 | Vcs-Browser: https://github.com/jgoerzen/gopher
8 | Vcs-Git: https://github.com/jgoerzen/gopher.git
9 |
10 | Package: gopher
11 | Provides: gopher-client
12 | Architecture: any
13 | Depends: ${shlibs:Depends}, ${misc:Depends}
14 | Description: Distributed Hypertext Client, Gopher protocol
15 | This package contains the client for the distributed global directory
16 | and hypertext system known as gopher. This is a text-based (ncurses)
17 | client from the University of Minnesota. It also supports the gopher+
18 | protocol, as well as links to ftp, http, and other external viewers.
19 |
--------------------------------------------------------------------------------
/debian/copyright:
--------------------------------------------------------------------------------
1 | This package was debianized by John Goerzen on
2 | Thu, 17 Aug 2000 15:16:07 -0500.
3 |
4 | It was originally downloaded from gopher://quux.org/1/devel/gopher
5 | Current versions are at https://github.com/jgoerzen/gopher
6 |
7 | Old Upstream Author(s): University of Minnesota
8 | Current Upstream Authors: John Goerzen and the gopher team
9 |
10 | Copyright:
11 |
12 | Gopher software distribution for UNIX
13 | Copyright (C) 1991-2000 University of Minnesota
14 | Copyright (C) 2000-2025 John Goerzen and the gopher developers
15 |
16 | This package (Gopher software distribution for UNIX)
17 | originally had different copying restrictions.
18 | It is now distributed under the GPL.
19 |
20 | This program is free software; you can redistribute it and/or modify
21 | it under the terms of the GNU General Public License as published by
22 | the Free Software Foundation; either version 2 of the License, or
23 | (at your option) any later version.
24 |
25 | This program is distributed in the hope that it will be useful,
26 | but WITHOUT ANY WARRANTY; without even the implied warranty of
27 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 | GNU General Public License for more details.
29 |
30 | You should have received a copy of the GNU General Public License
31 | along with this program; if not, write to the Free Software
32 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 |
34 |
35 | Debian GNU/Linux users can find the GPL in
36 | /usr/share/common-licenses/GPL.
37 |
38 |
--------------------------------------------------------------------------------
/debian/dirs:
--------------------------------------------------------------------------------
1 | usr/bin
2 | usr/share/man/man1
3 | usr/share/man/man5
4 | etc/gopher
5 |
--------------------------------------------------------------------------------
/debian/docs:
--------------------------------------------------------------------------------
1 | README
2 | doc/INSTALL
3 | doc/TODO
4 | doc/client.changes
5 | doc/clientlogging.vms
6 | doc/object.changes
7 | doc/PLATFORMS
8 | doc/FAQ
9 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 | # Sample debian/rules that uses debhelper.
3 | # GNU copyright 1997 by Joey Hess.
4 | #
5 | # This version is for a hypothetical package that builds an
6 | # architecture-dependant package, as well as an architecture-independent
7 | # package.
8 |
9 | # Uncomment this to turn on verbose mode.
10 | #export DH_VERBOSE=1
11 |
12 | # This has to be exported to make some magic below work.
13 | export DH_OPTIONS
14 |
15 | configure: configure-stamp
16 | configure-stamp:
17 | dh_testdir
18 | # Add here commands to configure the package.
19 | dh_autoreconf
20 | ln -vs /usr/share/gnulib/lib/getloadavg.c .
21 | dh_auto_configure -- --disable-auth
22 | touch configure-stamp
23 |
24 | build: build-arch build-indep
25 |
26 | build-arch: build-stamp
27 |
28 | build-indep: build-stamp
29 |
30 | build-stamp: configure-stamp
31 | dh_testdir
32 |
33 | # Add here commands to compile the package.
34 | $(MAKE)
35 |
36 | touch build-stamp
37 |
38 | clean:
39 | dh_testdir
40 | dh_testroot
41 | rm -f build-stamp configure-stamp
42 |
43 | # Add here commands to clean up after the build process.
44 | -$(MAKE) distclean
45 | -$(MAKE) clean
46 | -rm -f `find . -name "config.cache"`
47 | -rm -f config.status
48 | -rm -f `find . -name "config.log"`
49 | -rm -f Makefile.config gopher/Makefile gopher/locales/Makefile \
50 | Makefile config.h doc/Makefile \
51 | gophfilt/Makefile object/Makefile getloadavg.c
52 |
53 | dh_clean
54 |
55 | install: DH_OPTIONS=
56 | install: build
57 | dh_testdir
58 | dh_testroot
59 | dh_prep
60 | dh_installdirs
61 |
62 | # Add here commands to install the package into debian/gopher.
63 | $(MAKE) install prefix=`pwd`/debian/gopher/usr \
64 | PREFIX=`pwd`/debian/gopher/usr \
65 | DESTDIR=`pwd`/debian/gopher
66 |
67 | #chmod -R a-x debian/gopher/etc
68 |
69 | #dh_movefiles
70 | #chmod u+x debian/gopher/etc/gopher debian/gopher/etc
71 |
72 | # Build architecture-independent files here.
73 | # Pass -i to all debhelper commands in this target to reduce clutter.
74 | binary-indep: DH_OPTIONS=-i
75 | binary-indep: build install
76 | # Need this version of debhelper for DH_OPTIONS to work.
77 | dh_testdir
78 | dh_testroot
79 | # dh_installdebconf
80 | dh_installdocs
81 | dh_installexamples
82 | dh_installmenu
83 | # dh_installemacsen
84 | # dh_installpam
85 | dh_installinit
86 | dh_installcron
87 | dh_installlogrotate
88 | # dh_installmanpages
89 | dh_installinfo
90 | # dh_undocumented
91 | dh_installchangelogs
92 | dh_link
93 | dh_compress
94 | dh_fixperms
95 | # You may want to make some executables suid here.
96 | dh_installdeb
97 | # dh_perl
98 | dh_gencontrol
99 | dh_md5sums
100 | dh_builddeb
101 |
102 | # Build architecture-dependent files here.
103 | # Pass -a to all debhelper commands in this target to reduce clutter.
104 | binary-arch: DH_OPTIONS=-a
105 | binary-arch: build install
106 | # Need this version of debhelper for DH_OPTIONS to work.
107 | dh_testdir
108 | dh_testroot
109 | # dh_installdebconf
110 | dh_installdocs
111 | dh_installexamples
112 | dh_installmenu
113 | # dh_installemacsen
114 | # dh_installpam
115 | dh_installinit
116 | dh_installlogrotate
117 | dh_installcron
118 | # dh_installmanpages
119 | dh_installinfo
120 | # dh_undocumented
121 | dh_installchangelogs
122 | dh_strip
123 | dh_link
124 | dh_compress
125 | dh_fixperms
126 | # You may want to make some executables suid here.
127 | dh_installdeb
128 | # dh_makeshlibs
129 | # dh_perl
130 | dh_shlibdeps
131 | dh_gencontrol
132 | dh_md5sums
133 | dh_builddeb
134 |
135 | binary: binary-arch
136 | .PHONY: build clean binary-arch binary install build-arch build-indep
137 |
--------------------------------------------------------------------------------
/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/debian/startopts:
--------------------------------------------------------------------------------
1 | # Put options for gopherd in here. Set options to "" to not set
2 | # or follow the comments. If chroot is enabled, you wiill not be able
3 | # to use decoders unless you copy them under your gopher root. The
4 | # same goes for calling other scripts, and there may be logging
5 | # difficulties.
6 |
7 | # Set DONTCHROOT to -c if you don't want to use chroot.
8 |
9 | # DONTCHROOT="-c"
10 | DONTCHROOT=""
11 |
12 | # The username that you run gopher as. Leave blank to run as root.
13 |
14 | # USEUID=""
15 | USEUID="-u gopher"
16 |
17 | # The option file for gopher.
18 |
19 | OPTIONFILE="-o /etc/gopherd/gopherd.conf"
20 |
21 | # Logging. Set to the empty string to disable.
22 |
23 | #LOGGING=""
24 | LOGGING="-l /var/log/gopherd.log"
25 |
26 | # The home for gopher.
27 |
28 | GOPHERHOME="/var/gopher"
29 |
30 | # Gopher's port.
31 |
32 | GOPHERPORT="70"
33 |
34 | # Any other options to pass along.
35 |
36 | OTHEROPTS=""
37 |
--------------------------------------------------------------------------------
/doc/FAQ:
--------------------------------------------------------------------------------
1 | ----------------------------------------------
2 | Gopher/Gopherd FAQ
3 | $Id: FAQ,v 1.5 2002/03/19 17:51:18 jgoerzen Exp $
4 |
5 | This is the FAQ for gopher and UMN gopher.
6 |
7 | The latest version may be found at:
8 |
9 | gopher://quux.org/1m/devel/gopher/Downloads/LiveSource/gopher/doc/FAQ
10 |
11 | ----------------------------------------------
12 | What is Gopher?
13 |
14 | Well, it's a bit complicated. Gopher is all of these:
15 |
16 | 1. A protocol for an Internet world-wide hierarchial filesystem;
17 |
18 | 2. A client for using that protocol;
19 |
20 | 3. A site containing information in that protocol.
21 |
22 | Let's elaborate:
23 |
24 | #1. Gopher is a way to exchange information, similar to
25 | HTTP that is used for the web. Unlike HTTP, Gopher is simple and
26 | flexible yet rigid. Gopher mandates a hierarchial view of things --
27 | just like you get on your own system with files and folders.
28 | Gopher extends your desktop file/folder concept to include the
29 | entire Internet. You could have a folder whose contents come from
30 | 20 different countries, and it would all be transparent. Modern
31 | gopher browsers such as Nautilus support this very feature.
32 |
33 | #2. The "UMN Gopher" client was developed at the University of Minnesota,
34 | the home of gopher. Currently, the UMN Gopher client and UMN Gopherd server
35 | are maintained by John Goerzen and the Gopher Project; see
36 | gopher://quux.org/ for details.
37 |
38 | #3. When you publish information with Gopher, you're said to run a
39 | "gopher site" similar to running a "web site".
40 |
41 | ----------------------------------------------
42 | Where can I find gopher software?
43 |
44 | gopher://gopher.quux.org/11/Software/Gopher/Downloads
45 |
46 | If you do not already have Gopher, try:
47 |
48 | http://quux.org/hurg/hurg?selector=1%2FSoftware%2FGopher%2FDownloads&port=70&type=1&host=gopher.quux.org&username=Clients%2C+Servers%2C+and+Downloads
49 |
50 | Downloads of UMN gopher and other gopher projects hosted at quux.org are
51 | available at:
52 |
53 | gopher://gopher.quux.org/11/devel/gopher/Downloads
54 | http://quux.org/give-me-gopher/
55 |
56 | ----------------------------------------------
57 | Is there a mailing list?
58 |
59 | Yes.
60 |
61 | See gopher://gopher.quux.org/00/devel/gopher/Mailing%20List.txt for details.
62 | Or:
63 |
64 | To subscribe, send the text "Subscribe" in the subject of a mail to
65 | gopher-request@complete.org. To post, send the message to
66 | gopher@complete.org.
67 |
68 | Archives are at http://www.complete.org/mailinglist/archives/ and at
69 | gopher://gopher.quux.org/1/Archives/Mailing%20Lists/gopher.
70 |
71 | ----------------------------------------------
72 | [UMN] I'm having trouble compiling gopher(d)
73 |
74 | Where's gopherd?
75 |
76 | As of version 3.0.6, gopherd is deprecated. Please use PyGopherd instead.
77 | Information about PyGopherd is at http://quux.org/devel/gopher/pygopherd
78 |
79 |
--------------------------------------------------------------------------------
/doc/Makefile.in:
--------------------------------------------------------------------------------
1 | include ../Makefile.config
2 |
3 | TARGET = gopher.1 \
4 | gophfilt.1 gopherrc.5
5 |
6 | install: $(TARGET)
7 | @INSTALL@ -d -m 0755 $(MAN1DIR)
8 | @INSTALL@ -d -m 0755 $(MAN5DIR)
9 | @INSTALL@ -m 0644 gopher.1 $(MAN1DIR)
10 | @INSTALL@ -m 0644 gophfilt.1 $(MAN1DIR)
11 | @INSTALL@ -m 0644 gopherrc.5 $(MAN5DIR)
12 |
13 | all:
14 | $(NROFF) gopher.1 >gopher.cat
15 | $(NROFF) gophfilt.1 >gophfilt.cat
16 | $(NROFF) gopherrc.5 >gopherrc.cat
17 |
18 | clean:
19 | -rm -f *~
20 |
--------------------------------------------------------------------------------
/doc/PLATFORMS:
--------------------------------------------------------------------------------
1 | $Id: PLATFORMS,v 1.13 2002/03/20 02:44:51 jgoerzen Exp $
2 |
3 | These are the platforms on which gopher is known to work.
4 |
5 | Gopher should also work on any Unix/Posix platform (Solaris, SunOS, *BSD,
6 | Linux, MacOS X, etc). Please let us know if you have troubles compiling or
7 | running gopher on your platform by e-mailing gopher@complete.org.
8 |
9 | The second column in the list below indicates the latest version of gopher
10 | that someone has reported about.
11 |
12 | Thanks!
13 |
14 | jgoerzen@complete.org
15 |
16 |
17 | Platform Gopher Notes
18 | --------------------------- ------ -----------------------------------
19 | FreeBSD/i386 ?.? 3.0.1 requires gmake
20 |
21 | FreeBSD/i386 4.4 3.0.3 OK -- Kevin Griffin
22 |
23 | Linux/alpha 2.2 (Debian sid) 3.0.3 verified for each release by jgoerzen
24 |
25 | Linux/i386 2.2 (Debian sid) 3.0.3 OK -- John Goerzen
26 |
27 | Linux/ppc 2.4 (Debian sid) 3.0.3 OK -- John Goerzen
28 |
29 | Linux/i386 ?.? (Slackware) 3.0.1
30 |
31 | MacOSX/ppc 10.1 (Darwin) 3.0.4 use gnumake instead of gmake
32 | Build on UFS partition
33 | SEE NOTES BELOW
34 | OK -- John Goerzen
35 |
36 | NetBSD/i386 1.5ZA (-current) 3.0.4 verified for each release by jgoerzen
37 | requires gmake
38 |
39 | Solaris/i386 2. 3.0.2 OK -- Don Fike
40 |
41 | -----------
42 |
43 | If you want to use gopher on older platforms (VMS, Ultrix, etc), please
44 | check out the UMN gopher 2.3.1 distribution. Gopher 3 is not currently
45 | supporting VMS, though we have not removed the VMS support from the tree.
46 | (VMS hackers: help us out!)
47 |
48 | ** Special notes for Mac OS X / Darwin:
49 |
50 | Darwin appears to have some compatibility problems. Note that you must have
51 | the developer pack installed to build gopher. You must also use gnumake
52 | instead of make.
53 |
54 | Now here's the kicker -- If you are building on a HFS+ partition rather than
55 | a UFS one, the case-insensitivity in the operating system can cause
56 | problems. Build instead on a UFS partition. You can try this by using the
57 | Disk Copy tool to create a UFS playground within your HFS partition. Untar
58 | the gopher source tree on this UFS volume and build it there. Clint Paden
59 | reports that this will work.
60 |
--------------------------------------------------------------------------------
/doc/TODO:
--------------------------------------------------------------------------------
1 | --docs
2 | Make better documentation and man pages.
3 |
4 | Add docs about the hazards of chroot().
5 |
6 | --client
7 |
8 | Option for append, rather than overwriting saved files..
9 |
10 | Figure out exactly how to get line drawing characters on hpux and Ultrix...
11 |
12 | Add support for cursor keys for non vt100 on non System V curses machines
13 |
14 | Fix the telnet option so that it says Control-T on the RS/6k.
15 |
16 | Add 'L'anguage choice menu to non-VMS versions.
17 |
18 | Finish ANSI printing options
19 |
20 |
21 | --server
22 | Try to eliminate more lookups.
23 |
24 | Make SIGHUP reread the gopherd.conf file.
25 |
26 | Fix problems with .cap for -t para files.
27 |
28 | Fix problems with a viewext .doc and WAIS searches.
29 |
30 | Add caching and proxy code
31 |
32 |
33 | --index server
34 |
35 | Allow search on dates and date ranges.
36 |
37 |
--------------------------------------------------------------------------------
/doc/gopherrc.5:
--------------------------------------------------------------------------------
1 | .TH GOPHERRC 5
2 | .SH NAME
3 | gopherrc \- configuration file for gopher(1)
4 | .SH DESCRIPTION
5 | .LP
6 | The
7 | .B gopherrc
8 | file contains a list of directives that alter the behaviour of the
9 | .BR gopher(1)
10 | client. It is composed of lines of the form:
11 | .IP
12 | .I
13 | Token:\ Value
14 | .LP
15 | Tokens are case insensitive and the value field will change, depending on the
16 | token. A pound sign ("#") at the beginning of a line signifies a
17 | comment line.
18 |
19 | Gopherrc files are used in a number of places. There is a global
20 | gopherrc file (called gopherrc). This is usually placed in a
21 | systemwide directory. A file with the same format called
22 | remotegopher.rc is also used by the gopher client when using the -r
23 | switch.
24 |
25 | Also, an individual has their own customized version of this file in
26 | their home directory in the file .gopherrc. On VMS this file is called
27 | GOPHERRC.
28 |
29 | All of these files use the format described below.
30 |
31 | Most people will set the values in this file by pressing the 'O' key
32 | to set options in the curses gopher client, rather than editing this
33 | file directly. People considering editing this file on VMS should
34 | make sure their editor preserves the Stream_LF format of the file.
35 |
36 | .I
37 | Quick pseudo grammar
38 |
39 | .IP
40 | .nf
41 | map: ,,
42 | SearchBolding:
43 | Bookmarks:
44 |
45 |
46 | .fi
47 | .LP
48 |
49 | The following tokens are recognized
50 | .TP 12
51 | .I map:
52 | .LP
53 | maps a content type (such as text/plain, or image/gif) to commands to
54 | execute for displaying the document or printing the document, i.e.
55 | 'more -d %s' or 'lpr %s'.
56 |
57 | The content type, display command, and printing command are separated
58 | by commas.
59 |
60 | The sequence of %s is replaced with the filename of a temporary file
61 | containing the document to be printed or viewed.
62 |
63 | If the command starts with the vertical bar (|) the command will be
64 | executed immediately and the document will be sent to the commands
65 | standard input. Note this feature does not work on VMS.
66 |
67 | If the display command is set to 'builtin', then the text file pager
68 | inside the gopher client will be used to display the item.
69 |
70 | .TP 12
71 | .I SearchBolding:
72 | .LP
73 |
74 | controls the clients display of search terms. If the value is 'yes',
75 | then search words will be bolded. Otherwise they'll be left alone.
76 |
77 | .TP 12
78 | .I Bookmarks:
79 | .LP
80 | The bookmarks in .link format follow. For more information on the
81 | format of a .link file, consult the gopherd(8) manual page.
82 |
83 |
84 | .I
85 | Sample gopherrc file:
86 |
87 | map: text/plain,builtin,lpr %s
88 | map: image/gif,xv %s,
89 | Bookmarks:
90 | Type=1
91 | Name=Bookmark #1
92 | Host=gopher.tc.umn.edu
93 | Port=70
94 | Path=
95 | #
96 | Type=0+
97 | Name=textfile
98 | Host=foo.com
99 | Path=0/readme
100 | Port=70
101 | .
102 |
103 | .SH "SEE ALSO"
104 | .IR "Media Type Registration Procedure" ", March 1994, RFC 1590"
105 | .IR gopher(1), gopherd(8)
106 |
--------------------------------------------------------------------------------
/doc/gophfilt.1:
--------------------------------------------------------------------------------
1 | .TH GOPHFILT 1
2 | .SH NAME
3 | gophfilt \- oneshot connection to gopher document server
4 | .SH SYNOPSIS
5 | .B gophfilt
6 | .RI [ -t
7 | .IR type]
8 | .RI [ -p
9 | .IR path]
10 | .RI [ -h
11 | .IR host]
12 | .RI [ -s
13 | .IR port]
14 | .RI [ -i
15 | .IR item]
16 | .SH DESCRIPTION
17 | The gophfilt program is a oneshot command line driven version of a
18 | gopher client, suitable for use in shell- or awk-scripts.
19 | .PP
20 | The Internet Gopher is a distributed document delivery service. It
21 | allows a neophyte user to access various types of data residing on
22 | multiple hosts in a seamless fashion. This is accomplished by
23 | presenting the user a hierarchical arrangement of documents and by
24 | using a client-server communications model. The Internet Gopher
25 | Server accepts simple queries, and responds by sending the client a
26 | document.
27 | .PP
28 | Gophfilt can operate in either of two modes. The first one is in the
29 | spirit of unix filters, in that it accepts requests on stdin and writes
30 | results to stdout. The request is in the form of a tab-delimited .cache
31 | item. For example:
32 | .PP
33 | .RS 3
34 | 1Master Gopher at UMN 1/ gopher.tc.umn.edu 70
35 | .RE
36 | .PP
37 | (Or in string notation)
38 | .PP
39 | .RS 3
40 | "1Master Gopher at UMN\\t1/\\tgopher.tc.umn.edu\\t70\\n"
41 | .RE
42 | .PP
43 | This example would result in the retrieval of the root directory from
44 | the Master Gopher.
45 | .PP
46 | Gophfilt's other mode permits the construction of a gopher request from
47 | arguments provided on the command line. In this "manual" mode, at least
48 | the path and type items must be provided. The default host and port are
49 | taken from the file conf.h at module build time.
50 | .PP
51 | -p specifies the path to the requested data. From our "filter" example
52 | above, the field "1/" is the path.
53 | .PP
54 | -t specifies the type of the requested data. From our example above, the
55 | leading "1" character is the type (directory, in this case).
56 | .PP
57 | -h specifies the name of the host where the server is to be found. The
58 | default host (CLIENT1_HOST from file conf.h) is used if not provided.
59 | .PP
60 | -s specifies the service (port) that the server is monitoring. The
61 | default port (CLIENT1_PORT from file conf.h) is used if not provided.
62 | .PP
63 | -i specifies a search item. This field immediately follows the path
64 | field in the transmitted request.
65 | .PP
66 | -T specifies a receiver timeout in seconds. This is the maximum time
67 | that gophfilt will wait for more data. If the "timeout" return value
68 | is noticed by the calling program, any data received to that point
69 | should be considered suspect.
70 | .PP
71 | To recreate using manual operation the request from our example, one
72 | would execute the following command.
73 | .PP
74 | gophfilt -t 1 -p 1/ -h gopher.tc.umn.edu -s 70
75 | .PP
76 | .SH MORE EXAMPLES
77 | .PP
78 | Here is an example that demonstrates the usefulness of the gophfilt.
79 | This specific example only works on the Rutgers campus, but illustrates
80 | the point
81 | .PP
82 | gophfilt -t 0 -p "webster default SPELL" -i flatulence
83 | .RS 2
84 | -h hangout.rutgers.edu -s 770 | gophfilt
85 | .RE
86 | .PP
87 | This example requests a selector item from the Webster's Dictionary, and then
88 | pipes that item to gophfilt for subsequent retrieval of the actual definition.
89 | The result is available on stdout for use.
90 | .SH RETURNS
91 | Gophfilt returns the following completion codes on exit:
92 | .RS 4
93 | .PP
94 | 0 Successful completion.
95 | .RE
96 | .RS 3
97 | .PP
98 | -1 Error in parsing command line arguments.
99 | .PP
100 | -2 Manual operation and insufficient parameters were provided.
101 | .PP
102 | -3 Piped operation and unable to read selector from stdin.
103 | .PP
104 | -4 Unsupported item type requested.
105 | .PP
106 | -5 Unable to connect to specified host and port combination.
107 | .PP
108 | -6 Error encountered writing to stdout.
109 | .PP
110 | -7 Timeout occurred while waiting for more data.
111 | .RE
112 |
--------------------------------------------------------------------------------
/doc/object.changes:
--------------------------------------------------------------------------------
1 | Changes from 1.2b2 to 1.2b5
2 | ---------------------------
3 |
4 | * libgopher can now be built as Sun Shared Libraries.
5 |
6 | Changes from 1.2b1 to 1.2b2
7 | ---------------------------
8 |
9 | * Fixed problems with tmpnam() and warning for VIprettyLang()
10 |
11 | Changes from 1.03 to 1.1
12 | ------------------------
13 |
14 | * Made a new object DynArray. It's a neato dynamic array. I'll be
15 | using it more in other objects soon. Right now it's used in
16 | GopherDirObjs and the new site and ext code.
17 |
18 | * Fixed GDfromLink() It wasn't re-initializing after each GSfromLink().
19 |
20 | * GDsort() now does the comparisions for numbered entries. Much faster
21 | and cleaner looking code.
22 |
23 | * #undef boolean first in case we're building with WAIS (which has
24 | already #defined it).
25 |
26 | * Filenames are now less than 14 characters for those sysvr3 people.
27 |
28 | * Really revamped the way compatible.h and compatible.c work.
29 |
30 |
31 | Changes from 1.01 to 1.03
32 | -------------------------
33 |
34 | In accordance with the new Gopher+ the server doesn't tack scores on
35 | the end of directory listings resulting from searches.
36 |
37 | Changes from 1.0 to 1.01
38 | ------------------------
39 |
40 | Fixed problem with GDfromNet not returning the right number of items.
41 |
42 |
43 | Changes to 1.0
44 | --------------
45 |
46 | Fixed problem in GDfromNet() and GSfromNet() that didn't deal with
47 | directories that don't have objects of any known type. Fix from David
48 | Woodgate.
49 |
50 | Fixed problem in STRset() that could potentially cause crashes. The
51 | stored length was one greater than the actual length. Fix from Alan
52 | Tuchman.
53 |
54 | Fixed problem in sreadword() that compared a character with NULL,
55 | naughty naughty, it should have been '\0'.
56 |
57 | GDfromNet now takes an optional function parameter. Used by the nifty
58 | twirl code.
59 |
60 | Fixed problem in STRset() freeing blocks leftover from realloc is bad
61 | bongos.
62 |
63 | Removed most, if not all memory leaks. Yeah to support@purify.com!!
--------------------------------------------------------------------------------
/gopher/Makefile.in:
--------------------------------------------------------------------------------
1 | #********************************************************************
2 | # $Author: jgoerzen $
3 | # $Revision: 1.5 $
4 | # $Date: 2002/01/11 15:55:59 $
5 | # $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/Makefile.in,v $
6 | # $State: Exp $
7 | #
8 | # Paul Lindner, University of Minnesota CIS.
9 | #
10 | # Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | # see the file "Copyright" in the distribution for conditions of use.
12 | #********************************************************************
13 | # MODULE: Makefile
14 | # Makefile for gopher client
15 | #*********************************************************************
16 | # Revision History:
17 | # $Log: Makefile.in,v $
18 | # Revision 1.5 2002/01/11 15:55:59 jgoerzen
19 | # * Using $(INSTALL) from subdirectories broke on systems
20 | # where install-sh was used because $(INSTALL) would always
21 | # resolve to ./install-sh. Replaced all instances of
22 | # $(INSTALL) with @INSTALL@ (autoconf would provide the correct
23 | # path) and removed INSTALL from Makefile.config. Reported
24 | # by Don Fike on Solaris 2.6.
25 | # * Updated our copy of install-sh with the one from
26 | # a current automake.
27 | #
28 | # Revision 1.4 2002/01/09 16:35:25 jgoerzen
29 | # More bugfixing.
30 | #
31 | # Revision 1.3 2002/01/09 15:54:48 jgoerzen
32 | # Modifications to assist with installations
33 | #
34 | # Revision 1.2 2002/01/08 17:36:14 jgoerzen
35 | # Finally builds!
36 | #
37 | # Changes:
38 | #
39 | # * config.h.in: rebuilt by autoheader
40 | #
41 | # * configure: rebuilt by autoconf
42 | #
43 | # * configure.in:
44 | # * Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
45 | # * Added checkes for term.h, re_comp.h, regex.h
46 | #
47 | # * gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
48 | #
49 | # * gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
50 | # * Use REGEXLIBS
51 | #
52 | # * gopher/globals.h, gopher/gopher.c: Remove sys_errlist
53 | #
54 | # * object/GSgopherobj.c: Removed #include, now use
55 | # "Regex.h" that has proper regex determining logic
56 | #
57 | # * object/Regex.h: Moved regex.h include to here. Make it conditional
58 | # based on configure test. Add conditional re_comp.h include.
59 | #
60 | # Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
61 | # Import from UMN Gopher 2.3.1 after GPLization
62 | #
63 | # Revision 3.1 1996/01/04 18:29:18 lindner
64 | # Updates for autoconf
65 | #
66 | # Revision 3.14 1994/09/29 19:23:50 lindner
67 | # Make sure directories are made before installing
68 | #
69 | # Revision 3.13 1994/08/19 16:52:07 lindner
70 | # Make sure that gopher.o gets recompiled when patchlevel changes
71 | #
72 | # Revision 3.12 1994/07/19 19:29:40 lindner
73 | # Add INTLOPTS, add locales dir target for clean
74 | #
75 | # Revision 3.11 1994/07/03 21:35:42 lindner
76 | # Add upload option to code
77 | #
78 | # Revision 3.10 1994/05/26 19:41:14 lindner
79 | # Add yet another definition
80 | #
81 | # Revision 3.9 1994/04/25 20:47:22 lindner
82 | # Remove html stuff from menu
83 | #
84 | # Revision 3.8 1994/04/25 02:16:50 lindner
85 | # Fix for last line without newline
86 | #
87 | # Revision 3.7 1994/02/20 16:17:43 lindner
88 | # Add form object file
89 | #
90 | # Revision 3.6 1993/09/08 05:21:22 lindner
91 | # Add pager.c
92 | #
93 | # Revision 3.5 1993/08/04 22:06:35 lindner
94 | # Rebuild client if patchlevel.h changes
95 | #
96 | # Revision 3.4 1993/07/27 05:28:45 lindner
97 | # Mondo Debug overhaul from Mitra
98 | #
99 | # Revision 3.3 1993/04/15 21:28:25 lindner
100 | # Mods for remote access
101 | #
102 | # Revision 3.2 1993/02/19 21:03:13 lindner
103 | # Added stuff for global RC file.
104 | #
105 | # Revision 3.1.1.1 1993/02/11 18:02:57 lindner
106 | # Gopher+1.2beta release
107 | #
108 | # Revision 1.4 1993/02/09 21:34:47 lindner
109 | # Fixed install target
110 | #
111 | # Revision 1.3 1993/01/07 22:51:44 lindner
112 | # Added download.o to list of objects
113 | #
114 | # Revision 1.2 1992/12/31 04:01:06 lindner
115 | # moved html.c to html2.c for VMS
116 | #
117 | # Revision 1.1 1992/12/10 23:32:16 lindner
118 | # gopher 1.1 release
119 | #
120 | #********************************************************************/
121 |
122 |
123 | include ../Makefile.config
124 |
125 | srcdir = @srcdir@
126 | top_srcdir = @top_srcdir@
127 | VPATH = @srcdir@
128 |
129 | OBJS = manager.o gopher.o globals.o ourutils.o cso.o \
130 | subprocs.o html2.o CURcurses.o gopherrc.o \
131 | download.o pager.o form.o upload.o
132 |
133 | CCFLAGS = $(OPT) $(DEBUGGING) -I.. -I$(top_srcdir) -I$(top_srcdir)/object \
134 | $(INTLOPTS) $(CLIENTOPTS) -DGOPHERLIB=\"$(CLIENTLIB)\" \
135 | -DGOPHERHELP=\"$(CLIENTLIB)/gopher.hlp\" \
136 | -DGLOBALRC=\"$(CLIENTLIB)/gopher.rc\" \
137 | -DREMOTERC=\"$(CLIENTLIB)/gopherremote.rc\"
138 |
139 | TARGET = gopher
140 |
141 | all: $(TARGET)
142 |
143 | .c.o:
144 | $(CC) $(CCFLAGS) -c $<
145 |
146 | globals.o : $(srcdir)/globals.h $(srcdir)/version.h
147 |
148 | ../object/libgopher.a:
149 | (cd ..; $(MAKE) $(MFLAGS) objects)
150 |
151 | $(TARGET) : $(OBJS) ../object/libgopher.a
152 | $(CC) $(LDFLAGS) -o $@ $(OBJS) ../object/libgopher.a @CLIENTLIBS@ @REGEXLIBS@ @LIBS@
153 |
154 | install : all
155 | -mv $(CLIENTDIR)/$(TARGET) $(CLIENTDIR)/$(TARGET).old
156 | -mkdir $(CLIENTDIR)
157 | -mkdir $(CLIENTLIB)
158 | @INSTALL@ $(TARGET) $(CLIENTDIR)
159 | @INSTALL@ -d $(CLIENTLIB)
160 | @INSTALL@ gopher.rc $(CLIENTLIB)
161 | @INSTALL@ gopherremote.rc $(CLIENTLIB)
162 | @INSTALL@ gopher.hlp $(CLIENTLIB)
163 |
164 | clean:
165 | -rm -f $(TARGET) $(OBJS) *.out *~ core
166 | (cd locales; $(MAKE) $(MFLAGS) clean)
167 |
168 | $(OBJS): $(srcdir)/gopher.h $(top_srcdir)/conf.h
169 | globals.o: $(srcdir)/globals.h
170 | gopherrc.o: $(top_srcdir)/patchlevel.h
171 | manager.o: $(top_srcdir)/patchlevel.h
172 | gopher.o: $(top_srcdir)/patchlevel.h
173 |
174 |
--------------------------------------------------------------------------------
/gopher/compile.com:
--------------------------------------------------------------------------------
1 | $ vg = 'f$verify(0)'
2 | $!********************************************************************
3 | $! lindner
4 | $! 3.9
5 | $! 1993/09/21 01:48:04
6 | $! /home/mudhoney/GopherSrc/CVS/gopher+/gopher/compile.com,v
7 | $! Exp
8 | $!
9 | $! Paul Lindner, University of Minnesota CIS.
10 | $!
11 | $! Copyright 1991, 1992 by the Regents of the University of Minnesota
12 | $! see the file "Copyright" in the distribution for conditions of use.
13 | $!********************************************************************
14 | $! MODULE: compile.com
15 | $! compiling script for VMS gopher client
16 | $!*********************************************************************
17 | $! Revision History:
18 | $! compile.com,v
19 | $! Revision 3.9 1993/09/21 01:48:04 lindner
20 | $! Fix for alpha and curses
21 | $!
22 | $! Revision 3.8 1993/09/08 05:21:24 lindner
23 | $! Add pager.c
24 | $!
25 | $! Revision 3.7 1993/08/25 02:58:53 lindner
26 | $! Fix from Fote for vms make procedures
27 | $!
28 | $! Revision 3.6 1993/08/19 20:22:21 lindner
29 | $! mods for openvms
30 | $!
31 | $! Revision 3.5 1993/08/16 18:48:33 lindner
32 | $! Alpha and DECC mods
33 | $!
34 | $! Revision 3.4 1993/08/05 03:24:37 lindner
35 | $! Changes for CMUIP and NETLIB
36 | $!
37 | $! Revision 3.3 1993/06/22 06:12:53 lindner
38 | $! mods for DEC C
39 | $!
40 | $! Revision 3.2 1993/05/20 06:02:51 lindner
41 | $! updates for VMS compatibility
42 | $!
43 | $! Revision 3.1.1.1 1993/02/11 18:02:56 lindner
44 | $! Gopher+1.2beta release
45 | $!
46 | $! Revision 1.2 1993/01/07 22:51:06 lindner
47 | $! Added download.c
48 | $!
49 | $! Revision 1.1 1992/12/31 06:08:20 lindner
50 | $! Initial revision
51 | $!
52 | $!
53 | $!********************************************************************/
54 | $!
55 | $ IF P1 .EQS. ""
56 | $ THEN
57 | $ type/nopage sys$input:
58 | Usage:
59 | @compile UCX
60 | @compile WOLLONGONG
61 | @compile MULTINET
62 | @compile CMUIP
63 | @compile NETLIB
64 | @compile TCPWARE
65 | $ exit
66 | $ ENDIF
67 | $ IF P2 .EQS. "DEBUG"
68 | $ THEN
69 | $ write sys$output "Compiling client with DEBUG..."
70 | $ debug := "/debug/noopt"
71 | $ ELSE
72 | $ debug := ""
73 | $ ENDIF
74 | $!
75 | $ ON CONTROL_Y THEN GOTO CLEANUP
76 | $ ON ERROR THEN GOTO CLEANUP
77 | $!
78 | $ IF P1 .eqs. "TCPWARE"
79 | $ THEN
80 | $ write sys$output "Compiling client with UCX emulation..."
81 | $ transport := "UCX"
82 | $ ELSE
83 | $ transport := "''P1'"
84 | $ ENDIF
85 | $!
86 | $ IF f$trnlnm("VAXCMSG") .eqs. "DECC$MSG" .or. -
87 | f$trnlnm("DECC$CC_DEFAULT") .eqs. "/DECC"
88 | $ THEN
89 | $ vg1 = f$verify(1)
90 | $! DECC:
91 | $ define/nolog C$USER_INCLUDE [-],[-.object]
92 | $ define/nolog DECC$USER_INCLUDE [-],[-.object]
93 | $ vg1 = 'f$verify(0)'
94 | $ IF transport .eqs. "UCX"
95 | $ THEN
96 | $ vg1 = f$verify(1)
97 | $ cc := cc/prefix=(all,except=(setlocale))-
98 | /warning=(disable=implicitfunc)-
99 | /define=('transport'=1,__VMS_CURSES)'debug'
100 | $ vg1 = 'f$verify(0)'
101 | $ ELSE
102 | $ vg1 = f$verify(1)
103 | cc := cc/prefix=(all,except=(connect,gethostbyname,htons,inet_addr,-
104 | setsockopt,socket,setlocale))-
105 | /warning=(disable=implicitfunc)-
106 | /define=('transport'=1,__VMS_CURSES)'debug'
107 | $ vg1 = 'f$verify(0)'
108 | $ ENDIF
109 | $ ELSE
110 | $ vg1 = f$verify(1)
111 | $! VAXC:
112 | $ cc := cc/include=([-],[-.object])-
113 | /define=('transport'=1)'debug'
114 | $ vg1 = 'f$verify(0)'
115 | $ ENDIF
116 | $ vg1 = f$verify(1)
117 | $!
118 | $ cc cso.c
119 | $ cc curcurses.c
120 | $ cc globals.c
121 | $ cc gopher.c
122 | $ cc gopherrc.c
123 | $ cc html2.c
124 | $ cc manager.c
125 | $ cc ourutils.c
126 | $ cc subprocs.c
127 | $ cc download.c
128 | $ cc pager.c
129 | $ cc form.c
130 | $ cc upload.c
131 | $!
132 | $ vg1 = 'f$verify(0)'
133 | $ IF P2 .eqs. "DEBUG"
134 | $ THEN
135 | $ vg1 = f$verify(1)
136 | $ rename/nolog/noconf *.obj; *.objd
137 | $ vg1 = 'f$verify(0)'
138 | $ ENDIF
139 | $!
140 | $ CLEANUP:
141 | $ vg1 = f$verify(vg)
142 | $exit
143 |
--------------------------------------------------------------------------------
/gopher/cso.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: s2mdalle $
3 | * $Revision: 1.2 $
4 | * $Date: 2001/01/03 22:27:10 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/cso.c,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: cso.c
14 | * Functions to support CSO qi/ph servers
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: cso.c,v $
18 | * Revision 1.2 2001/01/03 22:27:10 s2mdalle
19 | * Inclusion of the new header cso.h that holds prototypes for this module.
20 | *
21 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
22 | * Import from UMN Gopher 2.3.1 after GPLization
23 | *
24 | * Revision 3.14 1995/11/03 21:18:16 lindner
25 | * ANSIfication
26 | *
27 | * Revision 3.13 1994/05/19 14:07:22 lindner
28 | * use fast malloc on VMS VAXC
29 | *
30 | * Revision 3.12 1994/05/17 05:47:53 lindner
31 | * Massive internationalization change
32 | *
33 | * Revision 3.11 1994/05/14 04:13:38 lindner
34 | * Internationalization...
35 | *
36 | * Revision 3.10 1994/03/04 23:35:17 lindner
37 | * fix cso requester to be nice and big
38 | *
39 | * Revision 3.9 1994/02/20 16:30:36 lindner
40 | * Use FileIO routines for fetching fields
41 | *
42 | * Revision 3.8 1994/01/20 06:47:01 lindner
43 | * Fix params for showfile
44 | *
45 | * Revision 3.7 1993/10/22 20:21:02 lindner
46 | * misc fixes
47 | *
48 | * Revision 3.6 1993/10/11 04:44:09 lindner
49 | * Add early searching.. tag for CSO, better ui
50 | *
51 | * Revision 3.5 1993/10/07 05:11:22 lindner
52 | * Better memory management
53 | *
54 | * Revision 3.4 1993/07/07 19:42:15 lindner
55 | * fix for cancel from cso screen
56 | *
57 | * Revision 3.3 1993/06/08 06:31:01 lindner
58 | * Fixed infamous cached cso search, added fishing mode
59 | *
60 | * Revision 3.2 1993/05/20 06:00:38 lindner
61 | * Better cso support, fixed bug with unchangable search
62 | *
63 | * Revision 3.1.1.1 1993/02/11 18:02:57 lindner
64 | * Gopher+1.2beta release
65 | *
66 | * Revision 1.4 1993/01/08 19:43:01 lindner
67 | * dialog box cancels automatically if the user doesn't enter anything.
68 | *
69 | * Revision 1.3 1992/12/31 05:53:01 lindner
70 | * Mods for VMS
71 | *
72 | * Revision 1.2 1992/12/28 19:02:58 lindner
73 | * Changed field selection criteria to be based on "Lookup"
74 | * not "Indexed". Removed old dead static variables.
75 | * Changed the name of the popup box from "Ph Query" to the
76 | * name of the gopher item.
77 | *
78 | * Revision 1.1 1992/12/10 23:32:16 lindner
79 | * gopher 1.1 release
80 | *
81 | *********************************************************************/
82 |
83 | #include "gopher.h"
84 | #include "fileio.h"
85 | #include "Malloc.h"
86 | #include "cso.h"
87 |
88 | void
89 | do_cso(GopherStruct *ZeGopher)
90 | {
91 | char inputline[1024], *cp;
92 | int sockfd, len, numfields=0;
93 | char *Fields[50];
94 | char *Responses[50];
95 | char query[512];
96 | int i;
97 | FileIO *sock;
98 |
99 | Draw_Status(Gtxt("Fetching Fields...",87));
100 | refresh();
101 |
102 | /*** Fetch the indexed fields from the server ***/
103 | if ((sockfd = GSconnect(ZeGopher)) <0) {
104 | check_sock(sockfd, GSgetHost(ZeGopher), GSgetPort(ZeGopher));
105 | return;
106 | }
107 |
108 | sock = FIOopenfd(sockfd, TRUE);
109 |
110 | FIOwritestring(sock, "fields\r\n");
111 |
112 | while (1) {
113 | len = FIOreadline(sock, inputline, 1024);
114 | twirl();
115 | if ((len <= 0) || (strncmp(inputline, "200", 3)==0))
116 | break;
117 |
118 | cp = inputline;
119 | if (strstr(inputline, "Lookup") == NULL)
120 | continue;
121 |
122 | cp = strrchr(inputline,':');
123 | *cp = '\0';
124 | cp--;
125 | cp = strrchr(inputline, ':') + 1;
126 |
127 | /*** Put name at the top ***/
128 | if (strcmp(cp, "name") == 0 && numfields != 0) {
129 | Fields[numfields] = Fields[0];
130 | Fields[0] = strdup(cp);
131 | }
132 | else
133 | Fields[numfields] = strdup(cp);
134 |
135 | Responses[numfields] = (char *) malloc(sizeof(char) * COLS);
136 | *Responses[numfields] = '\0';
137 | *(Responses[numfields]+1) = '\0';
138 | numfields++;
139 | }
140 | Fields[numfields] = NULL;
141 | Responses[numfields] = NULL;
142 |
143 | FIOwritestring(sock, "quit\r\n");
144 | /** Read the stupid bye message **/
145 | FIOreadline(sock, inputline, 1024);
146 | FIOclose(sock);
147 |
148 | /*** Do cso stuff until user presses CTRL-G ***/
149 | while (1) {
150 | clear();
151 | Draw_Status("...");
152 |
153 | refresh();
154 |
155 | if (CURRequest(CursesScreen, GSgetTitle(ZeGopher), Fields, Responses) < 0) {
156 |
157 | /*** Free the memory that we just allocated ***/
158 |
159 | for (i=0; i 6)
188 | GSsetPath(ZeGopher, query);
189 | else {
190 | for (i=0; i
3 | * Simple prototypes for functions in cso.c
4 | */
5 |
6 | #define CSO_H 1
7 |
8 | void do_cso(GopherStruct *ZeGopher);
9 |
--------------------------------------------------------------------------------
/gopher/download.h:
--------------------------------------------------------------------------------
1 | /* download.h
2 | * Written by David Allen
3 | * Simple prototypes for functions in download.c
4 | */
5 |
6 | #define DOWNLOAD_H 1
7 |
8 | #ifndef OURUTILS_H
9 | # include "ourutils.h"
10 | #endif /* OURUTILS_H */
11 |
12 | void Download_file(GopherObj *gs);
13 | void BuiltinDownload(char *dirname);
14 |
--------------------------------------------------------------------------------
/gopher/form.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: s2mdalle $
3 | * $Revision: 1.2 $
4 | * $Date: 2001/01/03 22:29:00 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/form.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 92, 93, 94 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: form.h
14 | * Abstraction of form definition and management functions
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: form.h,v $
18 | * Revision 1.2 2001/01/03 22:29:00 s2mdalle
19 | * Compiler warning fixes, includes, etc.
20 | *
21 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
22 | * Import from UMN Gopher 2.3.1 after GPLization
23 | *
24 | * Revision 3.3 1995/11/03 21:18:17 lindner
25 | * ANSIfication
26 | *
27 | * Revision 3.2 1994/07/03 23:10:58 lindner
28 | * fix forms..
29 | *
30 | * Revision 3.1 1994/02/20 16:15:46 lindner
31 | * New form definition and management functions
32 | *
33 | *
34 | *********************************************************************/
35 |
36 | #include "String.h"
37 | #include "DAarray.h"
38 | #include "STAarray.h"
39 | #include "boolean.h"
40 | #include "CURcurses.h"
41 |
42 | /*
43 | * An ITEM is a single UI control type thing.. Examples include labels,
44 | * choose items, etc..
45 | */
46 |
47 | typedef enum {ITEM_UNINIT, ITEM_LABEL, ITEM_PROMPT, ITEM_CHOICE,
48 | ITEM_SELECT, ITEM_PASSWD, ITEM_LONG, ITEM_FILENAME}
49 | ITEMtype;
50 |
51 | typedef struct ITEM_struct {
52 | ITEMtype type;
53 | String *label;
54 | String *response;
55 |
56 | int chooseitem;
57 | StrArray *choices;
58 | } ITEM;
59 |
60 |
61 | #define ITEMsetPrompt(f,l) (STRset((f)->label,(l)))
62 | #define ITEMgetPrompt(f) (STRget((f)->label))
63 |
64 | #define ITEMgetType(f) ((f)->type)
65 | #define ITEMsetType(f,t) ((f)->type = (t))
66 |
67 | #define ITEMsetLabel(f,l) (STRset((f)->label,(l)))
68 | #define ITEMgetLabel(f) (STRget((f)->label))
69 |
70 | #define ITEMgetResponse(f) (STRget((f)->response))
71 | #define ITEMsetResponse(f,r) (STRset((f)->response,(r)))
72 |
73 | #define ITEMgetChoice(f) ((f)->chooseitem)
74 | #define ITEMsetChoice(f,c) ((f)->chooseitem=(c))
75 |
76 | #define ITEMgetChoiceNum(f,i) (STAgetText((f)->choices,i))
77 | #define ITEMgetNumChoices(i) (STAgetTop((i)->choices))
78 |
79 | ITEM *ITEMnew(void);
80 | void ITEMinit(ITEM *item);
81 | ITEM *ITEMcpy(ITEM *dest, ITEM *orig);
82 | void ITEMdestroy(ITEM *item);
83 | void ITEMpushChoice(ITEM *item, char *choice);
84 |
85 | /********************************************************************
86 | *
87 | * A FORM is an array of items
88 | *
89 | */
90 |
91 | typedef DynArray FORM;
92 | #define FORMnew(a) (DAnew((a),ITEMnew,ITEMinit,ITEMdestroy,ITEMcpy))
93 | #define FORMinit(a) (DAinit((a)))
94 | #define FORMgetTop(a) (DAgetTop(a))
95 | #define FORMgetEntry(a,b) (ITEM*)(DAgetEntry(a,b))
96 |
97 | #define FORMpush(a,b) (DApush((DynArray*)(a),(b)))
98 | #define FORMpop(a) (FORM*)(DApop(a))
99 | #define FORMdestroy(a) (DAdestroy(a))
100 | #define FORMcpy(a,b) (DAcpy(a,b))
101 |
102 | int CURform(CursesObj *cur, char *Wintitle, FORM *form);
103 |
104 | boolean FORMaddLabel(FORM *form, char *label);
105 | boolean FORMaddPrompt(FORM *form, char *prompt, char *defval);
106 | boolean FORMaddPasswd(FORM *form, char *prompt, char *defval);
107 | boolean FORMaddFilechoice(FORM *form, char *prompt, char *defval);
108 | boolean FORMaddLong(FORM *form, char *prompt, char *defval);
109 | boolean FORMaddChoice(FORM *form, char *prompt, char **choices, int defval);
110 | boolean FORMaddSelect(FORM *form, char *prompt, int defval);
111 | char **FORMdoAskBlock();
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/gopher/globals.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * lindner
3 | * 3.1.1.1
4 | * 1993/02/11 18:02:57
5 | * /home/mudhoney/GopherSrc/CVS/gopher+/gopher/globals.c,v
6 | * $Status: $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: globals.c
14 | * Where global variables are actually stuck into a .o file. See
15 | * globals.h for the actual variables.
16 | *********************************************************************
17 | * Revision History:
18 | * globals.c,v
19 | * Revision 3.1.1.1 1993/02/11 18:02:57 lindner
20 | * Gopher+1.2beta release
21 | *
22 | * Revision 1.1 1992/12/10 23:32:16 lindner
23 | * gopher 1.1 release
24 | *
25 | * Revision 1.1 1992/12/10 06:16:51 lindner
26 | * Initial revision
27 | *
28 | *
29 | *********************************************************************/
30 |
31 |
32 | #define EXTERN
33 | #include "gopher.h"
34 |
--------------------------------------------------------------------------------
/gopher/globals.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.4 $
4 | * $Date: 2002/01/08 17:36:14 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/globals.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: globals.h
14 | * Global variables and #defines
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: globals.h,v $
18 | * Revision 1.4 2002/01/08 17:36:14 jgoerzen
19 | * Finally builds!
20 | *
21 | * Changes:
22 | *
23 | * * config.h.in: rebuilt by autoheader
24 | *
25 | * * configure: rebuilt by autoconf
26 | *
27 | * * configure.in:
28 | * * Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
29 | * * Added checkes for term.h, re_comp.h, regex.h
30 | *
31 | * * gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
32 | *
33 | * * gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
34 | * * Use REGEXLIBS
35 | *
36 | * * gopher/globals.h, gopher/gopher.c: Remove sys_errlist
37 | *
38 | * * object/GSgopherobj.c: Removed #include, now use
39 | * "Regex.h" that has proper regex determining logic
40 | *
41 | * * object/Regex.h: Moved regex.h include to here. Make it conditional
42 | * based on configure test. Add conditional re_comp.h include.
43 | *
44 | * Revision 1.3 2001/01/17 21:48:05 jgoerzen
45 | * Many fixes and tune-ups. Now compiles cleanly with -Wall -Werror!
46 | *
47 | * Revision 1.2 2000/08/19 00:43:59 jgoerzen
48 | * Fix to use linux standard sys_errlist
49 | *
50 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
51 | * Import from UMN Gopher 2.3.1 after GPLization
52 | *
53 | * Revision 3.20 1995/11/03 21:18:17 lindner
54 | * ANSIfication
55 | *
56 | * Revision 3.19 1995/05/01 05:41:30 lindner
57 | * compatibility fixes
58 | *
59 | * Revision 3.18 1995/05/01 03:42:08 lindner
60 | * Fixes for NetBSD
61 | *
62 | * Revision 3.17 1995/04/15 07:08:17 lindner
63 | * none
64 | *
65 | * Revision 3.16 1994/07/06 15:38:54 lindner
66 | * Add setlocale_langdir
67 | *
68 | * Revision 3.15 1994/06/29 07:07:56 lindner
69 | * moved gcatd to Locale.[ch] (Coopersmith)
70 | *
71 | * Revision 3.14 1994/05/17 05:47:55 lindner
72 | * Massive internationalization change
73 | *
74 | * Revision 3.13 1994/03/04 23:36:33 lindner
75 | * remove MAXRESP define
76 | *
77 | * Revision 3.12 1993/09/29 20:51:44 lindner
78 | * add declaration of CleanupandExit()
79 | *
80 | * Revision 3.11 1993/08/16 18:19:32 lindner
81 | * VMS special interrupt and subprocess handling vars
82 | *
83 | * Revision 3.10 1993/08/16 17:58:19 lindner
84 | * Removed REMOTEUSER ifdefs
85 | *
86 | * Revision 3.9 1993/08/03 20:48:21 lindner
87 | * Audio file fix from jqj
88 | *
89 | * Revision 3.8 1993/08/03 20:24:16 lindner
90 | * Bigger Better Badder Options, inspired by jqj
91 | *
92 | * Revision 3.7 1993/07/27 05:28:46 lindner
93 | * Mondo Debug overhaul from Mitra
94 | *
95 | * Revision 3.6 1993/07/23 04:36:59 lindner
96 | * Added a Jmpenv variable for longjmp
97 | *
98 | * Revision 3.5 1993/07/20 23:11:56 lindner
99 | * Got rid of versionline
100 | *
101 | * Revision 3.4 1993/06/08 06:33:07 lindner
102 | * Updated version number
103 | *
104 | * Revision 3.3 1993/04/15 21:28:27 lindner
105 | * Mods for remote access
106 | *
107 | * Revision 3.2 1993/03/24 16:57:51 lindner
108 | * New version#
109 | *
110 | * Revision 3.1.1.1 1993/02/11 18:02:57 lindner
111 | * Gopher+1.2beta release
112 | *
113 | *********************************************************************/
114 |
115 | #include
116 |
117 | #define WHOLELINE 80 /* Used in ourutil.c */
118 |
119 | /*
120 | * These are some funky defines that assures that global variables are
121 | * declared only once. (when globals.c includes this file with EXTERN
122 | * defined.
123 | */
124 |
125 | #ifndef EXTERN
126 | #define EXTERN extern
127 | #define INIT(x)
128 | #else
129 | #define EXTERN
130 | #define INIT(x) =(x)
131 | #endif
132 |
133 | /*** Global variables ***/
134 | EXTERN RCobj *GlobalRC;
135 |
136 | EXTERN boolean ChangedDefs INIT(FALSE);
137 |
138 | EXTERN char *Searchstring INIT(NULL);
139 | EXTERN int iLevel INIT(0);
140 | EXTERN BOOLEAN SecureMode INIT(FALSE);
141 | EXTERN BOOLEAN NoShellMode INIT(FALSE);
142 | EXTERN BOOLEAN RemoteUser INIT(FALSE);
143 |
144 | EXTERN GopherDirObj *CurrentDir INIT(NULL);
145 | EXTERN GopherDirObj *OldDirs[30]; /** Should be a stack... **/
146 |
147 | EXTERN GopherDirObj *BookmarkDir INIT(NULL);
148 |
149 | EXTERN char USERCAP[WHOLELINE]; /* The validated user capability */
150 | EXTERN int SOUNDCHILD INIT(0); /* The pid of the sound player child. */
151 | EXTERN CursesObj *CursesScreen;
152 |
153 | EXTERN char *Gopenfile INIT(NULL);
154 |
155 | #if defined(VMS) && defined(A_LANGUAGE)
156 | EXTERN GopherDirObj *setlocale_LangDir INIT(NULL);
157 | #endif
158 |
159 | #ifndef VMS
160 | extern int errno;
161 | #endif
162 |
163 | /*** Externals ***/
164 |
165 | #ifndef VMS
166 | extern char **environ; /* User environment array */
167 | #endif
168 |
169 | /*** VMS needs special interrupt and subprocess handling ***/
170 |
171 | #ifdef VMS
172 | void (*VMSsignal(/* int, void (*) () */)) (int);
173 | #define signal(a,b) VMSsignal(a,b)
174 | EXTERN boolean HadVMSInt INIT(FALSE);
175 | int DCLsystem(/* char* */);
176 | #define system(a) DCLsystem(a)
177 | #endif
178 |
179 | /*** Prototypes and forward declarations ***/
180 |
181 | /*** Ourutils.c ***/
182 | void display_file(/* char *Filename */);
183 | void ZapCRLF(char *);
184 | int outchar(int c);
185 | void CursesErrorMsg(char *Message);
186 | void GetOneOption(/* char*, char* */);
187 |
188 | int process_request(GopherObj *ZeGopher);
189 | int Load_Dir(GopherObj *ZeGopher);
190 | int Load_Index(GopherObj *ZeGopher);
191 | int Load_Index_or_Dir(GopherObj *ZeGopher, char *Searchmungestr);
192 | void GetOneOption(/* */);
193 | void check_sock(int sockfd, char *host, int port);
194 | char *Choose_View(GopherObj *gs);
195 | char **AskBlock(GopherObj *gs);
196 | void CleanupandExit(int exitval);
197 |
198 |
--------------------------------------------------------------------------------
/gopher/gopher.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: s2mdalle $
3 | * $Revision: 1.3 $
4 | * $Date: 2001/01/03 22:29:33 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/gopher.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: gopher.h
14 | * Header file for Gopher client.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: gopher.h,v $
18 | * Revision 1.3 2001/01/03 22:29:33 s2mdalle
19 | * Added a bunch of includes, prototypes, compiler warning fixes.
20 | *
21 | * Revision 1.2 2000/12/27 21:25:59 s2mdalle
22 | * Added CleanupandExit prototype and an include for CUR* functions
23 | *
24 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
25 | * Import from UMN Gopher 2.3.1 after GPLization
26 | *
27 | * Revision 3.5 1995/02/27 17:09:51 lindner
28 | * Add Pacbell NOBANNER patch
29 | *
30 | * Revision 3.4 1994/05/02 07:40:17 lindner
31 | * Mods to use setlocale()
32 | *
33 | * Revision 3.3 1994/04/25 03:37:40 lindner
34 | * Modifications for Debug() and mismatched NULL arguments, added Debugmsg
35 | *
36 | * Revision 3.2 1993/09/29 20:52:08 lindner
37 | * remove dead code
38 | *
39 | * Revision 3.1.1.1 1993/02/11 18:02:58 lindner
40 | * Gopher+1.2beta release
41 | *
42 | * Revision 2.1 1993/02/09 22:34:58 lindner
43 | * Stuff for RC
44 | *
45 | * Revision 1.2 1992/12/31 04:30:03 lindner
46 | * mods for VMS
47 | *
48 | * Revision 1.1 1992/12/10 23:32:16 lindner
49 | * gopher 1.1 release
50 | *
51 | *********************************************************************/
52 |
53 |
54 | /*** All our mongo include files ***/
55 | #include
56 |
57 | /*** Set global configuration options early ***/
58 | #include "conf.h"
59 |
60 | #ifdef VMS
61 | #include
62 | #define MAXPATHLEN FILENAME_MAX
63 | #endif
64 |
65 | #include "Stdlib.h"
66 | #include
67 | #include
68 | #include "String.h"
69 | #include "Locale.h"
70 | #include
71 | #include
72 |
73 |
74 | #ifdef VMS /** VMS does't do slashes **/
75 | #include
76 |
77 | #else /* not VMS */
78 |
79 | #include
80 |
81 | #include
82 | #include
83 |
84 | #ifdef M_XENIX /* SCO Xenix/UNIX */
85 | #define MAXPATHLEN FILENAME_MAX
86 | #include
87 | #include
88 | #include
89 | #else
90 | #include
91 | #endif
92 |
93 | #endif /* not VMS */
94 |
95 | #define HALFLINE 40
96 | #define MAXSTR 200 /* Arbitrary maximum string length */
97 |
98 | /** Include definitions for our psuedo-objects. **/
99 |
100 | #include "CURcurses.h"
101 | #include "boolean.h"
102 | #include "STRstring.h"
103 | #include "GDgopherdir.h"
104 | #include "compatible.h"
105 | #include "util.h"
106 | #include "gopherrc.h"
107 |
108 | #ifdef NOBANNER
109 | # define TITLEPOS 0
110 | #else
111 | # define TITLEPOS 2
112 | #endif
113 |
114 | /* Prototypes */
115 | RETSIGTYPE CleanupandExit(int exitval);
116 | void showfile(GopherObj *ZeGopher);
117 |
118 | /** Get the configuration variables **/
119 |
120 | #include "globals.h"
121 | #include "gopherrc.h"
122 | #include "ourutils.h"
123 | #include "manager.h"
124 | #include "cso.h"
125 | #include "html2.h"
126 | #include "CURcurses.h"
127 |
--------------------------------------------------------------------------------
/gopher/gopher.hlp:
--------------------------------------------------------------------------------
1 | Quick Gopher Help
2 | -----------------
3 |
4 | Moving around Gopherspace
5 | -------------------------
6 | Use the arrow keys or vi/emacs equivalent to move around.
7 |
8 | Right, Return .......: "Enter"/Display current item.
9 | Left, u .............: "Exit" current item/Go up a level.
10 | Down ................: Move to next line.
11 | Up ..................: Move to previous line.
12 | >, +, Pgdwn, Space ..: View next page.
13 | <, -, Pgup, b .......: View previous page.
14 | 0-9 .................: Go to a specific line.
15 | m ...................: Go back to the main menu.
16 |
17 | Bookmarks
18 | ---------
19 | a : Add current item to the bookmark list.
20 | A : Add current directory/search to bookmark list.
21 | v : View bookmark list.
22 | d : Delete a bookmark/directory entry.
23 |
24 | Other commands
25 | --------------
26 | q : Quit with prompt.
27 | Q : Quit unconditionally.
28 | s : Save current item to a file.
29 | S : Save current menu listing to a file.
30 | D : Download a file.
31 | r : goto root menu of current item.
32 | R : goto root menu of current menu.
33 | = : Display technical information about current item.
34 | ^ : Display technical information about current directory.
35 | o : Open a new gopher server.
36 | O : Change options.
37 | f : Connect to an anonymous FTP server.
38 | w : Connect to an http, gopher, FTP, telnet or tn3270 URL
39 | / : Search for an item in the menu.
40 | n : Find next search item.
41 | g : "Gripe" via email to administrator of current item.
42 | L : Change language of messages (VMS).
43 | !, $ : Shell Escape (Unix) or Spawn subprocess (VMS).
44 | Ctrl-L, Ctrl-R, Ctrl-W : Redraw (Wipe) the screen.
45 | Ctrl-T : Show host's local date and time.
46 |
47 | Gopher objects:
48 | Item tag Type Description
49 | --------------------------------------------
50 | (none) 0 file
51 | / 1 directory
52 | <) s sound file
53 | I,g image file
54 | ; movie file
55 | 4 BinHexed Macintosh file
56 | 9 binary file
57 | 5 DOS binary file
58 | 2 CSO (ph/qi) phone-book server
59 | 8 telnet connection
60 | <3270> T telnet connection (IBM 3270 emulation)
61 | M Multi-purpose Internet Mail Extensions file
62 | h HyperText Markup Language file
63 | > 7 index-search item
64 | ?> (none) ASK form
65 |
66 | The Gopher development team hopes that you find this software useful.
67 | If you find what you think is a bug, please report it to us by sending
68 | e-mail to "gopher@complete.org".
69 |
--------------------------------------------------------------------------------
/gopher/gopher.rc:
--------------------------------------------------------------------------------
1 | #********************************************************************
2 | # $Author: jgoerzen $
3 | # $Revision: 1.1 $
4 | # $Date: 2000/08/19 00:28:56 $
5 | # $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/gopher.rc,v $
6 | # $State: Exp $
7 | #
8 | # Paul Lindner, University of Minnesota CIS.
9 | #
10 | # Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | # see the file "Copyright" in the distribution for conditions of use.
12 | #********************************************************************
13 | # MODULE: gopher.rc
14 | # Global rc file for gopher client
15 | #*********************************************************************
16 | # Revision History:
17 | # $Log: gopher.rc,v $
18 | # Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | # Initial revision
20 | #
21 | # Revision 3.12 1995/02/27 17:43:43 lindner
22 | # Add support for RIP graphics (from PACbell)
23 | #
24 | # Revision 3.11 1995/01/20 04:53:19 lindner
25 | # Fix for jpeg, tiff display..
26 | #
27 | # Revision 3.10 1994/09/29 19:24:18 lindner
28 | # Fix for image/gif xv launcher in default config
29 | #
30 | # Revision 3.9 1994/06/09 04:20:32 lindner
31 | # make searchbolding the default, add note for vms admins
32 | #
33 | # Revision 3.8 1994/03/04 23:42:32 lindner
34 | # Fix for more content types
35 | #
36 | # Revision 3.7 1993/08/12 06:32:43 lindner
37 | # Fix for x-troff
38 | #
39 | # Revision 3.6 1993/07/27 05:28:50 lindner
40 | # Mondo Debug overhaul from Mitra
41 | #
42 | # Revision 3.5 1993/07/23 04:36:21 lindner
43 | # Postscript printing mods
44 | #
45 | # Revision 3.4 1993/04/15 21:28:11 lindner
46 | # Mods for richtext
47 | #
48 | # Revision 3.3 1993/02/19 21:08:58 lindner
49 | # Added audio/mulaw, and changed defs for gif and ppm to use the '|'
50 | # command.
51 | #
52 | # Revision 3.2 1993/02/18 23:37:27 lindner
53 | # Added header info...
54 | #
55 | #
56 | # Map gopher+ types to local commands
57 | #
58 | # format is:
59 | # map: gplusview,view command,printcommand
60 | #
61 | # make sure you eliminate piping and modify the printcommands on VMS
62 | # comment out maps which don't apply on your system, or set them to ",,"
63 | #
64 | map: text/html,lynx -force_html %s,lynx -force_html -dump %s | lpr
65 | map: text/plain,builtin,lpr %s
66 | map: text/richtext,richtext %s|Less -f -r,lpr %s
67 | map: text/rip,showrip %s,lpr %s
68 | map: text/tab-separated-values,builtin,lpr %s
69 | map: text/x-dvi,xdvi %s,lpr %s
70 | map: text/x-tex,,
71 | map: text/x-troff,nroff %s|more -d,ptroff %s
72 | map: message/rfc822,builtin,lpr %s
73 | map: image/gif,|xv -,|giftoppm |pnmtops | lpr
74 | map: image/ief,,
75 | map: image/jpeg,,
76 | map: image/ppm,|xv -,|pnmtops | lpr
77 | map: image/tiff,tifftopnm|xv -,tifftopnm|pnmtops|lpr
78 | map: audio/basic,|play -v 40 -&,
79 | map: video/mpeg,,
80 | map: video/quicktime,,
81 | map: application/applefile,,
82 | map: application/dca-rft,,
83 | map: application/mac-binhex40,,
84 | map: application/macwriteii,,
85 | map: application/msword,,
86 | map: application/octet-stream,,
87 | map: application/oda,,
88 | map: application/pdf,,
89 | map: application/postscript,gspreview %s,lpr %s
90 | map: application/rtf,,
91 | map: application/wordperfect5.1,,
92 | map: application/zip,,
93 | #
94 | # Set the builtin's default for bolding of search terms
95 | #
96 | SearchBolding: yes
97 |
98 | #
99 | # Set preference values for each gopher+ type
100 | #
101 | # format is
102 | #
103 | # prefer: default|gplusview pref value
104 | #
105 | #prefer: default 5
106 | #prefer: image/gif 10
107 | #prefer: image/ppm 5
108 |
--------------------------------------------------------------------------------
/gopher/gopher.tpu:
--------------------------------------------------------------------------------
1 | !!
2 | !! Procedure for using TPU with EDT keypad functions as gopher pager on VMS.
3 | !! Adapted from procedure by: Eric Gallagher EGALLAGHER@nimue.hood.edu
4 | !!
5 | procedure eve$set_status_line (this_window)
6 |
7 | local this_buffer, ! The current buffer.
8 | mode_string, ! String version of current mode.
9 | direction_string; ! String version of current direction.
10 |
11 | this_buffer := get_info (this_window, eve$kt_buffer);
12 |
13 | !! Below, a brief statement to prevent adding a status line to those
14 | !! windows that don't need one.
15 |
16 | if (this_buffer = 0) or (get_info (this_window, "status_line") = 0) then
17 | return;
18 | endif;
19 |
20 | !! Below is a section straight from the original procedure. It may be
21 | !! marginally useful, so it may as well be kept.
22 |
23 | if get_info (this_buffer, eve$kt_mode) = insert then
24 | mode_string := "Insert ";
25 | else
26 | mode_string := "Overstrike";
27 | endif;
28 |
29 | if get_info (this_buffer, "direction") = reverse then
30 | direction_string := "Reverse";
31 | else
32 | direction_string := "Forward";
33 | endif;
34 |
35 | !! Set the status line
36 |
37 | set (status_line, this_window, reverse,
38 | " Exit from this Reader: Ctrl-Z | Find Keyword: Home | Direction: "
39 | + direction_string);
40 | endprocedure;
41 |
42 | eve$set_status_line(current_window);
43 |
44 | set (no_write,current_buffer);
45 |
46 | !! Set EDT-style keypad functions
47 |
48 | eve$set_edt_keypad;
49 |
--------------------------------------------------------------------------------
/gopher/gopherrc.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: s2mdalle $
3 | * $Revision: 1.2 $
4 | * $Date: 2001/01/03 22:30:11 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/gopherrc.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: gopherrc.h
14 | * Abstraction and macros for stuff in gopherrc.c
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: gopherrc.h,v $
18 | * Revision 1.2 2001/01/03 22:30:11 s2mdalle
19 | * Just a pile of function prototypes
20 | *
21 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
22 | * Import from UMN Gopher 2.3.1 after GPLization
23 | *
24 | * Revision 3.8 1995/11/03 21:18:19 lindner
25 | * ANSIfication
26 | *
27 | * Revision 3.7 1994/10/21 04:41:08 lindner
28 | * Add ANSI attached printer code..
29 | *
30 | * Revision 3.6 1994/07/06 15:43:42 lindner
31 | * Allow 'home' gopher server in gopherrc files
32 | *
33 | * Revision 3.5 1994/06/29 05:13:14 lindner
34 | * Define, add code to check for new config file
35 | *
36 | * Revision 3.4 1993/12/28 17:30:34 lindner
37 | * more typecasting for picky compilers
38 | *
39 | * Revision 3.3 1993/09/30 22:42:14 lindner
40 | * Add option for bolding of searched words
41 | *
42 | * Revision 3.2 1993/02/19 21:10:54 lindner
43 | * Updated declarations
44 | *
45 | * Revision 3.1.1.1 1993/02/11 18:03:00 lindner
46 | * Gopher+1.2beta release
47 | *
48 | * Revision 2.1 1993/02/09 22:35:54 lindner
49 | * initial rev.
50 | *
51 | *
52 | *
53 | *********************************************************************/
54 |
55 | #ifndef GOPHERRC_H
56 | #define GOPHERRC_H
57 |
58 | #include "String.h"
59 | #include "DAarray.h"
60 | #include "GSgopherobj.h"
61 | #include "GDgopherdir.h"
62 |
63 | /*
64 | * stuff to map from a gopher+ view attribute to a command
65 | */
66 |
67 | struct gopherrcmap_struct {
68 | String *view;
69 |
70 | String *displaycmd;
71 | String *printcmd;
72 | };
73 |
74 | typedef struct gopherrcmap_struct RCMapObj;
75 |
76 | /** Macros and external functions ***/
77 | #define RCMgetView(a) (STRget((a)->view))
78 | #define RCMgetDisplaycmd(a) (STRget((a)->displaycmd))
79 | #define RCMgetPrintcmd(a) (STRget((a)->printcmd))
80 |
81 | #define RCMsetView(a,b) (STRset((a)->view,b))
82 | #define RCMsetDisplaycmd(a,b) (STRset((a)->displaycmd,b))
83 | #define RCMsetPrintcmd(a,b) (STRset((a)->printcmd,b))
84 |
85 | RCMapObj *RCMnew(void);
86 | void RCMdestroy(RCMapObj *rcm);
87 | void RCMinit(RCMapObj *rcm);
88 | void RCMdestroy(RCMapObj *rcm);
89 |
90 | /** Dynamic Array of the above... **/
91 | /*** Definitions for an Array of extension objects ***/
92 |
93 | typedef DynArray RCMAarray;
94 | #define RCMAnew() (RCMAarray *)(DAnew(20,RCMnew,NULL,RCMdestroy,RCMcpy))
95 | #define RCMAdestroy(a) (DAdestroy(a))
96 | #define RCMAgetEntry(a,b) (RCMapObj *)(DAgetEntry((DynArray*)a,b))
97 | #define RCMAadd(a,b) (DApush(((DynArray*)a),((char*)b)))
98 | #define RCMAgetNumEntries(a) (DAgetTop((DynArray*)a))
99 |
100 | int RCMAviewSearch(RCMAarray *rcma, char *view);
101 | boolean RCMAfromLine(RCMAarray *rcma, char *line);
102 | void RCMAtoFile(RCMAarray *rcma, FileIO *fio);
103 |
104 |
105 | /*
106 | * General gopherrc stuff.
107 | */
108 |
109 | struct RC_struct {
110 | RCMAarray *commands;
111 | GopherDirObj *Bookmarks;
112 | GopherObj *Home;
113 |
114 | boolean SearchBolding;
115 | boolean ANSIprinter;
116 |
117 | boolean ChangedDefs;
118 | };
119 |
120 |
121 | typedef struct RC_struct RCobj;
122 |
123 | #define RCgetBookmarkDir(a) ((a)->Bookmarks)
124 | #define RCsetBookmarkDir(a,b) ((a)->Bookmarks=(b))
125 | #define RCinitBookmarkDir(a,b) ((a)->Bookmarks=GDnew(b))
126 |
127 | #define RCgetHome(a) ((a)->Home)
128 | #define RCsetHome(a,b) ((a)->Home = (b))
129 |
130 | #define RCsearchBolding(a) ((a)->SearchBolding)
131 | #define RCsetSearchBolding(a,b) ((a)->SearchBolding=(b))
132 |
133 | #define RCuseANSIprinter(a) ((a)->ANSIprinter)
134 | #define RCsetANSIprinter(a,b) ((a)->ANSIprinter=(b))
135 |
136 |
137 | RCobj *RCnew(void);
138 | void RCsetdefs(RCobj *rc);
139 | void RCfromFile(RCobj *rc, FileIO *rcfio);
140 | void RCtoFile(RCobj *rc);
141 | boolean RCisGlobalNew(void);
142 |
143 | #endif
144 |
145 | /* Prototypes */
146 | RCMapObj *RCMnew(void);
147 | void RCMdestroy(RCMapObj *rcm);
148 | void RCMinit(RCMapObj *rcm);
149 | void RCMcpy(RCMapObj *dest, RCMapObj *orig);
150 | void RCMdisplayCommand(RCMapObj *rcm, char *filename, char *line);
151 | void RCMprintCommand(RCMapObj *rcm, char *filename, char *line);
152 | int RCMAviewSearch(RCMAarray *rcma, char *view);
153 | boolean RCMAfromLine(RCMAarray *rcma, char *line);
154 | void RCMAtoFile(RCMAarray *rcma, FileIO *fio);
155 | RCobj *RCnew(void);
156 | void RCfromFile(RCobj *rc, FileIO *rcfio);
157 | void RCfromENV(RCobj *rc);
158 | void RCfromUser(RCobj *rc);
159 | void RCreadGlobalRC(RCobj *rc);
160 | void RCsetdefs(RCobj *rc);
161 | void RCtoFile(RCobj *rc);
162 | boolean RCdisplayCommand(RCobj *rc, char *view, char *filename, char *line);
163 | boolean RCprintCommand(RCobj *rc, char *view, char *filename, char *line);
164 | boolean RCisGlobalNew(void);
165 |
166 |
--------------------------------------------------------------------------------
/gopher/gopherremote.rc:
--------------------------------------------------------------------------------
1 | #********************************************************************
2 | # $Author: jgoerzen $
3 | # $Revision: 1.1 $
4 | # $Date: 2000/08/19 00:28:56 $
5 | # $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/gopherremote.rc,v $
6 | # $State: Exp $
7 | #
8 | # Paul Lindner, University of Minnesota CIS.
9 | #
10 | # Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | # see the file "Copyright" in the distribution for conditions of use.
12 | #********************************************************************
13 | # MODULE: gopher.rc
14 | # Global rc file for gopher client
15 | #*********************************************************************
16 | # Revision History:
17 | # $Log: gopherremote.rc,v $
18 | # Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | # Initial revision
20 | #
21 | # Revision 3.2 1994/06/09 04:28:04 lindner
22 | # none
23 | #
24 | # Revision 3.1 1993/04/15 21:15:10 lindner
25 | # Remote gopherrc file
26 | #
27 | # Revision 3.3 1993/02/19 21:08:58 lindner
28 | # Added audio/mulaw, and changed defs for gif and ppm to use the '|'
29 | # command.
30 | #
31 | # Revision 3.2 1993/02/18 23:37:27 lindner
32 | # Added header info...
33 | #
34 | #
35 | # Map gopher+ types to local commands
36 | #
37 | # format is:
38 | # map: gplusview,view command,printcommand
39 | #
40 | #
41 | # make sure you eliminate piping and modify the printcommands on VMS
42 | # comment out maps which don't apply on your system, or set them to ",,"
43 | #
44 | #map: Audio/mulaw,|play -v 40 -&,
45 | map: image/gif,DOWN,lpr %s
46 | #map: image/ppm,|xv,lpr %s
47 | #map: Text/dvi,xdvi %s,lpr %s
48 | #map: Text/postscript,gspreview %s,lpr %s
49 | #map: Text/troff,nroff %s|more -d,ptroff %s
50 | map: Text/richtext,richtext %s|Less -f -r,lpr %s
51 | #
52 | # Set the builtin's default for bolding of search terms
53 | #
54 | SearchBolding: yes
55 | #
56 | # Set preference values for each gopher+ type
57 | #
58 | # format is
59 | #
60 | # prefer: default|gplusview pref value
61 | #
62 | #prefer: default 5
63 | #prefer: image/gif 10
64 | #prefer: image/ppm 5
65 |
--------------------------------------------------------------------------------
/gopher/html2.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/html2.c,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: html2.c
14 | * More lame code for html
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: html2.c,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.18 1995/11/03 21:18:20 lindner
22 | * ANSIfication
23 | *
24 | * Revision 3.17 1995/11/03 20:50:49 lindner
25 | * Coen: fixes..
26 | *
27 | * Revision 3.16 1994/10/13 05:29:16 lindner
28 | * Compiler complaint fixes
29 | *
30 | * Revision 3.15 1994/05/17 05:48:00 lindner
31 | * Massive internationalization change
32 | *
33 | * Revision 3.14 1994/05/14 04:13:43 lindner
34 | * Internationalization...
35 | *
36 | * Revision 3.13 1994/04/25 20:47:34 lindner
37 | * Remove html stuff from menu
38 | *
39 | * Revision 3.12 1994/04/14 02:56:55 lindner
40 | * Replace yet another system call
41 | *
42 | * Revision 3.11 1994/03/04 23:31:56 lindner
43 | * mem fix
44 | *
45 | * Revision 3.10 1994/02/20 16:29:56 lindner
46 | * Use urls embedded in gopher obj instead of GSfromHREF
47 | *
48 | * Revision 3.9 1993/12/30 04:17:24 lindner
49 | * use URL from GS instead of hack method
50 | *
51 | * Revision 3.8 1993/10/22 20:27:10 lindner
52 | * Fix for trailing blanks on HTML viewer (Fote)
53 | *
54 | * Revision 3.7 1993/10/11 17:03:46 lindner
55 | * application/html-->text/html, and simplified test for absence of a display command (Fote)
56 | *
57 | * Revision 3.6 1993/09/08 05:23:54 lindner
58 | * Use and external browser for html
59 | *
60 | * Revision 3.5 1993/07/29 17:21:27 lindner
61 | * eliminate non-used variables
62 | *
63 | * Revision 3.4 1993/07/27 05:28:53 lindner
64 | * Mondo Debug overhaul from Mitra
65 | *
66 | * Revision 3.3 1993/07/27 00:32:46 lindner
67 | * HTML patch from Mitra
68 | *
69 | * Revision 3.2 1993/04/15 21:19:43 lindner
70 | * Debug line added (Mitra)
71 | *
72 | * Revision 3.1.1.1 1993/02/11 18:02:58 lindner
73 | * Gopher+1.2beta release
74 | *
75 | * Revision 1.2 1992/12/31 03:59:42 lindner
76 | * Renamed to html2.c for case insensitive VMS. Fixed State: line.
77 | *
78 | * Revision 1.1 1992/12/10 23:32:16 lindner
79 | * gopher 1.1 release
80 | *
81 | * Revision 1.1 1992/12/10 06:16:51 lindner
82 | * Initial revision
83 | *
84 | *
85 | *********************************************************************/
86 |
87 |
88 | #include "gopher.h"
89 | #include "Malloc.h"
90 | #include "Debug.h"
91 |
92 | char *process_tag();
93 |
94 | /*
95 | * Enable use of an external HTML browser until the
96 | * builtin HTML pager is functional (if ever 8-).
97 | */
98 |
99 | #include "fileio.h"
100 |
101 | void
102 | do_html(GopherObj *ZeGopher)
103 | {
104 | char command[256], HTMLcmd[128];
105 | char *Dialogmess[7];
106 |
107 | if (!RCdisplayCommand(GlobalRC, "text/html", "", HTMLcmd) ||
108 | !strncasecmp(HTMLcmd, "- none -", 8) ||
109 | HTMLcmd == NULL || HTMLcmd[0] == '\0') {
110 | CursesErrorMsg(Gtxt("Sorry, this client does not support HTML",47));
111 | return;
112 | }
113 | else
114 | if (HTMLcmd[strlen(HTMLcmd)-1] == ' ')
115 | HTMLcmd[strlen(HTMLcmd)-1] = '\0';
116 |
117 | sprintf(command, "%s \"%s\"",HTMLcmd, GSgetURLhtml(ZeGopher,""));
118 |
119 | clear();
120 | #ifdef VMS
121 | refresh();
122 | #endif
123 | Dialogmess[0] = Gtxt("Warning!!!!!, you are about to leave the Internet Gopher",42);
124 | Dialogmess[1] = Gtxt("Client and connect to an HTML Browser. Use the Browser",43);
125 | Dialogmess[2] = Gtxt("Help if you are not familiar with its commands.",44);
126 | Dialogmess[3] = "";
127 | Dialogmess[4] = Gtxt("Upon quitting from the Browser, you will be returned to",45);
128 | Dialogmess[5] = Gtxt("the Internet Gopher Client.",46);
129 | Dialogmess[6] = NULL;
130 |
131 | if (CURDialog(CursesScreen, GSgetTitle(ZeGopher), Dialogmess) <0)
132 | return;
133 |
134 | CURexit(CursesScreen);
135 | FIOsystem(command);
136 | CURenter(CursesScreen);
137 |
138 | }
139 |
--------------------------------------------------------------------------------
/gopher/html2.h:
--------------------------------------------------------------------------------
1 | /* html2.h
2 | * Written by David Allen
3 | * Simple prototypes for html2.c
4 | */
5 |
6 | #define HTML2_H 1
7 |
8 | void do_html(GopherObj *ZeGopher);
9 |
--------------------------------------------------------------------------------
/gopher/link.com:
--------------------------------------------------------------------------------
1 | $ vg = 'f$verify(0)'
2 | $!********************************************************************
3 | $! lindner
4 | $! 3.9
5 | $! 1994/06/09 04:09:47
6 | $! /home/mudhoney/GopherSrc/CVS/gopher+/gopher/link.com,v
7 | $! Exp
8 | $!
9 | $! Paul Lindner, University of Minnesota CIS.
10 | $!
11 | $! Copyright 1991, 1992 by the Regents of the University of Minnesota
12 | $! see the file "Copyright" in the distribution for conditions of use.
13 | $!********************************************************************
14 | $! MODULE: compile.com
15 | $! compiling script for VMS gopher client
16 | $!*********************************************************************
17 | $! Revision History:
18 | $! link.com,v
19 | $! Revision 3.9 1994/06/09 04:09:47 lindner
20 | $! Fix for vms linking problem
21 | $!
22 | $! Revision 3.8 1994/05/06 02:21:31 lindner
23 | $! Mods for TCPWARE on VMS
24 | $!
25 | $! Revision 3.7 1994/02/20 16:17:40 lindner
26 | $! Add form object file
27 | $!
28 | $! Revision 3.6 1993/09/08 05:21:25 lindner
29 | $! Add pager.c
30 | $!
31 | $! Revision 3.5 1993/08/25 02:58:56 lindner
32 | $! Fix from Fote for vms make procedures
33 | $!
34 | $! Revision 3.4 1993/08/23 02:54:42 lindner
35 | $! Fix for vmsopts
36 | $!
37 | $! Revision 3.3 1993/08/16 18:48:37 lindner
38 | $! Alpha and DECC mods
39 | $!
40 | $! Revision 3.2 1993/08/05 03:24:39 lindner
41 | $! Changes for CMUIP and NETLIB
42 | $!
43 | $! Revision 3.1.1.1 1993/02/11 18:02:59 lindner
44 | $! Gopher+1.2beta release
45 | $!
46 | $! Revision 1.2 1993/01/07 22:54:37 lindner
47 | $! Added download.obj
48 | $!
49 | $! Revision 1.1 1992/12/31 06:10:07 lindner
50 | $! Initial revision
51 | $!
52 | $!
53 | $!********************************************************************/
54 | $!
55 | $ IF P1 .EQS. ""
56 | $ THEN
57 | $ type/nopage sys$input:
58 | Usage:
59 | @link UCX
60 | @link WOLLONGONG
61 | @link MULTINET
62 | @link CMUIP
63 | @link NETLIB
64 | @link TCPWARE
65 | $ exit
66 | $ ENDIF
67 | $ IF P2 .EQS. "DEBUG"
68 | $ THEN
69 | $ debug := "/debug/exe=gopher_debug"
70 | $ objectlib := "libgopher_debug"
71 | $ ELSE
72 | $ debug := ""
73 | $ objectlib := "libgopher"
74 | $ ENDIF
75 | $!
76 | $ ON CONTROL_Y THEN GOTO CLEANUP
77 | $ ON ERROR THEN GOTO CLEANUP
78 | $!
79 | $ IF P1 .eqs. "TCPWARE"
80 | $ THEN
81 | $ write sys$output "Linking client with UCX emulation..."
82 | $ ENDIF
83 | $ transport := "''P1'"
84 | $!
85 | $ IF f$trnlnm("VAXCMSG") .eqs. "DECC$MSG" .or. -
86 | f$trnlnm("DECC$CC_DEFAULT") .eqs. "/DECC"
87 | $ THEN
88 | $ optfile := "''transport'_DECC" ! DECC
89 | $ ELSE
90 | $ optfile := "''transport'_VAXC" ! VAXC
91 | $ ENDIF
92 | $!
93 | $ IF P2 .eqs. "DEBUG
94 | $ THEN
95 | $ vgl = f$verify(1)
96 | $ link'debug'-
97 | gopher.objd,manager.objd,globals.objd,ourutils.objd,cso.objd,-
98 | html2.objd,CURcurses.objd,gopherrc.objd,download.objd,pager.objd,-
99 | form.objd,upload.objd,[-.object]'objectlib'/lib,-
100 | sys$library:vaxccurse/lib,-
101 | sys$disk:[.vmsopts]'optfile'/opt
102 | $ vgl = 'f$verify(0)'
103 | $ ELSE
104 | $ vgl = f$verify(1)
105 | $ link'debug'-
106 | gopher.obj,manager.obj,globals.obj,ourutils.obj,cso.obj,-
107 | html2.obj,CURcurses.obj,gopherrc.obj,download.obj,pager.obj,-
108 | form.obj,upload.obj,[-.object]'objectlib'/lib,-
109 | sys$library:vaxccurse/lib,-
110 | sys$disk:[.vmsopts]'optfile'/opt
111 | $ vgl = 'f$verify(0)'
112 | $ ENDIF
113 | $!
114 | $ CLEANUP:
115 | $ vgl = f$verify(vg)
116 | $exit
117 |
--------------------------------------------------------------------------------
/gopher/locales/De_DE.msg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/De_DE.msg
--------------------------------------------------------------------------------
/gopher/locales/Dk.msg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/Dk.msg
--------------------------------------------------------------------------------
/gopher/locales/Es_ES.msg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/Es_ES.msg
--------------------------------------------------------------------------------
/gopher/locales/Es_MX.msg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/Es_MX.msg
--------------------------------------------------------------------------------
/gopher/locales/Fr.msg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/Fr.msg
--------------------------------------------------------------------------------
/gopher/locales/Makefile.in:
--------------------------------------------------------------------------------
1 | # Swedish support added by Johan Svensson ,
2 | # EkonomiCentrum Software Development Group, Lund University, Sweden.
3 | # 1994-06-08
4 | #
5 |
6 |
7 | .SUFFIXES:
8 | .SUFFIXES: .cat .msg $(SUFFIXES)
9 |
10 | include ../../Makefile.config
11 |
12 | LOCALES = De_DE.cat Es_ES.cat Es_MX.cat En_US.cat Fr.cat Sv.cat It.cat piglatin.cat
13 |
14 | # OSF systems
15 | #LOCALEDIR = /usr/lib/nls
16 |
17 | LOCALEDIR = /usr/lib/locale
18 |
19 | .msg.cat:
20 | rm -f $@
21 | gencat $@ $<
22 |
23 | all : $(LOCALES)
24 |
25 | clean :
26 | rm -f *.cat *.cat.m *~
27 |
28 | #
29 | # Since many vendors don't have standard directories for languages
30 | # we must have separate install scripts...
31 | #
32 |
33 |
34 | install_sol2 : install-help
35 | @INSTALL@ Fr.cat $(LOCALEDIR)/fr/LC_MESSAGES/gopher.cat
36 | @INSTALL@ Es.cat $(LOCALEDIR)/es/LC_MESSAGES/gopher.cat
37 | @INSTALL@ sv.cat $(LOCALEDIR)/sv/LC_MESSAGES/gopher.cat
38 |
39 | install_osf : install-help
40 | @INSTALL@ Fr.cat /usr/lib/nls/msg/fr_FR.iso8859-1/gopher.cat
41 | @INSTALL@ Es.cat /usr/lib/nls/msg/es_ES.iso8859-1/gopher.cat
42 | @INSTALL@ sv.cat /usr/lib/nls/msg/sv_SE.iso8859-1/gopher.cat
43 |
44 |
45 | # HP/Apollo Domain/OS 10.4 or newer
46 | install_domain: install-help
47 | @INSTALL@ En_US.cat /usr/nlslib/en_US.iso88591/gopher.cat
48 | @INSTALL@ Fr.cat /usr/nlslib/fr_FR.iso88591/gopher.cat
49 | @INSTALL@ Es_ES.cat /usr/nlslib/es_ES.iso88591/gopher.cat
50 | -mkdir /usr/nlslib/es_MX.iso88591
51 | @INSTALL@ Es_MX.cat /usr/nlslib/es_MX.iso88591/gopher.cat
52 | @INSTALL@ Sv.cat /usr/nlslib/sv_SE.iso88591/gopher.cat
53 |
54 | #
55 | # Hacked install for sites that haven't set up locales correctly
56 | #
57 |
58 | install : install-help
59 | -mkdir $(CLIENTLIB)/gophernls
60 | cp *.cat* $(CLIENTLIB)/gophernls
61 |
62 | # Sites without X/Open use the raw message files
63 |
64 | install-msg: install-help
65 | -mkdir $(CLIENTLIB)/gophernls
66 | cp *.msg $(CLIENTLIB)/gophernls
67 |
68 |
69 | # Everyone keeps localized help files in the same place
70 | install-help:
71 | @INSTALL@ gopher.hlp.Fr $(CLIENTLIB)
72 |
--------------------------------------------------------------------------------
/gopher/locales/README:
--------------------------------------------------------------------------------
1 | $Id: README,v 1.1 2000/08/19 00:28:56 jgoerzen Exp $
2 |
3 | How to install and use Internationalized message strings.
4 | =========================================================
5 |
6 | For all systems:
7 | ----------------
8 | If you changed the top-level Makefile.config to be anything but
9 | /usr/local/lib, you will have to edit all the *.msg files. Search for a
10 | line in each starting with 225 (223 for VMS) and if it exists, change the
11 | directory path on the next 2 lines appropriately.
12 |
13 |
14 | For X/Open 3 compliant systems:
15 | -------------------------------
16 |
17 | Gopher now uses the catopen/catgets calls to read data from message
18 | catalogs. Installing these can be difficult at times. Here are a few
19 | hints on getting these message files working.
20 |
21 | 1) Make the files into binary catalogs using the 'gencat' utility. If
22 | you type 'make' in this directory they should automatically generate
23 | themselves.
24 |
25 | 2) Now, you need to figure out where to install the files. Different
26 | operating systems have different places to put these files. Some
27 | like /usr/lib/locales/, others /usr/lib/nls, etc.
28 |
29 | Look at the manual page for catopen() or intro in section 5 of your
30 | manual pages for more information. Specifically look for
31 | information on the value of the NLSPATH variable.
32 |
33 | 3) Once you have the files in the correct locations you can use them
34 | by changing your LANG or LC_MESSAGES environment variable.
35 |
36 | i.e
37 |
38 | LANG=fr or
39 | setenv LC_MESSAGES Es
40 |
41 | Note that case is significant. The catopen() routines will most
42 | likely look in the following location for it's cat file in:
43 |
44 | {NLSLIB}/{lang}/LC_MESSAGES/gopher.cat
45 |
46 | NLSLIB is defined as your OS specific languages directory, where
47 | {lang} is the value of the LC_MESSAGES environment variable or the
48 | LANG variable
49 |
50 | Other systems put these files in different locations. Consult your
51 | manual pages for more information.
52 |
53 |
54 | What to do if it just won't work
55 | --------------------------------
56 |
57 | On some systems you need to have the right files loaded to do NLS
58 | commands. The call to setlocale() will fail if you don't have the
59 | proper files in the /usr/lib/nls directory. Don't worry though, we
60 | provide a backup for such a circumstance.
61 |
62 | By typing 'make install' you will make a gophernls directory that
63 | contains all of the message catalogs. If the gopher client cannot
64 | find the message catalog the regular way, it will try these backup
65 | files. So, if you wanted to use the spanish gopher, do
66 |
67 | setenv LC_MESSAGES Es
68 |
69 | before running the gopher client. This should work on most other
70 | systems.
71 |
72 | For non-X/Open 3 compliant systems:
73 | -----------------------------------
74 | make install-msgs should install the files properly.
75 |
76 | To use them set the environment variables LANG or LC_MESSAGES to
77 | the name of the message file without the suffix, i.e.
78 | setenv LC_MESSAGES Es_ES
79 | if you want a spanish speaking gopher.
80 |
81 |
82 | Customizing Gopher for your Particular Locale
83 | =============================================
84 |
85 | Basically start with one of the files and convert from it. You might
86 | want to start with the En_US.msg, since this is the list of original
87 | english messages.
88 |
89 | Then give it a name (use your iso language code) and send it to the
90 | gopher team for the next release.
91 |
92 | Thanks!
93 |
--------------------------------------------------------------------------------
/gopher/locales/README.VMS:
--------------------------------------------------------------------------------
1 | $Id: README.VMS,v 1.1 2000/08/19 00:28:56 jgoerzen Exp $
2 |
3 | README for VMS internationalization 18 Dec 1994
4 | VMS Gopher Client 2.1 - F. Macrides ,
5 | J.Lance Wilkinson
6 |
7 | The MAKE.COM file contained here invokes a TPU procedure to convert the
8 | various [.GOPHER.LOCALES]*.MSG Unix message files to a source code format
9 | compatible with VMS MESSAGE, then compiles and links sharable image files for
10 | these message files. The MAKE.COM and MESSAGE.TPU files coordinate to
11 | generate an appropriate linkage options file to define a specific symbol as
12 | either UNIVERSAL for the VAX environment, or as a SYMBOL_VECTOR DATA entry for
13 | the AXP environment. The MAKE.COM file detects whether it is being executed
14 | in a VAX or AXP environment, and passes MESSAGE.TPU an initialization string
15 | beginning with the characters "VAX" or "AXP" followed by a facility code value
16 | in the range of 0 to 2047. The value is incremented by 1 for each successive
17 | call to MESSAGE.TPU together with the file name for the input .MSG file (e.g.,
18 | DE_DE, EN_US, ES_ES, ES_MX, FR, etc.) to develop a unique facility code for
19 | each language. MAKE.COM stops calling MESSAGE.TPU if the value would exceed
20 | the MESSAGE utility's limit of 2047 (Are there more than 2048 languages?).
21 |
22 | Note that the sharable image files are architecture-specific, VAX or AXP, so
23 | caution in a mixed cluster is advised. The symbol constant GOPHERMSGS_DEV
24 | can be defined in conf.h such that the appropriate sharable image files are
25 | sought in differnt locations for clients built on VAX versus AXP (see comments
26 | in conf.h). The default location is the GopherP_Dir referenced directory.
27 |
28 | If a DCL logical or symbol for LC_MESSAGES is detected when the client starts,
29 | it is evaluated and inserted into the string for filenames replacing the %s
30 | below:
31 |
32 | GopherP_Dir:Gopher_Msg_%s.EXE
33 |
34 | or with "GopherP_Dir" replaced by another device logical if GOPHERMSGS_DEV
35 | was changed from the default in conf.h. If the logical or symbol (getenv()
36 | is used to detect it) is not found, a VMS call to LIB$GET_USERS_LANGUAGE(),
37 | which uses the SYS$LANGUAGE logical, is tried. Again, if successful here,
38 | the resultant string replaces the %s in the above filespec. LC_MESSAGES can
39 | be defined with DCL wildcarding to reference more than one sharable image
40 | file.
41 |
42 | A scan is then performed for one or more matching files. If one or more is
43 | found to contain a message number 232, the image is activated and becomes
44 | part of the executable in memory (note: size of the image increases as more
45 | message files are associated), and the messages present in the file are used.
46 | If none are found, the hardcoded messages in the client are used. If more
47 | than one is found (e.g., if LC_MESSAGES was defined as "*"), a menu is built
48 | of all the located files, using message number 232 as the menu title.
49 |
50 | This message number 232 should be an invitation to use the language specific
51 | to the file, such as "Do you speak English?" in the English message file.
52 | Absence of this message will cause the language to be ignored and not included
53 | in the menu.
54 |
55 | Once the menu is built, it can be offered to the user for choosing a
56 | language. If the constant symbol GOPHERMSGS_DEFAULT has been defined in
57 | conf.h so that it points to a found sharable image file, its language will
58 | be establish at startup of the client. Later, during client usage, an L
59 | (uppercase) keystroke will cause the menu to be raised again and allow a
60 | choice of another language. If no default language has been established via
61 | GOPHERMSGS_DEFAULT, the menu will be displayed at startup of the client and
62 | the user must make a choice. The initial choice can be changed at any time
63 | via an L keystroke to reinvoke the menu.
64 |
65 |
--------------------------------------------------------------------------------
/gopher/locales/Sv.msg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/Sv.msg
--------------------------------------------------------------------------------
/gopher/locales/gopher.hlp.Dk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/gopher.hlp.Dk
--------------------------------------------------------------------------------
/gopher/locales/gopher.hlp.Es:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/gopher.hlp.Es
--------------------------------------------------------------------------------
/gopher/locales/gopher.hlp.Fr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/locales/gopher.hlp.Fr
--------------------------------------------------------------------------------
/gopher/locales/gopher.hlp.It:
--------------------------------------------------------------------------------
1 |
2 | Pro-Memoria per l'uso di Gopher
3 | ---------------------------------
4 |
5 | Come navigare nello spazio Gopher
6 | ---------------------------------
7 | Per postarsi usare i tasti-cursore o i comandi equivalenti di vi/emacs.
8 |
9 | , Return ......: "Entra"/Visualizza l'elemento corrente
10 | , u .........: "Esce" dall'elemento corrente/Va al livello superiore ...............: Per spostarsi alla prossima linea.
11 | .................: Per spostarsi alla prossima linea.
12 | >, +, , .: Per visualizzare la pagina successiva
13 | <, -, , b .......: Per visualizzare la pagina precedenre
14 | 0-9 ...................: Per andare ad una specifica linea
15 | m .....................: Per tornare indietro al menu principale
16 |
17 |
18 | -----------
19 | a : Per aggiungere l'elemento corrente alla lista dei
20 | A : Per aggiungere il menu corrente alla lista dei
21 | v : Per visualizzare la lista dei
22 | d : Per cancellare un elemento dal menu o dalla lista dei
23 |
24 | Altri comandi
25 | --------------
26 | q : Chiusura di Gopher, con richiesta di cofnerma
27 | Q : Chiusura incondizionata di Gopher
28 | s : Salva l'elemento corrente in un file
29 | S : Salva il menu corrente in un file
30 | D : Scarica un file (via Modem)
31 | r : Va al menu principale associato al corrente elemento
32 | R : Va al menu principale associato al corrente menu
33 | = : Visualizza informazioni tecniche sul currente elemento
34 | ^ : Visualizza informazioni techiche sul coddente menu
35 | o : Apre un nuovo Server Gopher
36 | O : Modifica le opzioni
37 | f : Connessione ad un Server FTP remoto
38 | w : Connessione a URL http, gopher, FTP, telnet o tn3270
39 | / : Ricerca un elemento del menu+
40 | n : Trova il successivo elemento ricercato.
41 | g : Invia un commento via posta elettronica all'amministratore
42 | dell'elemento corrente
43 | L : Cambia il linguaggio dei messaggi (VMS)
44 | !, $ : Accesso alla Shell (Unix) o attivazione sottoprocesso DCL (VMS).
45 | Ctrl-L, Ctrl-R, Ctrl-W : Rivisualizzazione della videata
46 | Ctrl-T : Visualizza Data e Orario corrente
47 |
48 | Oggetti Gopher:
49 | Descrittore Tipo Descrizione
50 | --------------------------------------------
51 | (none) 0 File
52 | 1 Direttorio
53 | <) s Suono
54 | I,g Immagine
55 | ; Animazione.
56 | 4 File BinHexed Macintosh
57 | 9 File binario
58 | 5 File binario DOS
59 | 2 Elenco Telefonico CSO (ph/qi)
60 | 8 Connessione Telnet
61 | <3270> T Connessione Telnet (con emulazione IBM 3270)
62 | M File "Multi-purpose Internet Mail Extensions"
63 | h File HyperText Markup Language (Ipertesto)
64 | > 7 Ricerca di un testo
65 | ?> (none) Modulo "ASK"
66 |
67 | Il Gruppo di Sviluppo del software Gopher si augura che possiate
68 | trovare utile questo software. Se trovate quello che pensate sia un
69 | errore, per cortesia segnalatecelo inviando un messaggio di Posta-
70 | Elettronica a "gopher@complete.org".
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/gopher/locales/make.com:
--------------------------------------------------------------------------------
1 | $ vg = 'f$verify(0)'
2 | $!********************************************************************
3 | $! wilkinson/macrides
4 | $! 1.5
5 | $! 1994/12/18
6 | $!
7 | $! J.Lance Wilkinson, Penn State University C&IS - LCS.
8 | $! F. Macrides, Worcester Foundation for Expermimental Biology
9 | $!********************************************************************
10 | $! MODULE: message.com
11 | $! compiling script for VMS "internationalized" messages
12 | $!*********************************************************************
13 | $! Revision History:
14 | $! message.com,v
15 | $! Revision 1.5 1994/12/18 macrides
16 | $! Pass the facility values to MESSAGE.TPU as incremental values in the range
17 | $! of 0 - 2047. This guarantees unique values for up to the maximum of
18 | $! 2048 shared image message files.
19 | $!
20 | $! Revision 1.4 1994/7/14 wilkinson
21 | $! Made MAKE.COM search out all .msg files and process them rather than hard-
22 | $! coding specific .msg files.
23 | $!
24 | $! Revision 1.3 1994/7/13 wilkinson/macrides
25 | $! Firmed up AXP support
26 | $!
27 | $! Revision 1.2 1994/7/12 wilkinson
28 | $! Attempted AXP support
29 | $!
30 | $! Revision 1.1 1994/5/31 wilkinson
31 | $! Initial revision
32 | $!
33 | $!********************************************************************/
34 | $!
35 | $ ON CONTROL_Y THEN GOTO CLEANUP
36 | $ ON ERROR THEN GOTO CLEANUP
37 | $!
38 | $ vg1 = f$verify(1)
39 | $!
40 | $! Preprocess the .MSG files into VMS message files.
41 | $!
42 | $ vg1 = 'f$verify(0)'
43 | $ if f$getsyi("HW_MODEL").ge.1024
44 | $ then
45 | $ vg1 = f$verify(1)
46 | $ platform := "AXP"
47 | $ preprocess := "edit/tpu/nosection/nodisplay/command=message.tpu"
48 | $!
49 | $ vg1 = 'f$verify(0)'
50 | $ else
51 | $ vg1 = f$verify(1)
52 | $ platform := "VAX"
53 | $ preprocess := "edit/tpu/nosection/nodisplay/command=message.tpu"
54 | $ vg1 = 'f$verify(0)'
55 | $ endif
56 | $
57 | $ facility = 0
58 | $ prep_loop:
59 | $ file = f$search("*.msg")
60 | $ if file .eqs. "" .or. facility .ge. 2048 then goto done_prep
61 | $ filename := 'f$parse(file,,,"name")
62 | $ initstring = "''platform'"'facility
63 | $ vg1 = f$verify(1)
64 | $!
65 | $ preprocess/init='initstring/output='filename.vms$msg 'filename.msg
66 | $ vg1 = 'f$verify(0)'
67 | $ facility = facility + 1
68 | $ goto prep_loop
69 | $ done_prep:
70 | $ purge/nolog *.vms$msg
71 | $ purge/nolog *.opt
72 | $ vg1 = f$verify(1)
73 | $!
74 | $! Compile the resultant .VMS$MSG files into VMS message files.
75 | $!
76 | $ vg1 = 'f$verify(0)'
77 | $ msgs_loop:
78 | $ file = f$search("*.vms$msg")
79 | $ if file .eqs. "" then goto done_msgs
80 | $ filename := 'f$parse(file,,,"name")
81 | $ vg1 = f$verify(1)
82 | $ message 'filename.vms$msg
83 | $ vg1 = 'f$verify(0)'
84 | $ goto msgs_loop
85 | $ done_msgs:
86 | $ purge/nolog *.obj
87 | $ vg1 = f$verify(1)
88 | $!
89 | $! Create non-executable message files. These .EXE files should
90 | $! be copied from [.gopher.locales] to GopherP_Dir or the
91 | $! location referenced by GOPHERMSGS_DEV in conf.h
92 | $!
93 | $ vg1 = 'f$verify(0)'
94 | $ link_loop:
95 | $ file = f$search("*.obj")
96 | $ if file .eqs. "" then goto done_link
97 | $ filename := 'f$parse(file,,,"name")
98 | $ vg1 = f$verify(1)
99 | $ link/sharable=gopher_msg_'filename.exe 'filename.obj, 'filename.opt/opt
100 | $ vg1 = 'f$verify(0)'
101 | $ goto link_loop
102 | $ done_link:
103 | $ purge/nolog gopher_msg_*.exe
104 | $ delete/nolog *.obj;*
105 | $ delete/nolog *.vms$msg;*
106 | $ delete/nolog *.opt;*
107 | $!
108 | $ vg1 = 'f$verify(0)'
109 | $ CLEANUP:
110 | $ vg1 = f$verify(vg)
111 | $exit
112 |
--------------------------------------------------------------------------------
/gopher/makefile.vms:
--------------------------------------------------------------------------------
1 | # either MULTINET, UCX, or WOLLONGONG
2 | #TCPVERSION=UCX
3 | #TCPVERSION=MULTINET
4 | TCPVERSION=WOLLONGONG
5 |
6 | OBJINCLUDES =
7 | OTHERINCLUDES = /inc=([-.object],[-])
8 | INCLUDES = $(OBJINCLUDES) $(OTHERINCLUDES)
9 |
10 | # --- the above was from ../Makefile.config
11 |
12 | OBJS = gopher.obj manager.obj globals.obj ourutils.obj cso.obj \
13 | subprocs.obj html.obj HTML2.obj CURcurses.obj hymoo.obj gopherrc.obj \
14 | download.obj
15 | OBJLIST = gopher.obj,manager.obj,globals.obj,ourutils.obj,cso.obj,subprocs.obj,html.obj,HTML2.obj,CURcurses.obj,hymoo.obj,gopherrc.obj,download.obj
16 |
17 | OPT =
18 | #OPT = /noopt/debug/list
19 | CC = cc
20 | CCFLAGS = $(OPT) $(INCLUDES) /def=($(TCPVERSION)=1)
21 | LDFLAGS =
22 | #LDFLAGS = /trace/debug/map
23 |
24 | TARGET = gopher
25 |
26 | all: $(TARGET)
27 |
28 | manager.obj: manager.c gopher.h [-]conf.h
29 | write sys$output "Compiling manager.c"
30 | $(CC) $(CCFLAGS) manager.c
31 |
32 | gopher.obj: gopher.c gopher.h [-]conf.h
33 | write sys$output "Compiling gopher.c"
34 | $(CC) $(CCFLAGS) gopher.c
35 |
36 | globals.obj: globals.h version.h globals.c gopher.h [-]conf.h
37 | write sys$output "Compiling globals.c"
38 | $(CC) $(CCFLAGS) globals.c
39 |
40 | ourutils.obj: ourutils.c gopher.h [-]conf.h
41 | write sys$output "Compiling ourutils.c"
42 | $(CC) $(CCFLAGS) ourutils.c
43 |
44 | cso.obj: cso.c gopher.h [-]conf.h
45 | write sys$output "Compiling cso.c"
46 | $(CC) $(CCFLAGS) cso.c
47 |
48 | subprocs.obj: subprocs.c gopher.h [-]conf.h
49 | write sys$output "Compiling subprocs.c"
50 | $(CC) $(CCFLAGS) subprocs.c
51 |
52 | html.obj: html.c gopher.h [-]conf.h
53 | write sys$output "Compiling html.c"
54 | $(CC) $(CCFLAGS) html.c
55 |
56 | HTML2.obj: HTML2.c gopher.h [-]conf.h
57 | write sys$output "Compiling HTML2.c"
58 | $(CC) $(CCFLAGS) HTML2.c
59 |
60 | CURcurses.obj: CURcurses.c gopher.h [-]conf.h
61 | write sys$output "Compiling CURcurses.c"
62 | $(CC) $(CCFLAGS) CURcurses.c
63 |
64 | hymoo.obj: hymoo.c gopher.h [-]conf.h
65 | write sys$output "Compiling hymoo.c"
66 | $(CC) $(CCFLAGS) hymoo.c
67 |
68 | gopherrc.obj: gopherrc.c gopher.h [-]conf.h
69 | write sys$output "Compiling gopherrc.c"
70 | $(CC) $(CCFLAGS) gopherrc.c
71 |
72 | download.obj: download.c gopher.h [-]conf.h
73 | write sys$output "Compiling download.c"
74 | $(CC) $(CCFLAGS) download.c
75 |
76 | [-.object]gopher.olb:
77 | set default [-.object]
78 | make gopher.olb
79 | set default [-.gopher]
80 |
81 | $(TARGET) : $(OBJS) [-.object]gopher.olb
82 | write sys$output "Linking $(TARGET) for $(TCPVERSION)"
83 | link$(LDFLAGS)/exe=$(TARGET) $(OBJLIST), -
84 | [-.object]gopher.olb/lib, -
85 | sys$library:vaxccurse.olb/lib, -
86 | sys$disk:[]$(TCPVERSION).opt/opt
87 |
88 | clean:
89 | delete *.obj;*, $(TARGET).exe;* *.lis;*
90 |
91 | install : all
92 | copy $(TARGET) $(CLIENTDIR)
93 | copy gopher.hlp sys$help:
94 |
--------------------------------------------------------------------------------
/gopher/manager.h:
--------------------------------------------------------------------------------
1 | /* manager.h
2 | * Written by David Allen
3 | * Simple prototypes for functions in manager.c
4 | */
5 |
6 | #define MANAGER_H 1
7 |
8 | void Draw_Banner(void);
9 | void Draw_Status(char *textline);
10 | void DisplayTitle(GopherObj *gs, int maxlength, boolean dogplus);
11 | void Display_Dir_Page(GopherDirObj *gopherdir, int iNewLine,
12 | int nNewPage, int nMaxPages,
13 | int iPageLen, int iLastPageLen);
14 | int scline(int iOldGopher, int iNewGopher, GopherDirObj *gophersdir);
15 | int GetMenu(GopherDirObj *gd, int *typedchar, boolean redisplay);
16 |
--------------------------------------------------------------------------------
/gopher/ourutils.h:
--------------------------------------------------------------------------------
1 | /* ourutils.h
2 | * Written by David Allen
3 | * Simple prototypes for functions in ourutils.c
4 | */
5 |
6 | #define OURUTILS_H 1
7 |
8 | #include "CURcurses.h"
9 | #include "upload.h"
10 | #include "pager.h"
11 |
12 | #ifndef DOWNLOAD_H
13 | # include "download.h"
14 | #endif /* DOWNLOAD_H */
15 |
16 | void UNIXfile(char *fname);
17 | int outchar(int c);
18 | int twirl(void);
19 | void GSmail(GopherObj *gs);
20 | char *Choose_View(GopherObj *gs);
21 | Requestitem *REQitemnew(void);
22 | void REQitemdestroy(Requestitem *req);
23 | char **AskBlock(GopherObj *gs);
24 | void Save_file(GopherObj *gs, char *saveto, char *view);
25 | void Save_list(GopherDirObj *gd);
26 | void GSdisplay(GopherObj *gs);
27 | boolean GStoFile(GopherObj *gs, FILE *f, char *view,
28 | int (*twirlfn) (/* ??? */));
29 | void GSprompter(GopherObj *gs, char *view, char *command);
30 | void CursesMsg(char *Message, char *title);
31 | void CursesErrorMsg(char *Message);
32 | int logrequest(char *msg, GopherObj *gs);
33 | void Gplus_Error(int sockfd);
34 |
--------------------------------------------------------------------------------
/gopher/pager.h:
--------------------------------------------------------------------------------
1 | /* pager.h
2 | * Written by David Allen
3 | * Simple prototypes for functions in pager.c
4 | */
5 |
6 | #define PAGER_H 1
7 |
8 | void PagerHelp(CursesObj *cur);
9 | void PagerInitGlobals(void);
10 | void PagerTitles(CursesObj *cur, GopherObj *gs, int totalbytes);
11 | int PagePosAlloc(void);
12 | int PagePosRealloc(void);
13 | void PagePosFree(void);
14 | void PagerPercent(int bytes, int totalbytes);
15 | void PagerParseSearchstring(void);
16 | void PagerPrintLine(char *inputline);
17 | void PagerSeekPage(FILE *thefile, int gotopage, int *bytecount);
18 | void PagerNextPage(CursesObj *cur, FILE *thefile, char *theline,
19 | int *bytecount, int totalbytes);
20 | boolean PagerSearch(FILE *thefile, char *theline, int *bytecount,
21 | char *search);
22 | void PagerBuiltin(CursesObj *cur, GopherObj *gs);
23 |
24 |
--------------------------------------------------------------------------------
/gopher/subprocs.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gopher/subprocs.c,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: subprocs.c
14 | * procedures for dealing with child processes.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: subprocs.c,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.5 1995/11/03 21:18:22 lindner
22 | * ANSIfication
23 | *
24 | * Revision 3.4 1994/04/13 03:37:30 lindner
25 | * Remove dead code
26 | *
27 | * Revision 3.3 1993/07/20 23:14:13 lindner
28 | * Use waitpid, not wait3
29 | *
30 | * Revision 3.2 1993/04/15 21:44:50 lindner
31 | * Fixes for sysv signals
32 | *
33 | * Revision 3.1.1.1 1993/02/11 18:02:58 lindner
34 | * Gopher+1.2beta release
35 | *
36 | * Revision 1.2 1992/12/31 05:36:51 lindner
37 | * Mods for VMS
38 | *
39 | * Revision 1.1 1992/12/10 23:32:16 lindner
40 | * gopher 1.1 release
41 | *
42 | * Revision 1.1 1992/12/10 06:16:51 lindner
43 | * Initial revision
44 | *
45 | *
46 | *********************************************************************/
47 |
48 | #ifdef VMS
49 | void
50 | sig_child()
51 | { }
52 |
53 | #else /* not VMS */
54 |
55 |
56 | #include "gopher.h"
57 |
58 | #include "Wait.h"
59 |
60 | #if defined(SIGTSTP) && !defined(_CRAY) /* True on a BSD system */
61 | #include
62 | #endif
63 |
64 | #include
65 |
66 | /* A little signal handler that handles those damn zombies */
67 |
68 |
69 | void
70 | sig_child(int sig)
71 | {
72 | /*
73 | * Use the waitpid() system call with the WNOHANG option
74 | */
75 |
76 | int pid;
77 |
78 | Portawait status;
79 |
80 | while ( (pid = waitpid(-1, &status, WNOHANG|WUNTRACED)) > 0)
81 | ;
82 | }
83 |
84 |
85 | #ifdef SIGCHLD
86 | #ifndef SIGCLD
87 | # define SIGCLD SIGCHLD
88 | #endif
89 | #endif
90 |
91 |
92 |
93 | #endif /* not VMS */
94 |
--------------------------------------------------------------------------------
/gopher/upload.c:
--------------------------------------------------------------------------------
1 | #include "gopher.h"
2 | #include "fileio.h"
3 | #ifdef VMS
4 | #include
5 | #else
6 | #include
7 | #endif
8 |
9 | #ifdef HAVE_TIME_H
10 | # include
11 | #endif /* HAVE_TIME_H */
12 |
13 | static char *DLnames[] = {
14 | "Zmodem",
15 | "Ymodem",
16 | "Xmodem-CRC",
17 | "Kermit",
18 | "Text",
19 | "WRQ - Reflection",
20 | NULL
21 | };
22 |
23 | static char *textorbin[] = {
24 | "Binary",
25 | "ASCII",
26 | NULL
27 |
28 | };
29 |
30 | static char *ULtextcmds[] = {
31 | "rz ",
32 | "rb -a ",
33 | "rx -ac ",
34 | "kermit -q -r ",
35 | "false ",
36 | "unixlnk2",
37 | NULL
38 | };
39 |
40 | static char *ULbincmds[] = {
41 | "rz -b ",
42 | "rb ",
43 | "rx ",
44 | "kermit -q -r -i",
45 | "false ",
46 | "unxlink2",
47 | NULL
48 | };
49 |
50 |
51 | extern Requestitem *REQitemnew(void);
52 |
53 | void
54 | BuiltinUploadfile(void)
55 | {
56 | Requestitem *ulmenu[6];
57 | char filename[80];
58 | boolean istext;
59 | int ulprotocol;
60 | char cmdline[512];
61 | boolean iszmodem;
62 | int start, end;
63 | struct stat buf;
64 |
65 | filename[0] = '\0';
66 |
67 |
68 | ulmenu[0] = REQitemnew();
69 | ulmenu[0]->prompt = "Supply file information for Upload";
70 | ulmenu[0]->thing = CUR_LABEL;
71 |
72 | ulmenu[1] = REQitemnew();
73 | ulmenu[1]->prompt = "";
74 | ulmenu[1]->thing = CUR_LABEL;
75 |
76 | ulmenu[2] = REQitemnew();
77 | ulmenu[2]->thing = CUR_CHOICE;
78 | ulmenu[2]->prompt = "Download Protocol";
79 | ulmenu[2]->choices = DLnames;
80 | ulmenu[2]->chooseitem = 0;
81 |
82 | ulmenu[3] = REQitemnew();
83 | ulmenu[3]->thing = CUR_CHOICE;
84 | ulmenu[3]->prompt = "Type of File";
85 | ulmenu[3]->choices = textorbin;
86 | ulmenu[3]->chooseitem = 0;
87 |
88 | ulmenu[4] = REQitemnew();
89 | ulmenu[4]->prompt = "Save file as";
90 | ulmenu[4]->thing = CUR_PROMPT;
91 | ulmenu[4]->stowage = filename;
92 |
93 | ulmenu[5] = NULL;
94 |
95 | if (!CURrequester(CursesScreen, "Upload File", ulmenu)) {
96 | ulprotocol = ulmenu[2]->chooseitem;
97 | istext = ulmenu[3]->chooseitem;
98 | iszmodem = (ulprotocol == 0);
99 |
100 | if (!iszmodem && filename[0] == '\0') {
101 | CursesErrorMsg("You must supply a filename");
102 | return;
103 | }
104 |
105 | if (istext) {
106 | strcpy(cmdline, ULtextcmds[ulprotocol]);
107 | } else {
108 | strcpy(cmdline, ULbincmds[ulprotocol]);
109 | }
110 |
111 | if (!iszmodem) {
112 | strcat(cmdline, filename);
113 | }
114 |
115 | CURexit(CursesScreen);
116 | start = time(NULL);
117 |
118 | if (ulprotocol == 4) { /* Text */
119 | FileIO *fio;
120 | char inputline[256];
121 |
122 | printf("Send your text now, enter CTRL-D or a single period to complete upload\n");
123 | fio = FIOopenUFS(filename, O_WRONLY|O_CREAT, 0600);
124 | if (fio == NULL) {
125 | printf("Couldn't open the file %s for writing\n", filename);
126 | CURenter(CursesScreen);
127 | return;
128 | }
129 | while(fgets(inputline,sizeof(inputline), stdin)) {
130 | ZapCRLF(inputline);
131 | if (strcmp(inputline, ".") == 0)
132 | break;
133 | FIOwritestring(fio, inputline);
134 | }
135 | FIOclose(fio);
136 | } else {
137 | printf("Executing the following command\n%s\n",cmdline);
138 |
139 | if (FIOsystem(cmdline))
140 | printf("Upload failed, sorry...\n");
141 | }
142 |
143 | end = time(NULL);
144 |
145 | if (stat(filename, &buf) < 0)
146 | printf("Upload failed, try again...\n");
147 | else {
148 | printf(Gtxt("Upload complete. %d total bytes, %d bytes/sec\n",182),
149 | (int)buf.st_size, ((int)buf.st_size)/(end-start));
150 | }
151 | printf(Gtxt("Press to continue",121));
152 |
153 | fflush(stdout);
154 | getchar();
155 | CURenter(CursesScreen);
156 | }
157 | return;
158 | }
159 |
160 |
161 |
--------------------------------------------------------------------------------
/gopher/upload.h:
--------------------------------------------------------------------------------
1 | /* upload.h
2 | * Written by David Allen
3 | * Simple prototypes for the functions in upload.c
4 | */
5 |
6 | #define UPLOAD_H 1
7 |
8 | void BuiltinUploadfile(void);
9 |
--------------------------------------------------------------------------------
/gopher/version.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/gopher/version.h
--------------------------------------------------------------------------------
/gopher/vmsopts/cmuip_decc.opt:
--------------------------------------------------------------------------------
1 | identification="CMUIP-2.0x"
2 | sys$library:neterror
3 | sys$share:vaxcrtl/lib
4 |
--------------------------------------------------------------------------------
/gopher/vmsopts/cmuip_vaxc.opt:
--------------------------------------------------------------------------------
1 | identification="CMUIP-2.0x"
2 | sys$library:neterror
3 | sys$share:vaxcrtl.exe/share
4 |
--------------------------------------------------------------------------------
/gopher/vmsopts/multinet_decc.opt:
--------------------------------------------------------------------------------
1 | multinet:multinet_socket_library/share
2 | sys$share:vaxcrtl/lib
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/multinet_vaxc.opt:
--------------------------------------------------------------------------------
1 | multinet:multinet_socket_library/share
2 | sys$share:vaxcrtl/share
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/netlib_decc.opt:
--------------------------------------------------------------------------------
1 | identification = "NETLIB-2.0x"
2 | netlib_shrxfr/shareable
3 | sys$share:vaxcrtl/lib
4 |
--------------------------------------------------------------------------------
/gopher/vmsopts/netlib_vaxc.opt:
--------------------------------------------------------------------------------
1 | identification = "NETLIB-2.0x"
2 | netlib_shrxfr/shareable
3 | sys$share:vaxcrtl/shareable
4 |
--------------------------------------------------------------------------------
/gopher/vmsopts/tcpware_decc.opt:
--------------------------------------------------------------------------------
1 | tcpware:ucx$ipc_shr.exe/share
2 | sys$share:vaxcrtl/lib
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/tcpware_vaxc.opt:
--------------------------------------------------------------------------------
1 | tcpware:ucx$ipc/lib
2 | sys$share:vaxcrtl.exe/share
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/ucx_decc.opt:
--------------------------------------------------------------------------------
1 | sys$library:ucx$ipc_shr.exe/share
2 | sys$share:vaxcrtl/lib
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/ucx_vaxc.opt:
--------------------------------------------------------------------------------
1 | sys$library:ucx$ipc/lib
2 | sys$share:vaxcrtl.exe/share
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/wollongong_decc.opt:
--------------------------------------------------------------------------------
1 | twg$tcp:[netdist.lib]twglib.olb/lib
2 | sys$share:vaxcrtl/lib
3 |
--------------------------------------------------------------------------------
/gopher/vmsopts/wollongong_vaxc.opt:
--------------------------------------------------------------------------------
1 | twg$tcp:[netdist.lib]twglib.olb/lib
2 | sys$share:vaxcrtl.exe/share
3 |
--------------------------------------------------------------------------------
/gophfilt/Makefile.in:
--------------------------------------------------------------------------------
1 | #********************************************************************
2 | # $Author: jgoerzen $
3 | # $Revision: 1.3 $
4 | # $Date: 2002/01/11 15:55:59 $
5 | # $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/gophfilt/Makefile.in,v $
6 | # $State: Exp $
7 | #
8 | # Paul Lindner, University of Minnesota CIS.
9 | #
10 | # Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | # see the file "Copyright" in the distribution for conditions of use.
12 | #********************************************************************
13 | # MODULE: Makefile
14 | # Makefile for gopher filter client
15 | #*********************************************************************
16 | # Revision History:
17 | # $Log: Makefile.in,v $
18 | # Revision 1.3 2002/01/11 15:55:59 jgoerzen
19 | # * Using $(INSTALL) from subdirectories broke on systems
20 | # where install-sh was used because $(INSTALL) would always
21 | # resolve to ./install-sh. Replaced all instances of
22 | # $(INSTALL) with @INSTALL@ (autoconf would provide the correct
23 | # path) and removed INSTALL from Makefile.config. Reported
24 | # by Don Fike on Solaris 2.6.
25 | # * Updated our copy of install-sh with the one from
26 | # a current automake.
27 | #
28 | # Revision 1.2 2002/01/08 17:36:14 jgoerzen
29 | # Finally builds!
30 | #
31 | # Changes:
32 | #
33 | # * config.h.in: rebuilt by autoheader
34 | #
35 | # * configure: rebuilt by autoconf
36 | #
37 | # * configure.in:
38 | # * Added REGEXLIBS test for NetBSD -- look for re_comp in -lcompat
39 | # * Added checkes for term.h, re_comp.h, regex.h
40 | #
41 | # * gopher/ourutils.c, gopher/CURcurses.c: Use term.h check
42 | #
43 | # * gopher/Makefile.in, gopherd/Makefile.in, gophfilt/Makefile.in:
44 | # * Use REGEXLIBS
45 | #
46 | # * gopher/globals.h, gopher/gopher.c: Remove sys_errlist
47 | #
48 | # * object/GSgopherobj.c: Removed #include, now use
49 | # "Regex.h" that has proper regex determining logic
50 | #
51 | # * object/Regex.h: Moved regex.h include to here. Make it conditional
52 | # based on configure test. Add conditional re_comp.h include.
53 | #
54 | # Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
55 | # Import from UMN Gopher 2.3.1 after GPLization
56 | #
57 | # Revision 1.1 1996/01/06 00:33:31 lindner
58 | # rel 2.3
59 | #
60 | #********************************************************************/
61 |
62 | srcdir = @srcdir@
63 | top_srcdir = @top_srcdir@
64 | VPATH = @srcdir@
65 |
66 | include ../Makefile.config
67 |
68 | OBJS = gophfilt.o
69 |
70 | CCFLAGS = $(OPT) $(INTLOPTS) -I.. -I$(top_srcdir) -I$(top_srcdir)/object
71 |
72 | TARGET = gophfilt
73 |
74 | all: $(TARGET)
75 |
76 | .c.o:
77 | $(CC) $(CCFLAGS) -c $<
78 |
79 | ../object/libgopher.a:
80 | (cd ..; $(MAKE) $(MFLAGS) objects)
81 |
82 | $(TARGET) : $(OBJS) ../object/libgopher.a
83 | $(CC) $(LDFLAGS) -o $@ $(OBJS) ../object/libgopher.a @REGEXLIBS@ @LIBS@
84 |
85 | install : all
86 | -mv $(CLIENTDIR)/$(TARGET) $(CLIENTDIR)/$(TARGET).old
87 | @INSTALL@ $(TARGET) $(CLIENTDIR)
88 |
89 | clean:
90 | -rm -f $(TARGET) $(OBJS) *.out *~ core
91 |
92 | $(OBJS): $(srcdir)/../object/GSgopherobj.h $(srcdir)/../conf.h
93 |
--------------------------------------------------------------------------------
/gophfilt/gophfilt.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | *
3 | * @(#)gophfilt.c 1.2
4 | *
5 | *********************************************************************
6 | * MODULE: gophfilt.c
7 | * Semi-traditional unix filter for gophering.
8 | *********************************************************************
9 | */
10 |
11 | #include
12 | #include "Stdlib.h"
13 | #include
14 | #include "conf.h"
15 | #include "string.h"
16 | #include "GSgopherobj.h"
17 |
18 | GopherObj *Oneshot;
19 |
20 | int DEBUG = 0;
21 |
22 | SIGRETTYPE timeout();
23 |
24 | /*** for getopt processing ***/
25 | extern char *optarg;
26 | extern int optind;
27 |
28 | #ifdef VMS
29 | int
30 | DCLsystem(command)
31 | char *command;
32 | {
33 | if(command && strcmp(command, ""))
34 | fprintf(stdout, "Cannot execute: %s\n", command);
35 | else
36 | fprintf(stdout, "Cannot spawn.\n");
37 | return(0);
38 | }
39 | #endif /* VMS */
40 |
41 | int
42 | main(argc, argv)
43 | int argc;
44 | char *argv[];
45 | {
46 |
47 | int manual = 0;
48 | int path = 0;
49 | int type = 0;
50 | unsigned timer = 10;
51 | char *host = CLIENT1_HOST;
52 | int port = CLIENT1_PORT;
53 | char *item = "";
54 | int c, x = 0;
55 | int numread, sockfd;
56 | char buf[1024];
57 |
58 | /* Allocate the Gopher object structure */
59 |
60 | Oneshot = GSnew();
61 |
62 | while ((c = getopt(argc, argv, "h:s:p:i:t:T:")) != -1)
63 | switch (c) {
64 | case 's':
65 | port = atoi(optarg);
66 | manual++;
67 | break;
68 | case 'p':
69 | GSsetPath(Oneshot, optarg);
70 | manual++;
71 | path++;
72 | break;
73 | case 'h':
74 | host = optarg;
75 | manual++;
76 | break;
77 | case 'T':
78 | timer = (unsigned)atoi(optarg);
79 | break;
80 | case 't':
81 | GSsetType(Oneshot, *optarg);
82 | manual++;
83 | type++;
84 | break;
85 | case 'i':
86 | item = optarg;
87 | manual++;
88 | break;
89 |
90 | default:
91 | #ifdef VMS
92 | fprintf(stdout, "Error in parsing command line arguments.\n");
93 | exit(0);
94 | #else
95 | return(-1);
96 | #endif
97 | }
98 |
99 | /**** Get a URL from the command line, if present ****/
100 |
101 | if (optind < argc && strchr(argv[optind], ':') != NULL) {
102 |
103 | x=GSfromURL(Oneshot, argv[optind], AFTP_HOST, AFTP_PORT, x);
104 | manual+=x;
105 | if (x & G_PATH)
106 | path++;
107 | if (x & G_TYPE)
108 | type++;
109 | if (x & G_HOST)
110 | host = GSgetHost(Oneshot);
111 | if (x & G_PORT)
112 | port = GSgetPort(Oneshot);
113 | }
114 |
115 | /* Set the port to either the default or one provided */
116 |
117 | GSsetPort(Oneshot, port);
118 | GSsetHost(Oneshot, host);
119 |
120 | /* See if the minimum stuff was provided */
121 |
122 | if (manual && (!path || !type)) {
123 | #ifdef VMS
124 | fprintf(stdout,
125 | "Manual operation and insufficient parameters were provided.\n");
126 | exit(0);
127 | #else
128 | return(-2); /* error if not */
129 | #endif
130 | }
131 |
132 | /* Get the selector item from stdin if not already filled in by hand */
133 |
134 | if (!manual) {
135 | if (GSfromNet(Oneshot, 0) < 0) {
136 | /* Error if cannot get it */
137 | #ifdef VMS
138 | fprintf(stdout,
139 | "Piped operation and unable to read selector from stdin.\n");
140 | exit(0);
141 | #else
142 | return(-3);
143 | #endif
144 | }
145 | }
146 |
147 | /** Get the kind of file from the first character **/
148 | /** Filter out files that we can't deal with **/
149 |
150 | switch (GSgetType(Oneshot)) {
151 | case A_FILE:
152 | case A_DIRECTORY:
153 | case A_MACHEX:
154 | case A_PCBIN:
155 | case A_CSO:
156 | case A_INDEX:
157 | case A_SOUND:
158 | case A_UNIXBIN:
159 | case A_GIF:
160 | case A_HTML:
161 | case A_MIME:
162 | case A_IMAGE:
163 | break;
164 | default:
165 | #ifdef VMS
166 | fprintf(stdout, "Unsupported item type requested.\n");
167 | exit(0);
168 | #else
169 | return(-4);
170 | #endif
171 | }
172 |
173 |
174 | /* Connect to the specified server */
175 | if ((sockfd = GSconnect(Oneshot)) <0) {
176 | #ifdef VMS
177 | fprintf(stdout,
178 | "Unable to connect to specified host and port combination.\n");
179 | exit(0);
180 | #else
181 | return(-5);
182 | #endif
183 | }
184 |
185 | /** Send out the request **/
186 |
187 | writestring(sockfd, GSgetPath(Oneshot));
188 | if (strlen(item)) {
189 | writestring(sockfd, "\t");
190 | writestring(sockfd, item);
191 | }
192 | writestring(sockfd, "\r\n");
193 |
194 | /* Set an alarm in case we get nothing */
195 |
196 | (void)signal(SIGALRM, timeout);
197 | (void)alarm(timer);
198 |
199 | switch (GSgetType(Oneshot)) {
200 |
201 | case A_FILE: /* contents of a plain file */
202 | case A_DIRECTORY: /* listing of a directory */
203 | case A_MACHEX: /* results of a search */
204 | case A_INDEX:
205 | /* Text ends with a lonesome '.' on a line */
206 | while (readline(sockfd, buf, sizeof(buf)) > 0) {
207 | (void)alarm((unsigned)0);
208 | (void)alarm(timer);
209 | ZapCRLF(buf);
210 | if (*buf == '.' && *(buf+1) == '\0')
211 | break;
212 | fputs(buf, stdout);
213 | putc('\n', stdout);
214 | }
215 |
216 | break;
217 |
218 | case A_SOUND: /* Binary stuff */
219 | case A_IMAGE:
220 | case A_GIF:
221 | case A_UNIXBIN:
222 | case A_PCBIN:
223 | /* Binary stuff we just read til it's gone */
224 | while ((numread = readn(sockfd, buf, sizeof buf)) > 0) {
225 | (void)alarm((unsigned)0);
226 | (void)alarm(timer);
227 | if (fwrite(buf, numread, 1, stdout) == 0) {
228 | close(sockfd);
229 | #ifdef VMS
230 | fprintf(stderr, "Error encountered writing to stdout.\n");
231 | #else
232 | return(-6);
233 | #endif
234 | }
235 | }
236 | break;
237 | }
238 |
239 | close(sockfd);
240 | (void)alarm((unsigned)0);
241 | #ifdef VMS
242 | exit(1);
243 | #else
244 | return(0);
245 | #endif
246 | }
247 | /*SUBTTL timeout() - Alarm expired while awaiting data */
248 | /*
249 | */
250 | SIGRETTYPE timeout()
251 | {
252 | #ifdef VMS
253 | fprintf(stdout, "Timeout occurred while waiting for more data.\n");
254 | exit(0);
255 | #else
256 | exit(-7);
257 | #endif
258 | }
259 |
--------------------------------------------------------------------------------
/gophfilt/make_gophfilt.com:
--------------------------------------------------------------------------------
1 | $ vg = 'f$verify(0)'
2 | $!********************************************************************
3 | $! F.Macrides 15-Dec-1994 Enable DEBUG build via P2.
4 | $! F.Macrides 01-Dec-1994 Initial version.
5 | $!********************************************************************
6 | $! MODULE: makefilt.com
7 | $! compiling and linking script for gophfilt
8 | $!********************************************************************/
9 | $!
10 | $ IF P1 .EQS. ""
11 | $ THEN
12 | $ type/nopage sys$input:
13 | Usage:
14 | @compile UCX
15 | @compile WOLLONGONG
16 | @compile MULTINET
17 | @compile CMUIP
18 | @compile NETLIB
19 | @compile TCPWARE
20 | $ exit
21 | $ ENDIF
22 | $ IF P2 .EQS. "DEBUG"
23 | $ THEN
24 | $ write sys$output "Compiling gophfilt with DEBUG..."
25 | $ debug := "/obj=gophfilt.objd/debug/noopt"
26 | $ ELSE
27 | $ debug := ""
28 | $ ENDIF
29 | $!
30 | $ ON CONTROL_Y THEN GOTO CLEANUP
31 | $ ON ERROR THEN GOTO CLEANUP
32 | $!
33 | $ IF P1 .eqs. "TCPWARE"
34 | $ THEN
35 | $ write sys$output "Compiling gophfilt with UCX emulation..."
36 | $ transport := "UCX"
37 | $ ELSE
38 | $ transport := "''P1'"
39 | $ ENDIF
40 | $!
41 | $ IF f$trnlnm("VAXCMSG") .eqs. "DECC$MSG" .or. -
42 | f$trnlnm("DECC$CC_DEFAULT") .eqs. "/DECC"
43 | $ THEN
44 | $ optfile := "''P1'_DECC"
45 | $ vg1 = f$verify(1)
46 | $! DECC:
47 | $ define/nolog C$USER_INCLUDE [-],[-.object]
48 | $ define/nolog DECC$USER_INCLUDE [-],[-.object]
49 | $ vg1 = 'f$verify(0)'
50 | $ IF transport .eqs. "UCX"
51 | $ THEN
52 | $ vg1 = f$verify(1)
53 | $ cc/prefix=(all,except=(setlocale))-
54 | /warning=(disable=implicitfunc)-
55 | /define=('transport'=1,__VMS_CURSES)-
56 | 'debug' gophfilt.c
57 | $ vg1 = 'f$verify(0)'
58 | $ ELSE
59 | $ vg1 = f$verify(1)
60 | $ cc/prefix=(all,except=(connect,gethostbyname,htons,inet_addr,-
61 | setsockopt,socket,setlocale))-
62 | /warning=(disable=implicitfunc)-
63 | /define=('transport'=1,__VMS_CURSES)-
64 | 'debug' gophfilt.c
65 | $ vg1 = 'f$verify(0)'
66 | $ ENDIF
67 | $ ELSE
68 | $ optfile := "''P1'_VAXC"
69 | $ vg1 = f$verify(1)
70 | $! VAXC:
71 | $ cc/include=([-],[-.object])/define=('transport'=1)-
72 | 'debug' gophfilt.c
73 | $ vg1 = 'f$verify(0)'
74 | $ ENDIF
75 | $!
76 | $ IF P2 .eqs. "DEBUG"
77 | $ THEN
78 | $ vg1 = f$verify(1)
79 | $!
80 | $ link/debug/exe=gophfilt_debug-
81 | gophfilt.objd,[-.object]libgopher_debug/lib,-
82 | sys$library:vaxccurse/lib,-
83 | sys$disk:[-.gopher.vmsopts]'optfile'/opt
84 | $!
85 | $ vg1 = 'f$verify(0)'
86 | $ ELSE
87 | $ vg1 = f$verify(1)
88 | $!
89 | $ link gophfilt.obj,[-.object]libgopher/lib,-
90 | sys$library:vaxccurse/lib,-
91 | sys$disk:[-.gopher.vmsopts]'optfile'/opt
92 | $!
93 | $ vg1 = 'f$verify(0)'
94 | $ ENDIF
95 | $!
96 | $ CLEANUP:
97 | $ vg1 = f$verify(vg)
98 | $exit
99 |
--------------------------------------------------------------------------------
/gophfilt/tryit.com:
--------------------------------------------------------------------------------
1 | $ v = 'f$verify(0)'
2 | $!********************************************************************
3 | $! F.Macrides 15-Dec-1994 Enable DEBUG build via P2.
4 | $! F.Macrides 01-Dec-1994 Initial version.
5 | $!********************************************************************
6 | $! MODULE: tryit.com
7 | $! Example DCL script for use with gophfilt
8 | $!********************************************************************/
9 | $ set noon
10 | $ IF f$type(gophfilt) .eqs. ""
11 | $ THEN
12 | $ v = f$verify(1)
13 | $!***************************************************
14 | $! define gophfilt as a foreign command:
15 | $!
16 | $! gophfilt :== $device[directory]gophfilt.exe
17 | $!
18 | $ v = 'f$verify(0)'
19 | $ exit
20 | $!
21 | $ ENDIF
22 | $ v = f$verify(1)
23 | $!**************************************************
24 | $! Pass filename as P1 if you want output to a file:
25 | $!
26 | $ if P1 .nes. "" then define sys$output "''P1'"
27 | $!
28 | $!************************
29 | $! Try it with qualifiers:
30 | $!
31 | $ gophfilt -t 0 -p "0/Information About Gopher/about"-
32 | -h gopher.tc.umn.edu -s 70
33 | $!
34 | $!*******************
35 | $! Try it with a URL:
36 | $!
37 | $ gophfilt "gopher://gopher.tc.umn.edu:70/00/Information%20About%20Gopher/about"
38 | $!
39 | $!*******************************************************
40 | $! Try it with tabbed stream input from the command file:
41 | $!
42 | $ gophfilt
43 | 0 0/Information About Gopher/about gopher.tc.umn.edu 70
44 | $!
45 | $ v = 'f$verify(0)'
46 | $ exit
47 |
--------------------------------------------------------------------------------
/make.com:
--------------------------------------------------------------------------------
1 | $ v = 'f$verify(0)'
2 | $!********************************************************************
3 | $ IF P1 .EQS. ""
4 | $ THEN
5 | $ type/nopage sys$input:
6 | Usage:
7 | @make UCX
8 | @make WOLLONGONG
9 | @make MULTINET
10 | @make CMUIP
11 | @make NETLIB
12 | @make TCPWARE
13 | $ exit
14 | $ ENDIF
15 | $!
16 | $ ON CONTROL_Y THEN GOTO CLEANUP
17 | $ ON ERROR THEN GOTO CLEANUP
18 | $ v1 = f$verify(1)
19 | $ set default [.object]
20 | $ v1 = 'f$verify(0)'
21 | $ @compile 'P1' 'P2'
22 | $ @link 'P1' 'P2'
23 | $!
24 | $ v1 = f$verify(1)
25 | $ set default [-.gopher]
26 | $ v1 = 'f$verify(0)'
27 | $ @compile 'P1' 'P2'
28 | $ @link 'P1' 'P2'
29 | $!
30 | $ v1 = f$verify(1)
31 | $ set default [-.gophfilt]
32 | $ v1 = 'f$verify(0)'
33 | $ @make_gophfilt 'P1' 'P2'
34 | $ IF P2 .eqs. "DEBUG"
35 | $ THEN
36 | $ v1 = f$verify(1)
37 | $ set default [-]
38 | $ v1 = 'f$verify(0)'
39 | $ goto CLEANUP
40 | $ ENDIF
41 | $!
42 | $ v1 = f$verify(1)
43 | $ set default [-.gopher.locales]
44 | $ v1 = 'f$verify(0)'
45 | $ @make
46 | $!
47 | $ v1 = f$verify(1)
48 | $ set default [-.-]
49 | $ v1 = 'f$verify(0)'
50 | $!
51 | $ CLEANUP:
52 | $ v1 = f$verify(v)
53 | $exit
54 |
--------------------------------------------------------------------------------
/object/BLblock.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.2 $
4 | * $Date: 2000/12/20 01:19:20 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/BLblock.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992,1993 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: BLblock.h
14 | * Header file and abstraction of a gopher+ block
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: BLblock.h,v $
18 | * Revision 1.2 2000/12/20 01:19:20 jgoerzen
19 | * Added patches from David Allen
20 | *
21 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
22 | * Import from UMN Gopher 2.3.1 after GPLization
23 | *
24 | * Revision 3.5 1995/09/26 05:16:30 lindner
25 | * more fixes...
26 | *
27 | * Revision 3.4 1995/09/25 22:07:16 lindner
28 | * Ansification
29 | *
30 | * Revision 3.3 1995/02/27 17:45:32 lindner
31 | * Use enums for block structures
32 | *
33 | * Revision 3.2 1993/03/26 19:50:41 lindner
34 | * Mitra fixes for better/clearer fromNet code
35 | *
36 | * Revision 3.1.1.1 1993/02/11 18:03:06 lindner
37 | * Gopher+1.2beta release
38 | *
39 | * Revision 1.1 1993/01/31 00:31:12 lindner
40 | * Initial revision
41 | *
42 | *
43 | *********************************************************************/
44 |
45 |
46 | #ifndef BLBLOCK_H
47 | #define BLBLOCK_H
48 |
49 | #include "STRstring.h"
50 | #include "STAarray.h"
51 | #include "boolean.h"
52 | #include "util.h"
53 |
54 | /** Return Values for *fromNet() functions **/
55 | #define SOFTERROR -1
56 | #define HARDERROR -2
57 | #define MORECOMING 1
58 | #define FOUNDEOF 0
59 |
60 |
61 | typedef struct block_struct Blockobj;
62 | typedef DynArray BlockArray;
63 |
64 | #include "GSgopherobj.h"
65 |
66 |
67 | /** The different types of blocks **/
68 | enum blocktype {
69 | BLOCK_UNKNOWN =0,
70 | BLOCK_VIEW =1,
71 | BLOCK_ASK =2,
72 | BLOCK_ABSTRACT =3,
73 | BLOCK_ADMIN =4
74 | };
75 | typedef enum blocktype BlockType;
76 |
77 |
78 | /** The block data is a union, it can either be a filename or the
79 | ** actual data in a STRarray, or a gopher reference.
80 | **/
81 |
82 | union BlockData_union {
83 | String *filename;
84 | StrArray *text;
85 | GopherObj *gs;
86 | };
87 |
88 | typedef union BlockData_union BlockData;
89 |
90 |
91 | enum blockdatatype {
92 | BDATA_NONE =0,
93 | BDATA_FILE =1,
94 | BDATA_TEXT =2,
95 | BDATA_GREF =3
96 | };
97 | typedef enum blockdatatype BlockDataType;
98 |
99 |
100 | struct block_struct
101 | {
102 | BlockType btype;
103 | String *Blockname;
104 | BlockDataType datatype;
105 | BlockData data;
106 | };
107 |
108 |
109 | /****** Macros/data access ********/
110 | #define BLgetName(a) (STRget((a)->Blockname))
111 | #define BLsetName(a,b) (STRset((a)->Blockname,(b)))
112 |
113 | #define BLgetBlocktype(a) (STRget((a)->btype))
114 | #define BLsetBlocktype(a,b) (STRset((a)->btype,(b)))
115 |
116 | #define BLgetDatatype(a) ((a)->datatype)
117 |
118 | /**** Prototype declarations. ****/
119 | Blockobj *BLnew();
120 | void BLdestroy(Blockobj *bl);
121 | void BLinit(Blockobj *bl);
122 | void BLcpy(Blockobj *dest, Blockobj *orig);
123 | int BLgetNumLines(Blockobj *bl);
124 |
125 | void BLsetFile(Blockobj *bl, char *filename);
126 | void BLsetGref(Blockobj *bl, GopherObj *);
127 | void BLsetText(Blockobj *bl, StrArray *sta);
128 | char * BLgetLine(Blockobj *bl, int lineno);
129 | void BLtoNet(Blockobj *bl, int fd, boolean showheader);
130 | int BLfromNet(Blockobj *bl, int fd, char *blockname);
131 | int BLAsearch(BlockArray *bla, char *bname);
132 | void BLaddText(Blockobj *bl, char *text);
133 |
134 | /*************************************************************
135 | ** Define a dynamic block array
136 | **/
137 |
138 | #include "DAarray.h"
139 |
140 | #define BLAnew(a) (DAnew((a),BLnew,BLinit,BLdestroy,BLcpy))
141 | #define BLAinit(a) (DAinit((a)))
142 | #define BLAgetTop(a) (DAgetTop(a))
143 | #define BLAgetEntry(a,b) (Blockobj*)(DAgetEntry(a,b))
144 | #define BLApush(a,b) (DApush((DynArray*)(a),(char*)(b)))
145 | #define BLAdestroy(a) (DAdestroy(a))
146 | #define BLAcpy(a,b) (DAcpy(a,b))
147 |
148 | #endif
149 |
--------------------------------------------------------------------------------
/object/DAarray.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * lindner
3 | * 3.1.1.1
4 | * 1993/02/11 18:03:06
5 | * /home/mudhoney/GopherSrc/CVS/gopher+/object/DAarray.h,v
6 | * Exp
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: DAarray.h
14 | * Dynamic Array Header file/abstraction
15 | *********************************************************************
16 | * Revision History:
17 | * DAarray.h,v
18 | * Revision 3.1.1.1 1993/02/11 18:03:06 lindner
19 | * Gopher+1.2beta release
20 | *
21 | * Revision 1.2 1992/12/21 20:04:04 lindner
22 | * Added DAcpy()
23 | *
24 | * Revision 1.1 1992/12/10 23:27:52 lindner
25 | * gopher 1.1 release
26 | *
27 | *
28 | *********************************************************************/
29 |
30 |
31 | #ifndef DAARRAY_H
32 | #define DAARRAY_H
33 |
34 | /*
35 | * A dynamic array class
36 | */
37 |
38 | struct da_struct {
39 | char **objects; /** Should be void** perhaps */
40 |
41 | int Top;
42 | int maxsize;
43 |
44 | char * (*newfn)();
45 | void (*initfn)();
46 | void (*destroyfn)();
47 | char * (*copyfn)();
48 | };
49 |
50 | typedef struct da_struct DynArray;
51 |
52 | #define DAgetEntry(a,b) (((a)->objects[b]))
53 | #define DAgetTop(a) ((a)->Top)
54 | #define DAsetTop(a,b) ((a)->Top=(b))
55 | #define DAgetNumitems(a) ((a)->Top)
56 |
57 | DynArray *DAnew();
58 | void DAdestroy(DynArray *da);
59 | void DAinit(DynArray *da);
60 | void DApush(DynArray *da, char *obj);
61 | char * DApop(DynArray *da);
62 | void DAsort(DynArray *da, int (*sortfn)());
63 | void DAgrow(DynArray *da, int size);
64 | void DAsort(DynArray *da, int (*sortfn)());
65 | void DAcpy(DynArray *dest, DynArray *orig);
66 | #endif
67 |
68 |
69 |
--------------------------------------------------------------------------------
/object/Debug.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Debug.c,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 92, 93 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Debug.c
14 | * Debugging utilities..
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Debug.c,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.3 1994/01/21 04:07:21 lindner
22 | * Update function declaration (alanc)
23 | *
24 | * Revision 3.2 1993/07/29 20:00:22 lindner
25 | * Added Debugf
26 | *
27 | *
28 | *********************************************************************/
29 |
30 | #include
31 |
32 | int DEBUG = 0;
33 |
34 | #ifdef __STDC__
35 | #include
36 | #else
37 | #include
38 | #endif
39 |
40 |
41 | #ifdef __STDC__
42 | void Debugf(const char *fmt, ...)
43 | #else /* !__STDC__ */
44 | void
45 | Debugf(fmt, va_alist)
46 | char *fmt;
47 | va_dcl
48 | #endif /* __STDC__ */
49 |
50 | {
51 | va_list args;
52 |
53 | #ifdef __STDC__
54 | va_start(args, fmt);
55 | #else
56 | va_start(args);
57 | #endif
58 |
59 | (void) vfprintf(stderr, fmt, args);
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/object/Debug.h:
--------------------------------------------------------------------------------
1 | #ifndef DEBUG_H
2 | #define DEBUG_H
3 |
4 | #include "boolean.h"
5 |
6 | extern boolean DEBUG;
7 |
8 | #ifdef DEBUGGING
9 | # include
10 | # define Debug(str,val) if (DEBUG) { fprintf(stderr,str,val); }
11 | # define Debugmsg(str) if (DEBUG) { fprintf(stderr,str); }
12 | # define DebugGSplusPrint(gop,str) if (DEBUG) { GSplusPrint(gop,str); }
13 |
14 | #else
15 |
16 | # define Debug(str,val)
17 | # define Debugmsg(str)
18 | # define DebugGSplusPrint(gop,str)
19 |
20 | #endif
21 |
22 | #endif /* DEBUG_H */
23 |
--------------------------------------------------------------------------------
/object/Dirent.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Dirent.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Dirent.h
14 | * Portably include dir.h dirent.h, etc.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Dirent.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.10 1996/01/04 18:25:27 lindner
22 | * Updates for autoconf
23 | *
24 | * Revision 3.9 1995/02/01 21:43:13 lindner
25 | * Put back an AIX dirent fix..
26 | *
27 | * Revision 3.8 1994/12/12 17:43:27 lindner
28 | * Hack around AIX
29 | *
30 | * Revision 3.7 1994/11/18 21:43:35 lindner
31 | * Fix error msgs on NeXTstep
32 | *
33 | * Revision 3.6 1994/03/17 04:37:12 lindner
34 | * Lame VMS port
35 | *
36 | * Revision 3.5 1993/12/27 16:12:07 lindner
37 | * Mods for Apollo Domain systems
38 | *
39 | * Revision 3.4 1993/09/30 23:18:25 lindner
40 | * pl8
41 | *
42 | * Revision 3.3 1993/07/13 04:03:59 lindner
43 | * added 386BSD
44 | *
45 | * Revision 3.2 1993/05/25 22:02:10 lindner
46 | * Fix problems with CDC epix systems
47 | *
48 | * Revision 3.1.1.1 1993/02/11 18:03:02 lindner
49 | * Gopher+1.2beta release
50 | *
51 | * Revision 1.1 1992/12/10 23:27:52 lindner
52 | * gopher 1.1 release
53 | *
54 | *
55 | *********************************************************************/
56 |
57 | #if !defined(GDIRENT_H) && !defined(VMS)
58 | #define GDIRENT_H
59 |
60 | #include
61 |
62 | #if HAVE_DIRENT_H
63 | # include
64 | # define NAMLEN(dirent) strlen((dirent)->d_name)
65 | #else
66 | # define dirent direct
67 | # define NAMLEN(dirent) (dirent)->d_namlen
68 | # if HAVE_SYS_NDIR_H
69 | # include
70 | # endif
71 | # if HAVE_SYS_DIR_H
72 | # include
73 | # endif
74 | # if HAVE_NDIR_H
75 | # include
76 | # endif
77 | #endif
78 |
79 | #include "Stat.h"
80 |
81 | #ifndef S_ISDIR
82 | # define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
83 | #endif
84 |
85 | #ifndef S_ISREG
86 | # define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
87 | #endif
88 |
89 |
90 | #endif /* GDIRENT_H */
91 |
--------------------------------------------------------------------------------
/object/GDgopherdir.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/GDgopherdir.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: GDgopherdir.h
14 | * Header file/abstraction of a gopher directory
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: GDgopherdir.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.7 1995/10/31 16:47:57 lindner
22 | * Switch to void+ pointer
23 | *
24 | * Revision 3.6 1995/09/25 22:07:17 lindner
25 | * Ansification
26 | *
27 | * Revision 3.5 1994/07/21 22:26:37 lindner
28 | * Alan's GDlocation stuff
29 | *
30 | * Revision 3.4 1994/01/21 04:47:20 lindner
31 | * Add function prototypes
32 | *
33 | * Revision 3.3 1994/01/10 03:29:07 lindner
34 | * New Method GDsetNumitems()
35 | *
36 | * Revision 3.2 1993/04/15 21:35:59 lindner
37 | * Changed protos
38 | *
39 | * Revision 3.1.1.1 1993/02/11 18:03:03 lindner
40 | * Gopher+1.2beta release
41 | *
42 | * Revision 1.1 1992/12/10 23:27:52 lindner
43 | * gopher 1.1 release
44 | *
45 | *
46 | *********************************************************************/
47 |
48 | #ifndef GDGOPHERDIR_H
49 | #define GDGOPHERDIR_H
50 | #include "GSgopherobj.h"
51 | #include "DAarray.h"
52 |
53 | /****************************************************************
54 | ** A Gopher directory structure...
55 | ** Features dynamic growth among other things...
56 | **
57 | *****************************************************************/
58 |
59 | struct g_dir_struct {
60 | String *Title;
61 |
62 | GopherObj *Location;
63 |
64 | DynArray *Gophers;
65 |
66 | int currentitem;
67 | };
68 |
69 | typedef struct g_dir_struct GopherDirObj;
70 | typedef struct g_dir_struct *GopherDirObjp;
71 |
72 | #define GDgetEntry(a,b) ((GopherObj *)(DAgetEntry((a)->Gophers,(b))))
73 | #define GDgetTitle(a) (STRget((a)->Title))
74 | #define GDsetTitle(a,b) (STRset((a)->Title,b))
75 | #define GDgetLocation(a) ((a)->Location)
76 | #define GDgetNumitems(a) (DAgetNumitems((a)->Gophers))
77 | #define GDsetNumitems(a,b) (DAsetTop((a)->Gophers,(b)))
78 |
79 | #define GDsetCurrentItem(a,b) ((a)->currentitem=b)
80 | #define GDgetCurrentItem(a) ((a)->currentitem)
81 |
82 | /*** Real live functions declared in GDgopherdir.c ***/
83 |
84 | GopherDirObj *GDnew(int size);
85 | void GDdestroy(GopherDirObj *);
86 | void GDinit(GopherDirObj *);
87 | void GDsetLocation(GopherDirObj *gd, GopherObj *gs);
88 | void GDaddGS(GopherDirObj *gd, GopherObj *gs);
89 | void GDaddGSmerge(GopherDirObj *gd, GopherObj *gs);
90 | void GDsort(GopherDirObj *);
91 | void GDtoNet(GopherDirObj *gd, int sockfd, GSformat fmt, char *ticket,
92 | void (*prefcn)());
93 | void GDplustoNet(GopherDirObj *gd, int sockfd, char **filter,
94 | char *ticket);
95 | void GDfromNet(GopherDirObj *gd, int sockfd, int (*eachitem)());
96 | int GDplusfromNet(GopherDirObj *gd, int fd, int (*eachitem)());
97 | void GDgrow();
98 | void GDfromLink(GopherDirObj *, FileIO *, char *, int, char*, char*);
99 | void GDtoLink(GopherDirObj *gd, int fd);
100 | GopherDirObj *GDdeleteGS(GopherDirObj *gd, int j);
101 | int GDSearch(GopherDirObj *gd, char *text);
102 | #endif /* GDGOPHERDIR_H */
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/object/Locale.h:
--------------------------------------------------------------------------------
1 | /*
2 | * These routines make using the international messages facilities easier.
3 | *
4 | * This interface could be applied to methods other than X/Open coding
5 | * (VMS etc..)
6 | *
7 | * Copyright (c) 1994 University of Minnesota
8 | */
9 |
10 | #ifndef GLOCALE_H
11 | #define GLOCALE_H
12 |
13 |
14 | #if defined(_XOPEN_SOURCE) || defined(_AIX) || defined(__osf__)
15 | # define GINTERNATIONAL
16 | #endif
17 |
18 | #ifdef VMS
19 |
20 | # define LC_ALL ""
21 | void setlocale(char *, char *);
22 | void rsetlocale(int);
23 | char *Gtxt(char *, int);
24 | int Gtxtopen(char *,int);
25 | char *catgets(int, int, int, char *);
26 | # define A_LANGUAGE '\001'
27 | # define GINTERNATIONAL
28 | # define NL_SETD 0
29 | typedef int nl_catd;
30 |
31 | #else /* Unix: */
32 |
33 | # ifndef GINTERNATIONAL /* Only use i18n routines if we're sure */
34 | # define Gtxtlocale(a,b)
35 | # define setlocale(a,b)
36 | # define Gtxtopen(a,b)
37 | # define Gtxt(a,b) a
38 | # else
39 | # include "compatible.h"
40 |
41 | # if !defined(HAVE_LOCALE_H)
42 | # undef NO_LOCALE
43 | # define NO_LOCALE
44 | # undef NO_XPGCAT /** Can't use X/Open message catalogs **/
45 | # define NO_XPGCAT /** without setlocale() **/
46 | # define LC_ALL 0
47 | # define LC_MESSAGES 1
48 | # else
49 | # include
50 | # endif
51 |
52 | /** Figure out which systems have catopen() etal **/
53 | # if !defined(__svr4__) && !defined(_XOPEN_SOURCE) && !defined(_XOPEN_VERSION)
54 | # undef NO_XPGCAT
55 | # define NO_XPGCAT
56 | # endif
57 |
58 | # ifndef NO_XPGCAT
59 | # include
60 | # else
61 | typedef int nl_catd;
62 | # endif
63 |
64 | # ifndef NL_SETD
65 | # define NL_SETD 0 /* SunOS 4.1.3 with xpg2bin/cc compiler */
66 | # endif
67 |
68 | /*** Define some nice convenience routines ***/
69 | /** It would sure be nice to use gettext() routines... oh well...***/
70 |
71 | extern nl_catd Gcatd;
72 |
73 | char *Gtxtlocale();
74 | char *Gtxt();
75 | nl_catd Gtxtopen();
76 |
77 | # endif /* GINTERNATIONAL */
78 | #endif /* VMS */
79 | #endif /* GLOCALE_H */
80 |
81 |
--------------------------------------------------------------------------------
/object/Makefile.in:
--------------------------------------------------------------------------------
1 | srcdir = @srcdir@
2 | top_srcdir = @top_srcdir@
3 | VPATH = @srcdir@
4 |
5 | include ../Makefile.config
6 |
7 |
8 | CCFLAGS = $(OPT) @CFLAGS@ $(INTLOPTS) $(DEBUGGING) $(WAISTYPE) $(SOCKSFLAGS) -I.. -I$(srcdir) -I$(top_srcdir)
9 |
10 | OBJS = STRstring.o GDgopherdir.o GSgopherobj.o \
11 | DAarray.o VIews.o BLblock.o \
12 | Sockets.o util.o compatible.o \
13 | url.o Debug.o Regex.o \
14 | fileio.o Locale.o RBTree.o
15 |
16 |
17 | TARGET = libgopher.a libgopher.so.0.1
18 |
19 | all: shared $(TARGET)
20 |
21 | #
22 | # Make shared library directories
23 | #
24 | shared:
25 | @-if [ -f /lib/ld.so -a "$(SHAREDLIB)" = "sun" ]; \
26 | then \
27 | mkdir shared-sun; \
28 | fi
29 | touch shared
30 |
31 |
32 | .c.o: $(OBJS)
33 | @CC@ $(CCFLAGS) $(PIC) -c $<
34 | @-if [ -d shared-sun ]; then \
35 | echo "Building shared version of $@"; \
36 | @CC@ $(CCFLAGS) -fPIC -o shared-sun/$@ -c $<; \
37 | fi
38 |
39 | #
40 | # Stuff for shared libraries
41 | #
42 |
43 | libgopher.so.0.1: $(OBJS)
44 | @-if [ -d shared-sun ]; then \
45 | echo "Building shared library $@"; \
46 | cd shared-sun; \
47 | rm -f $@; \
48 | ld -o $@ -assert pure-text $(OBJS);\
49 | mv $@ ..; \
50 | fi
51 |
52 | libgopher.sa.0.1: $(OBJS)
53 | ;
54 |
55 |
56 | libgopher.a: $(OBJS)
57 | rm -f libgopher.a
58 | ar rcv libgopher.a $(OBJS)
59 | @RANLIB@ libgopher.a || true
60 |
61 | clean:
62 | -rm -f $(TARGET) $(OBJS) *.out *~ core TAGS \
63 | *.sa.* shared
64 | -rm -rf shared-sun
65 |
66 | GSgopherobj.o: $(srcdir)/GSgopherobj.h
67 |
68 |
69 | Locale.o: $(srcdir)/Locale.h $(srcdir)/Locale.c
70 | @CC@ $(CCFLAGS) $(PIC) -DLOCALEDIR=\"$(CLIENTLIB)/gophernls\" -c $(srcdir)/Locale.c
71 | @-if [ -d shared-sun ]; then \
72 | echo "Building shared version of $@"; \
73 | @CC@ $(CCFLAGS) -DLOCALEDIR=\"$(CLIENTLIB)/gophernls\" \
74 | -fPIC -o shared-sun/$@ -c $(srcdir)/Locale.c; \
75 | fi
76 |
77 | #
78 | #install shared libraries if need be..
79 | #
80 | install:
81 | @-if [ -f *.so.* ]; then \
82 | echo "Installing Sun shared gopher library" ;\
83 | @INSTALL@ libgopher.so.0.1 $(CLIENTLIB); \
84 | @INSTALL@ libgopher.a $(CLIENTLIB); \
85 | fi
86 |
87 |
--------------------------------------------------------------------------------
/object/Malloc.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.3 $
4 | * $Date: 2002/01/28 03:38:58 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Malloc.h,v $
6 | * $Status: $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Malloc.h
14 | * Portable method of getting malloc definitions
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Malloc.h,v $
18 | * Revision 1.3 2002/01/28 03:38:58 jgoerzen
19 | * Patches for FreeBSD:
20 | * * Test in configure for stdlib.h
21 | * * Include stdlib.h if it's available in Malloc.h
22 | * * Don't include malloc.h if it's missing in Malloc.h
23 | * * Don't include strcasestr if it's present in util.c and util.h
24 | *
25 | * Revision 1.2 2000/08/23 00:03:59 jgoerzen
26 | * Updates
27 | *
28 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
29 | * Import from UMN Gopher 2.3.1 after GPLization
30 | *
31 | * Revision 3.9 1996/01/04 18:25:38 lindner
32 | * Updates for autoconf
33 | *
34 | * Revision 3.8 1995/06/30 20:30:01 lindner
35 | * NewMEM define
36 | *
37 | * Revision 3.7 1994/06/29 06:37:55 lindner
38 | * ...
39 | *
40 | * Revision 3.6 1994/06/29 05:44:17 lindner
41 | * Make sure to only include malloc.h once
42 | *
43 | * Revision 3.5 1994/05/24 05:42:17 lindner
44 | * Fix for old field version of DECC
45 | *
46 | * Revision 3.4 1994/05/19 14:25:24 lindner
47 | * faster VMS VAXC malloc
48 | *
49 | * Revision 3.3 1993/10/19 20:46:35 lindner
50 | * use stdio.h in Malloc.h to get NULL if necessary
51 | *
52 | * Revision 3.2 1993/10/11 17:23:32 lindner
53 | * Better malloc fix for systems without NULL
54 | *
55 | * Revision 3.1.1.1 1993/02/11 18:03:03 lindner
56 | * Gopher+1.2beta release
57 | *
58 | * Revision 1.1 1992/12/10 23:27:52 lindner
59 | * gopher 1.1 release
60 | *
61 | *
62 | *********************************************************************/
63 |
64 | #ifndef G_MALLOC_H
65 | #define G_MALLOC_H
66 |
67 | /*
68 | * Just enough to get us memory allocation and NULL
69 | *
70 | * Ick, portable code is ugly!
71 | */
72 |
73 | #include "Stdlib.h"
74 | #ifdef HAVE_MALLOC_H
75 | #include
76 | #endif
77 |
78 | #ifdef HAVE_STDLIB_H
79 | #include
80 | #endif
81 |
82 | /* Usually can get NULL from stdio.h */
83 | #ifndef NULL
84 | #include
85 | #endif
86 |
87 | /* Punt! */
88 | #ifndef NULL
89 | #define NULL ((void*) 0)
90 | #endif
91 |
92 |
93 | #ifdef HAVE_MALLOC_H
94 | # include
95 | #endif
96 |
97 | /* memory management for VAXC */
98 |
99 | #if defined(VMS) && defined(VAXC) && !defined(__DECC)
100 | # include
101 | # define malloc VAXC$MALLOC_OPT
102 | # define calloc VAXC$CALLOC_OPT
103 | # define free VAXC$FREE_OPT
104 | # define cfree VAXC$CFREE_OPT
105 | # define realloc VAXC$REALLOC_OPT
106 | #endif /* VMS and VAXC */
107 |
108 | #define NewMEM(a) ((a*)malloc(sizeof(a)))
109 |
110 |
111 | #endif /* G_MALLOC_H */
112 |
113 |
--------------------------------------------------------------------------------
/object/RBTree.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/RBTree.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1995 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: RBTree.h
14 | * Definition of a Red-Black balanced tree container.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: RBTree.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.2 1995/10/31 16:48:21 lindner
22 | * Better readability, fix bugs..
23 | *
24 | * Revision 3.1 1995/06/30 20:31:04 lindner
25 | * New red-black tree code
26 | *
27 | **********************************************************************/
28 |
29 | #include "boolean.h"
30 |
31 | enum direction {LEFT, RIGHT, NOWHERE };
32 | enum nodecolor {RED, BLACK};
33 |
34 | typedef enum direction direction;
35 | typedef enum nodecolor nodecolor;
36 |
37 | struct RBTree_node_struct {
38 | char *data;
39 |
40 | struct RBTree_node_struct *l_child;
41 | struct RBTree_node_struct *r_child;
42 |
43 | nodecolor rb_right;
44 | nodecolor rb_left;
45 |
46 | direction last_pass;
47 |
48 | };
49 |
50 | typedef struct RBTree_node_struct RBTree_node;
51 |
52 |
53 | #define RBTsetRBright(a,v) ((a)->rb_right=(v)) /* Sets ptr to black or Red */
54 | #define RBTsetRBleft(a,v) ((a)->rb_left=(v))
55 |
56 | #define RBTgetRBright(a) ((a)->rb_right)
57 | #define RBTgetRBleft(a) ((a)->rb_left)
58 |
59 | #define RBTgetDirection(a) ((a)->last_pass)
60 | #define RBTsetDirection(a,v) ((a)->last_pass=(v))
61 |
62 | #define RBTattachLeftNode(a,v) ((a)->l_child = (v))
63 | #define RBTattachRightNode(a,v) ((a)->r_child = (v))
64 |
65 | #define RBTgetRight(a) ((a)->r_child)
66 | #define RBTgetLeft(a) ((a)->l_child)
67 |
68 | #define RBTaddData(a,v) ((a)->data=(v))
69 | #define RBTgetData(a) ((a)->data)
70 |
71 | /**********************************************************************/
72 |
73 | struct RBTree_struct {
74 | RBTree_node *entry;
75 |
76 | int (*cmpfn)();
77 | void (*initfn)();
78 | void (*destroyfn)();
79 | char * (*copyfn)();
80 |
81 | };
82 |
83 | typedef struct RBTree_struct RBTree;
84 |
85 | /*** For the top level tree structure ***/
86 | #define RBTsetEntry(a,v) ((a)->entry = (v))
87 | #define RBTgetEntry(a) ((a)->entry)
88 |
89 | #define RBTcmp(a,b,c) ((a)->cmpfn(b,c))
90 | #define RBTdestroyfcn(a,b) ((a)->destroyfn(RBTgetData(b)))
91 |
92 | RBTree *RBTnew();
93 | void RBTdestroy(RBTree *rbt);
94 | void RBTtraverse(RBTree *rbt, void (*func)());
95 | char *RBTfind(RBTree *rbt, char* data);
96 | void RBTinsert(RBTree *rbt, char *data);
97 |
--------------------------------------------------------------------------------
/object/Regex.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.5 $
4 | * $Date: 2002/03/19 20:07:16 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Regex.c,v $
6 | * $Status: $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Regex.c
14 | * Portable method of doing regular expressions
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Regex.c,v $
18 | * Revision 1.5 2002/03/19 20:07:16 jgoerzen
19 | * GSgopherobj.c: Moved Regex.h include up.
20 | *
21 | * Regex.c, Regex.h: continuing full rewrites.
22 | *
23 | * Revision 1.4 2002/03/19 19:53:31 jgoerzen
24 | * *** empty log message ***
25 | *
26 | * Revision 1.3 2002/02/12 20:50:21 jgoerzen
27 | * Beginning of MacOS X (Darwin) support.
28 | * Many modifications to Regex.[ch], see debian/changelog for details.
29 | *
30 | * Revision 1.2 2002/02/12 19:54:18 jgoerzen
31 | * Updated with regex fixes
32 | *
33 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
34 | * Import from UMN Gopher 2.3.1 after GPLization
35 | *
36 | * Revision 3.2 1994/07/25 13:56:53 lindner
37 | * First crack at POSIX regular expressions
38 | *
39 | * Revision 3.1 1993/10/19 20:48:23 lindner
40 | * Portable versions of Regular expression routines for System V and BSD..
41 | *
42 | *
43 | *********************************************************************/
44 |
45 | #define __GOPHER_REGEX_C__
46 |
47 | /*
48 | * If you're using gcc on Solaris you might need to copy /usr/include/regexp.h
49 | * to /opt/whatever/regexp.h
50 | */
51 |
52 | #define REGEX_CODEIT /* only include sysv regex code once.. */
53 | #include "config.h"
54 | #include "Regex.h"
55 | #include "Malloc.h"
56 |
57 | /**************************************************
58 | POSIX
59 | **************************************************/
60 |
61 | #ifdef REGEX_POSIX
62 | regex_t preg;
63 | int pregallocated = 0;
64 |
65 | char *posix_re_comp(char *regex) {
66 | if (pregallocated) {
67 | regfree(&preg);
68 | }
69 |
70 | pregallocated = 1;
71 | return regcomp(&preg, regex, REG_NOSUB) ? "regcomp error" : NULL;
72 | }
73 |
74 | int posix_re_exec(char *string) {
75 | return ! regexec(&preg, string, 0, NULL, 0);
76 | }
77 |
78 | #endif /* REGEX_POSIX */
79 |
80 | /**************************************************
81 | SYSV
82 | **************************************************/
83 |
84 | #ifdef REGEX_SYSV
85 |
86 | #define ESIZE 512
87 | static char expbuf[ESIZE];
88 |
89 | char *
90 | re_comp(char *expr)
91 | {
92 | char *result;
93 |
94 | result = compile(expr, expbuf, &expbuf[ESIZE], '\0');
95 |
96 | return(NULL);
97 | }
98 |
99 | int
100 | re_exec(char *string)
101 | {
102 | return(step(string, expbuf));
103 | }
104 |
105 | #endif /* REGEX_SYSV */
106 |
--------------------------------------------------------------------------------
/object/STAarray.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/STAarray.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: STAarray.h
14 | * Header file, abstraction of a dynamic Strings array.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: STAarray.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.4 1995/09/26 05:16:32 lindner
22 | * more fixes...
23 | *
24 | * Revision 3.3 1993/07/27 00:30:13 lindner
25 | * plus patch from Mitra
26 | *
27 | * Revision 3.2 1993/03/26 19:51:05 lindner
28 | * Added STApop
29 | *
30 | * Revision 3.1.1.1 1993/02/11 18:03:07 lindner
31 | * Gopher+1.2beta release
32 | *
33 | * Revision 1.1 1993/01/31 00:34:40 lindner
34 | * Initial revision
35 | *
36 | * Revision 1.1 1992/12/10 23:27:52 lindner
37 | * gopher 1.1 release
38 | *
39 | *
40 | *********************************************************************/
41 |
42 | #ifndef STAARRAY_H
43 | #define STAARRAY_H
44 |
45 | #include "STRstring.h"
46 | #include "DAarray.h"
47 |
48 | typedef DynArray StrArray;
49 | #define STAnew(a) (DAnew((a),STRnew,STRinit,STRdestroy,STRcpy))
50 | #define STAinit(a) (DAinit((a)))
51 | #define STAgetTop(a) (DAgetTop(a))
52 | #define STAgetEntry(a,b) (String*)(DAgetEntry(a,b))
53 | /* Some places use STAgetEntry and then pretend they got a char* back)*/
54 | #define STAgetText(a,b) (char*)(STRget(STAgetEntry(a,b)))
55 | #define STApush(a,b) (DApush((DynArray*)(a),(char*)(b)))
56 | #define STApop(a) (String*)(DApop(a))
57 | #define STAdestroy(a) (DAdestroy(a))
58 | #define STAcpy(a,b) (DAcpy(a,b))
59 |
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/object/STRstring.c:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/STRstring.c,v $
6 | * $Status: $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: STRstring.c
14 | * Implement dynamic string library functions
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: STRstring.c,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.11 1995/09/25 22:07:19 lindner
22 | * Ansification
23 | *
24 | * Revision 3.10 1995/06/30 20:32:04 lindner
25 | * start protoing
26 | *
27 | * Revision 3.9 1994/03/17 05:52:49 lindner
28 | * Fix for multiple STRinits
29 | *
30 | * Revision 3.8 1994/03/04 17:31:39 lindner
31 | * Don't assume a char is one byte long
32 | *
33 | * Revision 3.7 1994/02/20 16:23:13 lindner
34 | * Optimize STRinit so that memory isn't freed then reallocated
35 | *
36 | * Revision 3.6 1993/10/27 18:53:23 lindner
37 | * don't forget \0
38 | *
39 | * Revision 3.5 1993/10/22 20:15:52 lindner
40 | * Remove superfulous declaration of len (Fote)
41 | *
42 | * Revision 3.4 1993/10/19 20:46:00 lindner
43 | * Better, tighter STRstring stuff (Fote)
44 | *
45 | * Revision 3.3 1993/08/16 19:35:09 lindner
46 | * Return a correct value for STRcpy
47 | *
48 | * Revision 3.2 1993/03/24 17:07:52 lindner
49 | * STRset with a NULL value will STRinit() the string
50 | *
51 | * Revision 3.1.1.1 1993/02/11 18:03:03 lindner
52 | * Gopher+1.2beta release
53 | *
54 | * Revision 1.1 1992/12/10 23:27:52 lindner
55 | * gopher 1.1 release
56 | *
57 | *
58 | *********************************************************************/
59 |
60 |
61 | #include "STRstring.h"
62 | #include "String.h"
63 | #include "Malloc.h"
64 |
65 | /*
66 | * Make a new string, don't set anything for default yet.
67 | */
68 |
69 | String *
70 | STRnew(void)
71 | {
72 | String *temp;
73 |
74 | temp = (String *) malloc(sizeof(String));
75 | temp->data = NULL;
76 | temp->len = 0;
77 |
78 | return(temp);
79 | }
80 |
81 | /*
82 | * Destroy a string
83 | */
84 |
85 | void
86 | STRdestroy(String *st)
87 | {
88 | if (st != NULL) {
89 | if (st->data != NULL)
90 | free(st->data);
91 | free(st);
92 | } else
93 | perror("STRdestroy: non existant string!\n");
94 |
95 | }
96 |
97 |
98 | /*
99 | * Don't free the memory. Instead, negate the length value and keep the
100 | * memory for later use. More efficient that way.
101 | */
102 |
103 | void
104 | STRinit(String *st)
105 | {
106 | if (st != NULL) {
107 | if (st->len > 0)
108 | st->len = - st->len;
109 | /* if (st->data != NULL) {
110 | free(st->data);
111 | st->data = NULL;
112 | }*/
113 | } else
114 | perror("STRinit, non existant string!");
115 | }
116 |
117 | /*
118 | * Set a string value
119 | */
120 |
121 | void
122 | STRset(String *st, char *str)
123 | {
124 | register int len;
125 |
126 | /* To set a null value, STRinit the item */
127 |
128 | if (str == NULL) {
129 | STRinit(st);
130 | return;
131 | }
132 |
133 | /* Negative value for len means memory is initialized, reset to
134 | positive value so the rest of the code works well.
135 | */
136 |
137 | if (st->len < 0)
138 | st->len = -st->len;
139 |
140 | if (*str == '\0')
141 | len = 1;
142 | else
143 | len = strlen(str)+1; /** Don't forget the '\0' **/
144 |
145 | /* Uninitialized data... */
146 |
147 | if (st->data == NULL) {
148 | st->data = (char *) malloc(sizeof(char*) * len);
149 | st->len = len;
150 | }
151 |
152 | /** Something's already there... **/
153 |
154 | else if (STRsize(st) < len) {
155 | char *temp;
156 |
157 | temp = (char *) realloc(st->data, sizeof(char) * len);
158 | /*** Should check for NULL ... ***/
159 | if (temp == NULL)
160 | perror("realloc failed...");
161 |
162 | st->data = temp;
163 | st->len = len;
164 | }
165 | /* space is ok and st->len is set, so copy in the new string */
166 | strcpy(st->data, str);
167 | }
168 |
169 | /*
170 | * Add a string to the end of the string that's there already
171 | */
172 |
173 | String*
174 | STRcat(String *st, char *cp)
175 | {
176 | int len;
177 | char *temp;
178 |
179 | if (cp == NULL)
180 | return(NULL);
181 |
182 | if (STRlen(st) == 0) {
183 | STRset(st, cp);
184 | return(st);
185 | }
186 |
187 | len = strlen(cp) + STRlen(st);
188 |
189 | temp = (char *) malloc(sizeof(char) * len);
190 | strcpy(temp, STRget(st));
191 | strcat(temp, cp);
192 |
193 | STRset(st, temp);
194 |
195 | free(temp);
196 |
197 | return(st);
198 | }
199 |
200 |
201 | int
202 | STRcmp(String *st1, String *st2)
203 | {
204 | register char *cp1, *cp2;
205 |
206 | cp1 = STRget(st1);
207 | cp2 = STRget(st2);
208 |
209 | if (cp1 == NULL)
210 | return(- !0);
211 | else if (cp2 == NULL)
212 | return( !0);
213 | else
214 | return(strcmp(cp1, cp2));
215 | }
216 |
217 | String*
218 | STRcpy(String *s1, String *s2)
219 | {
220 | STRset(s1, STRget(s2));
221 | return(s1);
222 | }
223 |
--------------------------------------------------------------------------------
/object/STRstring.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.7 $
4 | * $Date: 2002/03/19 20:46:09 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/STRstring.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: STRstring.h
14 | * A dynamic string in C that really wants to be C++
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: STRstring.h,v $
18 | * Revision 1.7 2002/03/19 20:46:09 jgoerzen
19 | * Tighten up __USE_GNU in STRstring.h
20 | *
21 | * Revision 1.6 2002/03/19 20:22:42 jgoerzen
22 | * Logged regex changes.
23 | * Include STRstring.h and strcasestr proto.
24 | *
25 | * Revision 1.5 2002/02/12 19:54:18 jgoerzen
26 | * Updated with regex fixes
27 | *
28 | * Revision 1.4 2000/08/23 00:11:36 jgoerzen
29 | * Fixed bug in macro.
30 | *
31 | * Revision 1.3 2000/08/23 00:09:59 jgoerzen
32 | * Trying to fix NULL problem still
33 | *
34 | * Revision 1.2 2000/08/22 23:52:44 jgoerzen
35 | * fooblah
36 | *
37 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
38 | * Import from UMN Gopher 2.3.1 after GPLization
39 | *
40 | * Revision 3.7 1995/09/25 22:07:20 lindner
41 | * Ansification
42 | *
43 | * Revision 3.6 1994/03/30 21:37:12 lindner
44 | * Fix for URL code
45 | *
46 | * Revision 3.5 1994/03/04 23:26:55 lindner
47 | * explicitly cast to char
48 | *
49 | * Revision 3.4 1994/02/20 16:23:27 lindner
50 | * Optimize STRinit so that memory isn't freed then reallocated
51 | *
52 | * Revision 3.3 1993/10/27 18:53:44 lindner
53 | * Add STRsize()
54 | *
55 | * Revision 3.2 1993/06/22 05:48:03 lindner
56 | * Mods for VMS
57 | *
58 | * Revision 3.1.1.1 1993/02/11 18:03:04 lindner
59 | * Gopher+1.2beta release
60 | *
61 | * Revision 1.1 1992/12/10 23:27:52 lindner
62 | * gopher 1.1 release
63 | *
64 | *
65 | *********************************************************************/
66 |
67 |
68 | #ifndef STRstring_H
69 | #define STRstring_H
70 |
71 |
72 | /* Define __USE_GNU for string.h so strcasestr gets included.
73 | (also _GNU_SOURCE for other systems) */
74 | #define __USE_GNU
75 | #define _GNU_SOURCE
76 | #include
77 | #undef __USE_GNU
78 | #undef _GNU_SOURCE
79 | #ifdef HAVE_STDLIB_H
80 | #include
81 | #endif
82 | #ifdef HAVE_MALLOC_H
83 | #include
84 | #endif
85 |
86 |
87 | struct string_struct {
88 | int len;
89 | char *data;
90 | };
91 |
92 | typedef struct string_struct String;
93 |
94 |
95 | /** VMS doesn't like multiple case blech! **/
96 | #ifdef VMS
97 | # define STRcpy GSTRcpy
98 | # define STRcmp GSTRcmp
99 | # define STRcat GSTRcat
100 | #endif
101 |
102 |
103 | String *STRnew(void);
104 | String *STRcpy(String*, String*);
105 | void STRinit(String*);
106 | void STRset(String*, char*);
107 | void STRdestroy(String*);
108 | #define STRget(s) ((char *)(((s)->len<0) ? NULL : (s)->data))
109 | #define STRlen(s) (((s)->len > 0) ? (s)->len : 0)
110 | #define STRsize(s) ((s)->len)
111 | String* STRcat(String *, char*);
112 | int STRcmp(String *, String*);
113 |
114 |
115 |
116 | #endif
117 |
118 |
--------------------------------------------------------------------------------
/object/Sockets.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.2 $
4 | * $Date: 2002/03/19 20:42:48 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Sockets.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Sockets.h
14 | * Socket protos etc.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Sockets.h,v $
18 | * Revision 1.2 2002/03/19 20:42:48 jgoerzen
19 | * * Removed the DOMAIN configure support, DOMAIN_NAME in gopherd,
20 | * backupdomain in Socket.c, etc. This should prevent the no.domain.name
21 | * problem that people have been seeing. Regenerated configure stuff.
22 | *
23 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
24 | * Import from UMN Gopher 2.3.1 after GPLization
25 | *
26 | * Revision 3.7 1995/09/25 22:07:21 lindner
27 | * Ansification
28 | *
29 | * Revision 3.6 1995/02/13 19:09:45 lindner
30 | * Add sys/param.h
31 | *
32 | * Revision 3.5 1994/04/08 20:05:54 lindner
33 | * gcc -Wall fixes
34 | *
35 | * Revision 3.4 1994/03/31 21:03:36 lindner
36 | * Use better, more descriptive return codes for socket routines
37 | *
38 | * Revision 3.3 1994/03/17 04:35:04 lindner
39 | * Move definitions from gopherd.h here
40 | *
41 | * Revision 3.2 1994/01/21 04:14:31 lindner
42 | * Add forward declaration for SOCKnetnames()
43 | *
44 | * Revision 3.1 1993/07/07 19:27:27 lindner
45 | * Socket functions
46 | *
47 | *
48 | *********************************************************************/
49 |
50 |
51 | #ifndef SOCKETS_H
52 | #define SOCKETS_H
53 |
54 | /* Socket specific stuff, ugh! */
55 | #ifdef VMS
56 | # if !defined(CMUIP) && !defined(NETLIB)
57 | # include
58 | # include
59 | # include
60 | # include
61 | # include
62 | # include iodef
63 | # include ssdef
64 | # else
65 | # include iodef
66 | # include ssdef
67 | # include errno
68 | # include perror
69 | # endif /* if !CMUIP && !NETLIB */
70 |
71 | #else /* VMS */
72 | # include
73 | # include
74 | # include
75 | # include
76 | # include
77 | # ifndef hpux
78 | # include
79 | # endif
80 | # include
81 | #endif /* not VMS */
82 |
83 |
84 | #ifndef MAXHOSTNAMELEN
85 | # define MAXHOSTNAMELEN (64)
86 | #endif
87 |
88 |
89 |
90 |
91 | void SOCKlinger(int sockfd, boolean onoff);
92 | int SOCKbind_to_port(int port);
93 | int SOCKconnect(char *hostname, int port);
94 | int SOCKlisten(struct sockaddr_in * We);
95 | int SOCKaccept(int s, struct sockaddr_in we);
96 | void SOCKnetnames(int sockfd, char *host_name, char *ipnum);
97 | char *SOCKgetDNSname(char *gdchost);
98 | int SOCKgetPort(int fd);
99 |
100 | #define ErrSocketGetService -1
101 | #define ErrSocketGetHost -2
102 | #define ErrSocketCall -3
103 | #define ErrSocketConnect -4
104 | #define ErrSocketNullHost -5
105 | #define ErrSocketInterrupted -6
106 |
107 | #endif /* SOCKETS_H */
108 |
--------------------------------------------------------------------------------
/object/Stat.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Stat.h,v $
6 | * $Status: $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Stat.h
14 | * Portable method of getting struct stat and friends
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Stat.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.1 1994/06/29 05:46:45 lindner
22 | * Portable stat.h file
23 | *
24 | *
25 | *********************************************************************/
26 |
27 | #ifndef G_STAT_H
28 | #define G_STAT_H
29 |
30 | # ifdef VMS
31 | # include
32 | # else
33 | # include
34 | # endif
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/object/Stdlib.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.3 $
4 | * $Date: 2002/02/12 19:54:18 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Stdlib.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Stdlib.h
14 | * Include stdlib.h on systems that have it.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Stdlib.h,v $
18 | * Revision 1.3 2002/02/12 19:54:18 jgoerzen
19 | * Updated with regex fixes
20 | *
21 | * Revision 1.2 2000/08/23 00:03:59 jgoerzen
22 | * Updates
23 | *
24 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
25 | * Import from UMN Gopher 2.3.1 after GPLization
26 | *
27 | * Revision 3.6 1996/01/04 18:26:50 lindner
28 | * Updates for autoconf
29 | *
30 | * Revision 3.5 1994/04/07 17:26:26 lindner
31 | * Fix for pyramids
32 | *
33 | * Revision 3.4 1994/03/07 04:42:05 lindner
34 | * Add sys/types.h and compatible.h
35 | *
36 | * Revision 3.3 1993/07/07 19:28:04 lindner
37 | * Mods for SGIs
38 | *
39 | * Revision 3.2 1993/06/15 06:07:16 lindner
40 | * Mods for VMS
41 | *
42 | * Revision 3.1.1.1 1993/02/11 18:03:04 lindner
43 | * Gopher+1.2beta release
44 | *
45 | * Revision 1.1 1992/12/10 23:27:52 lindner
46 | * gopher 1.1 release
47 | *
48 | *
49 | *********************************************************************/
50 |
51 |
52 | #ifndef GSTDLIB_H
53 | #define GSTDLIB_H
54 |
55 | #include "compatible.h"
56 |
57 | /** These definitely need stdlib.h **/
58 | #if defined(STDC_HEADERS)
59 | # ifndef sony_news /** Ack! sonynews is STDC but no stdlib! **/
60 | # include
61 | # endif
62 | #else
63 |
64 | /** These definitely *don't* want stdlib.h **/
65 | # if !defined(mips) && !defined(sequent) && !defined(n16) && !defined(NeXT) && !defined(ultrix) && !defined(UMAX43) && !defined(sony_news) && !defined(pyr)
66 |
67 | # include
68 | # endif
69 | #endif
70 |
71 | #if !defined(VMS)
72 | # include
73 | #ifdef HAVE_STDLIB_H
74 | #include
75 | #endif
76 | #ifdef HAVE_MALLOC_H
77 | #include
78 | #endif
79 | #include
80 | #endif
81 |
82 |
83 |
84 | #endif /* GSTDLIB_H */
85 |
--------------------------------------------------------------------------------
/object/String.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.4 $
4 | * $Date: 2002/01/10 18:43:18 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/String.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: String.h
14 | * Header file that automagically includes string/strings.h
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: String.h,v $
18 | * Revision 1.4 2002/01/10 18:43:18 jgoerzen
19 | * * Changes to work with Solaris:
20 | * * configure.in: Now looks for strings.h and string.h
21 | * * object/Regex.h: Now include re_comp.h if available.
22 | * Include regex.h only if re_comp.h is unavailable.
23 | * Define the SYSVREGEX stuff only if HAVE_RE_COMP_H is not defined
24 | * * object/String.h: Include string.h and strings.h based on configure
25 | * test.
26 | *
27 | * Revision 1.3 2000/12/20 01:19:20 jgoerzen
28 | * Added patches from David Allen
29 | *
30 | * Revision 1.2.1 2000/12/18 23:04:29 mdallen
31 | * removed nested comments from unused include
32 | *
33 | * Revision 1.2 2000/08/19 01:36:18 jgoerzen
34 | * include more relevant header files.
35 | *
36 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
37 | * Import from UMN Gopher 2.3.1 after GPLization
38 | *
39 | * Revision 3.8 1996/01/04 18:23:43 lindner
40 | * Updates for autoconf
41 | *
42 | * Revision 3.7 1994/07/21 22:08:24 lindner
43 | * include both string and strings on suns
44 | *
45 | * Revision 3.6 1994/06/29 06:38:27 lindner
46 | * Remove extra include of string.h
47 | *
48 | * Revision 3.5 1994/04/07 17:26:46 lindner
49 | * Fix for pyramids
50 | *
51 | * Revision 3.4 1994/03/08 04:03:52 lindner
52 | * Fix for missing strdup forward declaration
53 | *
54 | * Revision 3.3 1993/06/15 06:09:50 lindner
55 | * Fixes for multiple includes and prettification
56 | *
57 | * Revision 3.2 1993/05/05 18:39:49 lindner
58 | * Solaris and VMS mods
59 | *
60 | * Revision 3.1.1.1 1993/02/11 18:03:04 lindner
61 | * Gopher+1.2beta release
62 | *
63 | * Revision 1.1 1992/12/10 23:27:52 lindner
64 | * gopher 1.1 release
65 | *
66 | *
67 | *********************************************************************/
68 |
69 | #ifndef GSTRINGS_H
70 | #define GSTRINGS_H
71 |
72 | /* string.h == Sys V & ANSI C
73 | strings.h == BSD
74 |
75 | Though your milage may vary...
76 |
77 | */
78 |
79 | #if 0
80 | #include "compatible.h" /* For strdup, etal */
81 | #endif /* 0 */
82 |
83 | #ifdef __convex__
84 | # include
85 | #endif
86 |
87 | #ifdef HAVE_STRING_H
88 | /* Define __USE_GNU for string.h so strcasestr gets included.
89 | (also _GNU_SOURCE for other systems) */
90 | #define __USE_GNU
91 | #define _GNU_SOURCE
92 | #include
93 | #undef __USE_GNU
94 | #undef _GNU_SOURCE
95 | #endif
96 |
97 | #ifdef HAVE_STRINGS_H
98 | #include
99 | #endif
100 |
101 | #include
102 | #include
103 |
104 | #endif /* GSTRINGS_H */
105 |
--------------------------------------------------------------------------------
/object/VIews.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoerzen/gopher/3f7978c9674ec61cc7967ddc59fc47910cbe4be0/object/VIews.c
--------------------------------------------------------------------------------
/object/VIews.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/VIews.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: VIews.h
14 | * Header file, abstraction of a gopher+ view.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: VIews.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.5 1995/09/26 05:16:33 lindner
22 | * more fixes...
23 | *
24 | * Revision 3.4 1995/09/25 22:07:22 lindner
25 | * Ansification
26 | *
27 | * Revision 3.3 1993/07/23 04:49:07 lindner
28 | * Added PrettyView fcn
29 | *
30 | * Revision 3.2 1993/02/19 21:33:24 lindner
31 | * Gopher1.2b2 release
32 | *
33 | * Revision 3.1.1.1 1993/02/11 18:03:07 lindner
34 | * Gopher+1.2beta release
35 | *
36 | * Revision 2.1 1993/02/09 22:48:34 lindner
37 | * Changes for multilingual views
38 | *
39 | * Revision 1.1 1993/01/31 00:34:40 lindner
40 | * Initial revision
41 | *
42 | *
43 | *********************************************************************/
44 |
45 | #ifndef VIEWS_H
46 | #define VIEWS_H
47 |
48 |
49 | #include "STRstring.h"
50 | #include "boolean.h"
51 |
52 | struct view_struct
53 | {
54 | String *Type;
55 | String *Lang;
56 | String *Size;
57 | String *comments;
58 | };
59 |
60 | typedef struct view_struct VIewobj;
61 |
62 | #define VIgetType(a) ((STRget((a)->Type)))
63 | #define VIgetLang(a) ((STRget((a)->Lang)))
64 | #define VIgetSize(a) ((STRget((a)->Size)))
65 | #define VIgetComments(a) ((STRget((a)->comments)))
66 |
67 | #define VIsetType(a,b) (STRset((a)->Type,(b)))
68 | #define VIsetLang(a,b) (STRset((a)->Lang,(b)))
69 | #define VIsetSize(a,b) (STRset((a)->Size,(b)))
70 | #define VIsetComments(a,b) (STRset((a)->comments,(b)))
71 |
72 | /** Real view functions in VIews.c **/
73 | VIewobj *VInew();
74 | void VIinit(VIewobj *vi);
75 | void VIcpy(VIewobj *videst, VIewobj *viorig);
76 | void VIdestroy(VIewobj *vi);
77 | void VItoLine(VIewobj *vi, char *tmpstr);
78 | boolean VIfromLine(VIewobj *vi, char *line);
79 | char *VIgetViewnLang(VIewobj *vi, char *line);
80 | char *VIgetPrettyView(VIewobj *vi, char *line);
81 | char *VIprettyLang(VIewobj *vi, char *currentlang);
82 |
83 | /*******************************************************/
84 | /** This stuff is for a dynamic array of VIewobjs **/
85 |
86 | #include "DAarray.h"
87 |
88 | typedef DynArray VIewArray;
89 | #define VIAnew(a) (DAnew((a),VInew,VIinit,VIdestroy,VIcpy))
90 | #define VIAinit(a) (DAinit((a)))
91 | #define VIAgetTop(a) (DAgetTop(a))
92 | #define VIAgetEntry(a,b) (VIewobj*)(DAgetEntry(a,b))
93 | #define VIApush(a,b) (DApush((DynArray*)(a),(char*)(b)))
94 | #define VIAdestroy(a) (DAdestroy(a))
95 | #define VIAcpy(a,b) (DAcpy(a,b))
96 |
97 | #include "BLblock.h"
98 |
99 | void VIAfromBL(VIewArray *via, Blockobj *bl);
100 |
101 | #endif
102 |
--------------------------------------------------------------------------------
/object/Wait.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.1 $
4 | * $Date: 2000/08/19 00:28:56 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/Wait.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: Wait.h
14 | * Routines that portably define waitpid()
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: Wait.h,v $
18 | * Revision 1.1 2000/08/19 00:28:56 jgoerzen
19 | * Initial revision
20 | *
21 | * Revision 3.10 1996/01/04 18:22:57 lindner
22 | * Updated for autoconf
23 | *
24 | * Revision 3.9 1995/02/06 22:10:13 lindner
25 | * Fix for systems without waitpid and wait3
26 | *
27 | * Revision 3.8 1994/06/29 06:35:52 lindner
28 | * Add sequent to list of machines without waitpid()
29 | * Use POSIX macros if present (Coopersmith)
30 | *
31 | * Revision 3.7 1994/04/14 15:44:22 lindner
32 | * Add Gwaitstatus for VMS
33 | *
34 | * Revision 3.6 1994/04/08 19:15:46 lindner
35 | * Fix for old union wait stuff
36 | *
37 | * Revision 3.5 1994/03/08 03:23:23 lindner
38 | * Waitpid for vms
39 | *
40 | * Revision 3.4 1993/11/02 06:16:58 lindner
41 | * Fix for epix
42 | *
43 | * Revision 3.3 1993/07/20 23:19:41 lindner
44 | * Use waitpid, not wait3
45 | *
46 | * Revision 3.2 1993/05/05 18:40:16 lindner
47 | * Solaris mods
48 | *
49 | * Revision 3.1.1.1 1993/02/11 18:03:04 lindner
50 | * Gopher+1.2beta release
51 | *
52 | * Revision 1.1 1992/12/10 23:27:52 lindner
53 | * gopher 1.1 release
54 | *
55 | *
56 | *********************************************************************/
57 |
58 |
59 | /*
60 | * A header file to portably include the stuff for doing waitpid() etal
61 | */
62 |
63 | #include "Stdlib.h" /* for pid_t */
64 |
65 | #ifdef VMS
66 | # define NO_WAITPID_WAIT3
67 | # include
68 | #endif
69 |
70 | #ifdef NO_WAITPID_WAIT3
71 | # define Portawait int
72 | pid_t waitpid();
73 | # define Gwaitstatus(a) (a)
74 |
75 | #else
76 |
77 | # include
78 | # include
79 | # include
80 |
81 | /** These don't know what waitpid() is.. Naughty! **/
82 |
83 | # if !defined(HAVE_WAITPID) && defined(HAVE_WAIT3)
84 | typedef union wait Portawait;
85 | # define waitpid(a,b,c) wait3(b,c,NULL)
86 | # define Gwaitstatus(a) ((a).w_status)
87 | # else
88 | /*** Everything else mostly does.. ***/
89 | typedef int Portawait;
90 | # if defined(WIFEXITED) && defined(WEXITSTATUS) && defined(WIFSIGNALED) && defined(WTERMSIG)
91 | # define Gwaitstatus(a) (WIFEXITED(a) ? WEXITSTATUS(a) : (WIFSIGNALED(a) ? WTERMSIG(a) : 0))
92 | # else
93 | # define Gwaitstatus(a) (a)
94 | # endif
95 | # endif
96 | #endif /* VMS */
97 |
98 |
--------------------------------------------------------------------------------
/object/boolean.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * lindner
3 | * 3.1.1.1
4 | * 1993/02/11 18:03:05
5 | * /home/mudhoney/GopherSrc/CVS/gopher+/object/boolean.h,v
6 | * $Status: $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: boolean.h
14 | * Header file that defines a boolean type.
15 | *********************************************************************
16 | * Revision History:
17 | * boolean.h,v
18 | * Revision 3.1.1.1 1993/02/11 18:03:05 lindner
19 | * Gopher+1.2beta release
20 | *
21 | * Revision 1.1 1992/12/10 23:27:52 lindner
22 | * gopher 1.1 release
23 | *
24 | *
25 | *********************************************************************/
26 |
27 |
28 | /*
29 | * Simple boolean type
30 | */
31 |
32 | #ifndef BOOLEAN_H
33 | #define BOOLEAN_H
34 |
35 | #undef boolean /** Just in case it's defined **/
36 | typedef int boolean;
37 | typedef int BOOLEAN;
38 |
39 | #if !defined(TRUE) && !defined(FALSE)
40 | #define TRUE (1)
41 | #define FALSE (0)
42 | #endif
43 |
44 | #endif /* BOOLEAN_H */
45 |
--------------------------------------------------------------------------------
/object/compile.com:
--------------------------------------------------------------------------------
1 | $ vo = 'f$verify(0)'
2 | $!********************************************************************
3 | $! lindner
4 | $! 3.2
5 | $! 1993/05/18 15:06:34
6 | $! /home/mudhoney/GopherSrc/CVS/gopher+/object/compile.com,v
7 | $! Exp
8 | $!
9 | $! Paul Lindner, University of Minnesota CIS.
10 | $!
11 | $! Copyright 1991, 1992 by the Regents of the University of Minnesota
12 | $! see the file "Copyright" in the distribution for conditions of use.
13 | $!********************************************************************
14 | $! MODULE: compile.com
15 | $! compiling script for VMS
16 | $!*********************************************************************
17 | $! Revision History:
18 | $! compile.com,v
19 | $! Revision 3.2 1993/05/18 15:06:34 lindner
20 | $! Fixed CVS/RCS comment leaders...
21 | $!
22 | $! Revision 3.1 1993/05/05 18:44:07 lindner
23 | $! new VMS files
24 | $!
25 | $! Revision 1.1 1992/12/31 05:19:12 lindner
26 | $! Initial revision
27 | $!
28 | $!
29 | $!********************************************************************/
30 | $ IF P1 .EQS. ""
31 | $ THEN
32 | $ type/nopage sys$input:
33 | Usage:
34 | @compile UCX
35 | @compile WOLLONGONG
36 | @compile MULTINET
37 | @compile CMUIP
38 | @compile NETLIB
39 | @compile TCPWARE
40 | $ exit
41 | $ ENDIF
42 | $ IF P2 .EQS. "DEBUG"
43 | $ THEN
44 | $ write sys$output "Compiling library with DEBUG..."
45 | $ debug := "/debug/noopt"
46 | $ ELSE
47 | $ debug := ""
48 | $ ENDIF
49 | $!
50 | $ ON CONTROL_Y THEN GOTO CLEANUP
51 | $ ON ERROR THEN GOTO CLEANUP
52 | $!
53 | $ IF P1 .eqs. "TCPWARE"
54 | $ THEN
55 | $ write sys$output "Compiling library with UCX emulation..."
56 | $ transport := "UCX"
57 | $ ELSE
58 | $ transport := "''P1'"
59 | $ ENDIF
60 | $!
61 | $ IF f$trnlnm("VAXCMSG") .eqs. "DECC$MSG" .or. -
62 | f$trnlnm("DECC$CC_DEFAULT") .eqs. "/DECC"
63 | $!
64 | $ THEN
65 | $ vo1 = f$verify(1)
66 | $! DECC:
67 | $ vo1 = 'f$verify(0)'
68 | $ IF transport .eqs. "UCX"
69 | $ THEN
70 | $ vo1 = f$verify(1)
71 | $ cc := cc/prefix=(all,except=(setlocale))-
72 | /warning=(disable=implicitfunc)-
73 | /define=('transport'=1,__VMS_CURSES)'debug'
74 | $ vo1 = 'f$verify(0)'
75 | $ ELSE
76 | $ vo1 = f$verify(1)
77 | $ cc := cc/prefix=(all,except=(connect,gethostbyname,htons,inet_addr,-
78 | setsockopt,socket,setlocale))-
79 | /warning=(disable=implicitfunc)-
80 | /define=('transport'=1,__VMS_CURSES)'debug'
81 | $ vo1 = 'f$verify(0)'
82 | $ ENDIF
83 | $ ELSE
84 | $ vo1 = f$verify(1)
85 | $! VAXC:
86 | $ cc := cc/define=('transport'=1)'debug'
87 | $ vo1 = 'f$verify(0)'
88 | $ ENDIF
89 | $ vo1 = f$verify(1)
90 | $!
91 | $ cc compatible.c
92 | $ cc daarray.c
93 | $ cc gdgopherdir.c
94 | $ cc gsgopherobj.c
95 | $ cc strstring.c
96 | $ cc util.c
97 | $ cc blblock.c
98 | $ cc VIews.c
99 | $ cc Sockets.c
100 | $ cc Debug.c
101 | $ cc url.c
102 | $ cc fileio.c
103 | $ cc locale.c
104 | $!
105 | $ cc getopt.c
106 | $!
107 | $ vg1 = 'f$verify(0)'
108 | $ IF P2 .eqs. "DEBUG"
109 | $ THEN
110 | $ vg1 = f$verify(1)
111 | $ rename/nolog/noconf *.obj; *.objd
112 | $ vg1 = 'f$verify(0)'
113 | $ ENDIF
114 | $!
115 | $ CLEANUP:
116 | $ vo1 = f$verify(vo)
117 | $exit
118 |
--------------------------------------------------------------------------------
/object/fileio.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.2 $
4 | * $Date: 2000/12/20 01:19:20 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/fileio.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 92, 93, 94 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: fileio.h
14 | * Abstration of socket/file input output routines.
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: fileio.h,v $
18 | * Revision 1.2 2000/12/20 01:19:20 jgoerzen
19 | * Added patches from David Allen
20 | *
21 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
22 | * Import from UMN Gopher 2.3.1 after GPLization
23 | *
24 | * Revision 3.16 1996/01/04 18:25:00 lindner
25 | * Updates for autoconf
26 | *
27 | * Revision 3.15 1995/09/25 22:07:24 lindner
28 | * Ansification
29 | *
30 | * Revision 3.14 1995/04/15 06:51:18 lindner
31 | * Use interruptable_read
32 | *
33 | * Revision 3.13 1995/02/06 22:12:52 lindner
34 | * Smaller max for fileio structs
35 | *
36 | * Revision 3.12 1994/10/18 21:39:06 lindner
37 | * NeXT doesn't have mmap
38 | *
39 | * Revision 3.11 1994/09/29 19:54:24 lindner
40 | * Add definition for Memory mapped I/O
41 | *
42 | * Revision 3.10 1994/08/19 16:29:37 lindner
43 | * Add definition for memory mapped I/O
44 | *
45 | * Revision 3.9 1994/07/21 17:30:44 lindner
46 | * Mods for Xenix
47 | *
48 | * Revision 3.8 1994/04/25 03:40:07 lindner
49 | * VMS socket stuff still wasn't working..
50 | *
51 | * Revision 3.7 1994/04/22 06:42:02 lindner
52 | * better compatibility checking
53 | *
54 | * Revision 3.6 1994/04/13 04:28:23 lindner
55 | * add vms compatible.h
56 | *
57 | * Revision 3.5 1994/04/01 04:43:55 lindner
58 | * fixes for VMS includes
59 | *
60 | * Revision 3.4 1994/03/17 04:36:32 lindner
61 | * Fix for UCX
62 | *
63 | * Revision 3.3 1994/03/11 00:09:14 lindner
64 | * Fix for UCX
65 | *
66 | * Revision 3.2 1994/03/08 03:21:18 lindner
67 | * Mods for opening processes without sh
68 | *
69 | * Revision 3.1 1994/02/20 16:20:50 lindner
70 | * New object based versions of buffered io routines
71 | *
72 | *
73 | *********************************************************************/
74 |
75 | #ifndef FILEIO_H
76 | #define FILEIO_H
77 |
78 | #include "STRstring.h"
79 | #include "boolean.h"
80 | #include "Stdlib.h"
81 | #include "util.h"
82 |
83 | #ifdef VMS
84 | # include
85 | # include
86 | # include
87 | #else
88 | # ifdef M_XENIX
89 | # include
90 | # include
91 | # include
92 | # else
93 | # include
94 | # endif
95 | #endif /* VMS */
96 | #include "compatible.h"
97 |
98 | struct fileio_struct
99 | {
100 | int bufindex;
101 | int bufdatasize;
102 | int bytepos;
103 | char *buf;
104 |
105 | boolean issocket;
106 |
107 | String *filename;
108 | int fd;
109 | pid_t pid;
110 | };
111 |
112 | typedef struct fileio_struct FileIO;
113 |
114 |
115 | #define FIOBUFSIZE 4096
116 | #define FIOMAXOFILES 64
117 |
118 | #define FIOisSocket(a) ((a)->issocket)
119 | #define FIOgetPid(a) ((a)->pid)
120 | #define FIOgetfd(a) ((a)->fd)
121 | #define FIOgetFilename(a) (STRget((a)->filename))
122 | #define FIOgetBufIndex(a) ((a)->bufindex)
123 | #define FIOgetBufDsize(a) ((a)->bufdatasize)
124 |
125 |
126 | #define FIOsetfd(a,b) ((a)->fd=(b))
127 | #define FIOsetPid(a,b) ((a)->pid=(b))
128 | #define FIOsetSocket(a,b) ((a)->issocket=(b))
129 | #define FIOsetFilename(a,b) (STRset((a)->filename,(b)))
130 | #define FIOsetBufIndex(a,b) ((a)->bufindex = (b))
131 | #define FIOsetBufDsize(a,b) ((a)->bufdatasize = (b))
132 |
133 | #define FIOisMMAPable(a) (FIOgetFilename(a) != NULL)
134 |
135 | /*
136 | * Optionally use BSD memory mapped I/O
137 | */
138 |
139 | #if defined(HAVE_MMAP)
140 | # define MMAP_IO
141 | #endif
142 |
143 | /*
144 | * More elegant way of doing socket writes than ifdefs everywhere
145 | */
146 |
147 | #if defined(VMS)
148 | int DCLsystem(/* char */);
149 | # define system(a) DCLsystem(a)
150 |
151 | /** Note that Multinet already has socket_* **/
152 | # if defined(WOLLONGONG) || defined(CMUIP) || defined(NETLIB)
153 | # define socket_write netwrite
154 | # define socket_read netread
155 | # define socket_close netclose
156 | # endif
157 | # if defined(UCX)
158 | # define socket_write write
159 | # define socket_read read
160 | # define socket_close close
161 | # endif
162 | /** Note that Wollongong is like Multinet for EPIPE handling **/
163 | # if defined(UCX) || defined(CMUIP) || defined(NETLIB)
164 | # define FIO_NOMULTIEOF
165 | # endif
166 |
167 | #else
168 | /* Unix systems */
169 | # define socket_write write
170 | # define socket_read interruptable_read
171 | # define socket_close close
172 | #endif
173 |
174 |
175 | /** Forward Declarations **/
176 |
177 | FileIO *FIOopenUFS(char *fname, int flags, int mode);
178 | FileIO *FIOopenfd(int fd, int issocket);
179 | FileIO *FIOopenProcess(char *prog, char **args, char *rw);
180 | FileIO *FIOopenCmdline(char *cmd, char *rw);
181 | int FIOclose(FileIO *fio);
182 | int FIOwriten(FileIO *fio, char *ptr, int nbytes);
183 | int FIOwritestring(FileIO *, char *);
184 | int FIOreadbuf(FileIO *fio, char *newbuf, int newbuflen);
185 | int FIOreadn(FileIO *fio, char *ptr, int nbytes);
186 | int FIOreadline(FileIO *fio, char *ptr, int maxlen);
187 | int FIOreadlinezap(FileIO *fio, char *ptr, int maxlen);
188 | int FIOreadtoken(FileIO *fio, char *ptr, int maxlen, char zechar);
189 | int FIOwaitpid(FileIO *fio);
190 | int FIOsystem(char *cmd);
191 | void FIOdestroy(FileIO *fio);
192 | #endif
193 |
--------------------------------------------------------------------------------
/object/getopt.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** GETOPT PROGRAM AND LIBRARY ROUTINE
3 | **
4 | ** I wrote main() and AT&T wrote getopt() and we both put our efforts into
5 | ** the public domain via mod.sources.
6 | ** Rich $alz
7 | ** Mirror Systems
8 | ** (mirror!rs, rs@mirror.TMC.COM)
9 | ** August 10, 1986
10 | **
11 | ** This is the public-domain AT&T getopt(3) code. Hacked by Rich and by Jim.
12 | */
13 |
14 | #include "String.h"
15 |
16 | /*LINTLIBRARY*/
17 | #include
18 |
19 | #define ERR(s, c) if(opterr){\
20 | extern int write();\
21 | char errbuf[2];\
22 | errbuf[0] = c; errbuf[1] = '\n';\
23 | (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
24 | (void) write(2, s, (unsigned)strlen(s));\
25 | (void) write(2, errbuf, 2);}
26 |
27 | extern char *strchr();
28 |
29 | int opterr = 1;
30 | int optind = 1;
31 | int optopt;
32 | char *optarg;
33 |
34 | int
35 | getopt(argc, argv, opts)
36 | int argc;
37 | char **argv, *opts;
38 | {
39 | static int sp = 1;
40 | register int c;
41 | register char *cp;
42 |
43 | if(sp == 1)
44 | if(optind >= argc ||
45 | argv[optind][0] != '-' || argv[optind][1] == '\0')
46 | return(EOF);
47 | else if(strcmp(argv[optind], "--") == 0) {
48 | optind++;
49 | return(EOF);
50 | }
51 | optopt = c = argv[optind][sp];
52 | if(c == ':' || (cp=strchr(opts, c)) == NULL) {
53 | ERR(": illegal option -- ", c);
54 | if(argv[optind][++sp] == '\0') {
55 | optind++;
56 | sp = 1;
57 | }
58 | return('?');
59 | }
60 | if(*++cp == ':') {
61 | if(argv[optind][sp+1] != '\0')
62 | optarg = &argv[optind++][sp+1];
63 | else if(++optind >= argc) {
64 | ERR(": option requires an argument -- ", c);
65 | sp = 1;
66 | return('?');
67 | } else
68 | optarg = argv[optind++];
69 | sp = 1;
70 | } else {
71 | if(argv[optind][++sp] == '\0') {
72 | sp = 1;
73 | optind++;
74 | }
75 | optarg = NULL;
76 | }
77 | return(c);
78 | }
79 |
--------------------------------------------------------------------------------
/object/link.com:
--------------------------------------------------------------------------------
1 | $ vo = 'f$verify(0)'
2 | $!
3 | $ ON CONTROL_Y THEN GOTO CLEANUP
4 | $ ON ERROR THEN GOTO CLEANUP
5 | $!
6 | $ IF P2 .eqs. "DEBUG
7 | $ THEN
8 | $ vo1 = f$verify(1)
9 | $ library/create libgopher_debug compatible.objd,daarray.objd,-
10 | gdgopherdir.objd,gsgopherobj.objd,locale.objd,-
11 | strstring.objd,blblock.objd,views.objd,util.objd,-
12 | getopt.objd,sockets.objd,Debug.objd,url.objd,fileio.objd
13 | $!
14 | $ vo1 = 'f$verify(0)'
15 | $ ELSE
16 | $ vo1 = f$verify(1)
17 | $ library/create libgopher compatible.obj,daarray.obj,-
18 | gdgopherdir.obj,gsgopherobj.obj,locale.obj,-
19 | strstring.obj,blblock.obj,views.obj,util.obj,-
20 | getopt.obj,sockets.obj,Debug.obj,url.obj,fileio.obj
21 | $!
22 | $ vo1 = 'f$verify(0)'
23 | $ ENDIF
24 | $ CLEANUP:
25 | $ vo1 = f$verify(vo)
26 | $exit
27 |
--------------------------------------------------------------------------------
/object/ranlib:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo "Hmmm, looks like your system doesn't have ranlib.."
3 | echo "or you have dot in your path before ranlib"
4 | echo " "
5 | echo "Delete the file object/ranlib if the latter"
6 |
--------------------------------------------------------------------------------
/object/url.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.2 $
4 | * $Date: 2000/12/20 01:19:20 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/url.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: url.h
14 | * Simplified method of getting urls..
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: url.h,v $
18 | * Revision 1.2 2000/12/20 01:19:20 jgoerzen
19 | * Added patches from David Allen
20 | *
21 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
22 | * Import from UMN Gopher 2.3.1 after GPLization
23 | *
24 | * Revision 3.5 1995/09/25 22:07:25 lindner
25 | * Ansification
26 | *
27 | * Revision 3.4 1995/08/29 07:13:07 lindner
28 | * Add tickets to urls
29 | *
30 | * Revision 3.3 1994/11/13 06:30:12 lindner
31 | * Expanded URL parsing routines
32 | *
33 | * Revision 3.2 1993/11/02 06:14:11 lindner
34 | * Add url html hack
35 | *
36 | *********************************************************************/
37 |
38 | #ifndef URL_H
39 | #define URL_H
40 |
41 | #include "STRstring.h"
42 | #include "util.h"
43 |
44 | typedef enum {gopher, http, ftp, telnet, tn3270, news, unset,unknown}
45 | UrlServiceType;
46 |
47 | struct url_struct {
48 | String* url;
49 | UrlServiceType service;
50 |
51 |
52 | String* Host;
53 | int Port;
54 | String* Path;
55 |
56 | String* User;
57 | String* Pass;
58 |
59 | /** Gopher specific information **/
60 | char Gtype;
61 |
62 | };
63 |
64 | typedef struct url_struct Url;
65 |
66 | #define URLget(a) (STRget((a)->url))
67 | #define URLset(a,b) (STRset((a)->url,(b)))
68 |
69 | #define URLsetGophType(a,b) ((a)->Gtype=(b))
70 | #define URLsetPort(a,b) ((a)->Port=(b))
71 | #define URLsetPath(a,b) (STRset((a)->Path, (b)))
72 | #define URLsetHost(a,b) (STRset((a)->Host, (b)))
73 | #define URLsetUser(a,b) (STRset((a)->User, (b)))
74 | #define URLsetPass(a,b) (STRset((a)->Pass, (b)))
75 | #define URLsetService(a,b) ((a)->service=(b))
76 |
77 | #include "GSgopherobj.h"
78 | UrlServiceType URLgetService();
79 |
80 | Url *URLnew();
81 | void URLdestroy();
82 | void URLfromGS(Url *url, GopherObj *gs, char *ticket);
83 | void URLmakeHTML(Url *url);
84 | char *URLgetTransport(Url *url);
85 | char *URLgetHost(Url *url);
86 | int URLgetPort(Url *url);
87 |
88 | char URLgetGophType(Url *url);
89 | char *URLgetPath(Url *url);
90 | char *URLgetHost(Url *url);
91 | int URLgetPort(Url *url);
92 | char *URLgetUser(Url *url);
93 | char *URLgetPass(Url *url);
94 |
95 | #endif /* URL_H */
96 |
--------------------------------------------------------------------------------
/object/util.h:
--------------------------------------------------------------------------------
1 | /********************************************************************
2 | * $Author: jgoerzen $
3 | * $Revision: 1.5 $
4 | * $Date: 2002/02/12 21:24:21 $
5 | * $Source: /home/jgoerzen/tmp/gopher-umn/gopher/head/object/util.h,v $
6 | * $State: Exp $
7 | *
8 | * Paul Lindner, University of Minnesota CIS.
9 | *
10 | * Copyright 1991, 1992 by the Regents of the University of Minnesota
11 | * see the file "Copyright" in the distribution for conditions of use.
12 | *********************************************************************
13 | * MODULE: util.h
14 | * Header file for routines in util.c
15 | *********************************************************************
16 | * Revision History:
17 | * $Log: util.h,v $
18 | * Revision 1.5 2002/02/12 21:24:21 jgoerzen
19 | * Removed __USE_GNU -- it conflicted
20 | *
21 | * Revision 1.4 2002/02/12 21:22:56 jgoerzen
22 | * Added __USE_GNU def
23 | *
24 | * Revision 1.3 2002/02/12 21:20:14 jgoerzen
25 | * Made files using strcasecmp() include util.h
26 | *
27 | * Revision 1.2 2002/01/28 03:38:58 jgoerzen
28 | * Patches for FreeBSD:
29 | * * Test in configure for stdlib.h
30 | * * Include stdlib.h if it's available in Malloc.h
31 | * * Don't include malloc.h if it's missing in Malloc.h
32 | * * Don't include strcasestr if it's present in util.c and util.h
33 | *
34 | * Revision 1.1.1.1 2000/08/19 00:28:56 jgoerzen
35 | * Import from UMN Gopher 2.3.1 after GPLization
36 | *
37 | * Revision 3.5 1995/09/25 22:07:26 lindner
38 | * Ansification
39 | *
40 | * Revision 3.4 1995/04/15 07:07:40 lindner
41 | * Add ControlC handling feature...
42 | *
43 | * Revision 3.3 1994/01/21 04:20:40 lindner
44 | * Better forward prototypes
45 | *
46 | * Revision 3.2 1993/03/18 22:28:46 lindner
47 | * Updated protos
48 | *
49 | * Revision 3.1.1.1 1993/02/11 18:03:06 lindner
50 | * Gopher+1.2beta release
51 | *
52 | * Revision 2.1 1992/12/21 19:43:15 lindner
53 | * Added prototype for skip_whitespace
54 | *
55 | * Revision 1.1 1992/12/10 23:27:52 lindner
56 | * gopher 1.1 release
57 | *
58 | *
59 | *********************************************************************/
60 |
61 | #ifndef __GOPHER_UTIL_H__
62 | #define __GOPHER_UTIL_H__
63 |
64 | #include
65 | #include "config.h"
66 |
67 | /*
68 | * Definitions of stuff in util.c
69 | */
70 | int readn(int fd, char *ptr, int nbytes);
71 | int writen(int fd, char *ptr, int nbytes);
72 | int writestring(int, char*);
73 | int readrecvbuf(int sockfd, char *buf, int len);
74 | int readline(int fd, char *ptr, int maxlen);
75 | int readtoken(int fd, char *ptr, int maxlen, char zechar);
76 | int sreadword(char *input, char *output, int maxlen);
77 | void ZapCRLF(char * );
78 | void Fromhexstr(char * , char *);
79 | void Tohexstr(char *input, char *output);
80 | void Hexall(char *input, char *output);
81 | #ifndef HAVE_STRCASESTR
82 | char *strcasestr(char *inputline, char *match);
83 | #endif
84 | char *skip_whitespace(char *);
85 |
86 | /*
87 | * Interrupt stuff
88 | */
89 | #include "boolean.h"
90 | #include
91 |
92 | extern boolean ControlCpressed;
93 | extern jmp_buf Jmpenv;
94 |
95 | void controlc(int sig);
96 | void controlcJmp(int sig);
97 | int interruptable_read(int fd, char *ptr, int nbytes);
98 |
99 | int primeControlc();
100 | void reprimeControlc();
101 |
102 | #endif /* __GOPHER_UTIL_H__ */
103 |
--------------------------------------------------------------------------------
/patchlevel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * The minor and major version numbers...
3 | */
4 |
5 | #define GOPHER_MAJOR_VERSION "3"
6 | #define GOPHER_MINOR_VERSION "0"
7 | #define PATCHLEVEL 12
8 | #define GOPHER_NICKNAME "FurryTerror"
9 |
--------------------------------------------------------------------------------