home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-27 | 40.3 KB | 1,387 lines |
- Newsgroups: comp.sources.x
- From: salim@tigger.cs.colorado.edu (Salim Alam)
- Subject: v19i022: xgetftp - Friendly anonymous ftp tool, Part01/04
- Message-ID: <csx-v19i022=xgetftp.104700@sparky.IMD.Sterling.COM>
- X-Md4-Signature: 240da1f93ec6649cb398326c6921cbc6
- Date: Wed, 10 Mar 1993 16:47:41 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: salim@tigger.cs.colorado.edu (Salim Alam)
- Posting-number: Volume 19, Issue 22
- Archive-name: xgetftp/part01
- Environment: X11, OSF/Motif
-
-
- GETFTP v1.0 RELEASE
-
- getftp is a sophisticated browsing and file retrieval tool for anonymous
- ftp. Features include:
-
- o X/Motif User-interface
- o Remote directory caching
- o Easy remote file viewing
- o Reuse of previously cached directory information
- o Reuse of previously cached files
- o Simple multiple file and directory retrieval
-
- This submission consists of 4 shar files.
-
- -------------------- cut here (shar file 1) -----------------------------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 4)."
- # Contents: BLURB Imakefile Makefile Manifest README TODO cache.c
- # cache.h config.h
- # Wrapped by salim@anchor on Mon Mar 8 14:04:19 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'BLURB' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'BLURB'\"
- else
- echo shar: Extracting \"'BLURB'\" \(471 characters\)
- sed "s/^X//" >'BLURB' <<'END_OF_FILE'
- X
- XXGETFTP v1.0 RELEASE
- X
- Xxgetftp is a sophisticated browsing and file retrieval tool for anonymous
- Xftp. Features include:
- X
- X o X/Motif User-interface
- X
- X o Remote directory caching
- X
- X o Easy remote file viewing
- X
- X o Reuse of previously cached directory information
- X
- X o Reuse of previously cached files
- X
- X o Simple multiple file and directory retrieval
- X
- X o Interface to Archie
- X
- Xxgetftp is available on export.lcs.mit.edu as contrib/xgetftp-v1.0.tar.Z.
- X
- END_OF_FILE
- if test 471 -ne `wc -c <'BLURB'`; then
- echo shar: \"'BLURB'\" unpacked with wrong size!
- fi
- # end of 'BLURB'
- fi
- if test -f 'Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Imakefile'\"
- else
- echo shar: Extracting \"'Imakefile'\" \(354 characters\)
- sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
- X CC = gcc
- X# CDEBUGFLAGS = -g -DDEBUG
- X EXTRA_LIBRARIES = -lXm -lXt -lX11
- X SRCS = cache.c control.c file_cache.c ftp.c \
- X main.c prefs.c ui_funcs.c
- X OBJS = cache.o control.o file_cache.o ftp.o \
- X main.o prefs.o ui_funcs.o
- X
- XComplexProgramTarget(xgetftp)
- X
- END_OF_FILE
- if test 354 -ne `wc -c <'Imakefile'`; then
- echo shar: \"'Imakefile'\" unpacked with wrong size!
- fi
- # end of 'Imakefile'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(17441 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X# Makefile generated by imake - do not edit!
- X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
- X#
- X# The cpp used on this machine replaces all newlines and multiple tabs and
- X# spaces in a macro expansion with a single space. Imake tries to compensate
- X# for this, but is not always successful.
- X#
- X
- X# -------------------------------------------------------------------------
- X# Makefile generated from "Imake.tmpl" and </tmp/IIf.022747>
- X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
- X#
- X# Platform-specific parameters may be set in the appropriate <vendor>.cf
- X# configuration files. Site-specific parameters should be set in the file
- X# site.def. Full rebuilds are recommended if any parameters are changed.
- X#
- X# If your C preprocessor does not define any unique symbols, you will need
- X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- X# "make World" the first time).
- X#
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that need to come before
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# platform-specific configuration parameters - edit sun.cf to change
- X
- X# platform: $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
- X
- X# operating system: SunOS 4.1
- X
- X# $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that go after
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X SHELL = /bin/sh
- X
- X TOP = .
- X CURRENT_DIR = .
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X AS = as
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -C
- X LINTOPTS = -axz
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X
- X RANLIB = ranlib
- X RANLIBINSTFLAGS =
- X
- X RM = rm -f
- X TROFF = psroff
- X MSMACROS = -ms
- X TBL = tbl
- X EQN = eqn
- X STD_INCLUDES =
- X STD_CPP_DEFINES =
- X STD_DEFINES =
- X EXTRA_LOAD_FLAGS =
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DSUNSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -g kmem -m 2755
- X
- X PROJECTROOT = /usr/local/X.V11R5
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS = -pipe
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X
- X LDCOMBINEFLAGS = -X -r
- X DEPENDFLAGS =
- X
- X MACROFILE = sun.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGDIR)
- X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- X# -------------------------------------------------------------------------
- X# X Window System Build Parameters
- X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/local/X.V11R5/lib
- X BINDIR = /usr/local/X.V11R5/bin
- X INCROOT = /usr/local/X.V11R5/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/local/X.V11R5/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = 1
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- X# $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
- X
- XSHLIBLDFLAGS = -assert pure-text
- XPICFLAGS = -pic
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
- X XMULIBONLY = -lXmu
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X SOXLIBREV = 4.10
- X SOXTREV = 4.10
- X SOXAWREV = 5.0
- X SOOLDXREV = 4.10
- X SOXMUREV = 4.10
- X SOXEXTREV = 4.10
- X SOXINPUTREV = 4.10
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- X# -------------------------------------------------------------------------
- X# Imake rules for building libraries, programs, scripts, and data files
- X# rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# start of Imakefile
- X
- X CC = gcc
- X# CDEBUGFLAGS = -g -DDEBUG
- X EXTRA_LIBRARIES = -lXm -lXt -lX11
- X SRCS = cache.c control.c file_cache.c ftp.c \
- X main.c prefs.c ui_funcs.c
- X OBJS = cache.o control.o file_cache.o ftp.o \
- X main.o prefs.o ui_funcs.o
- X
- X PROGRAM = xgetftp
- X
- Xall:: xgetftp
- X
- Xxgetftp: $(OBJS) $(DEPLIBS)
- X $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- Xsaber_xgetftp:: $(SRCS)
- X # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- Xosaber_xgetftp:: $(OBJS)
- X # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- Xinstall:: xgetftp
- X @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
- X $(INSTALL) -c $(INSTPGMFLAGS) xgetftp $(DESTDIR)$(BINDIR)
- X
- Xinstall.man:: xgetftp.man
- X @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
- X $(INSTALL) -c $(INSTMANFLAGS) xgetftp.man $(DESTDIR)$(MANDIR)/xgetftp.$(MANSUFFIX)
- X
- Xdepend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- Xlint:
- X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
- Xlint1:
- X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
- X
- Xclean::
- X $(RM) $(PROGRAM)
- X
- X# -------------------------------------------------------------------------
- X# common rules for all Makefiles - do not edit
- X
- Xemptyrule::
- X
- Xclean::
- X $(RM_CMD) "#"*
- X
- XMakefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- Xtags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- Xsaber:
- X # load $(ALLDEFINES) $(SRCS)
- X
- Xosaber:
- X # load $(ALLDEFINES) $(OBJS)
- X
- X# -------------------------------------------------------------------------
- X# empty rules for directories that do not have SUBDIRS - do not edit
- X
- Xinstall::
- X @echo "install in $(CURRENT_DIR) done"
- X
- Xinstall.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- XMakefiles::
- X
- Xincludes::
- X
- X# -------------------------------------------------------------------------
- X# dependencies generated by makedepend
- X
- X# DO NOT DELETE
- X
- Xcache.o: /usr/include/stdio.h cache.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Xos.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Xosdefs.h /usr/include/sys/types.h
- Xcontrol.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- Xcontrol.o: /usr/include/string.h /usr/include/fcntl.h
- Xcontrol.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
- Xcontrol.o: /usr/include/unistd.h /usr/include/sys/time.h
- Xcontrol.o: /usr/include/sys/time.h /usr/include/stdio.h /usr/include/malloc.h
- Xcontrol.o: ftp.h cache.h file_cache.h control.h prefs.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Intrinsic.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Xlib.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/X.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Xfuncproto.h /usr/include/stddef.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Xutil.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Xresource.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Core.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Composite.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Constraint.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/Object.h
- Xcontrol.o: /usr/local/X.V11R5/include/X11/RectObj.h
- Xfile_cache.o: /usr/include/stdio.h /usr/local/X.V11R5/include/X11/Xos.h
- Xfile_cache.o: /usr/local/X.V11R5/include/X11/Xosdefs.h
- Xfile_cache.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
- Xfile_cache.o: /usr/include/sys/sysmacros.h /usr/include/string.h
- Xfile_cache.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
- Xfile_cache.o: /usr/include/sys/stat.h /usr/include/unistd.h
- Xfile_cache.o: /usr/include/sys/time.h /usr/include/sys/time.h
- Xfile_cache.o: /usr/include/malloc.h /usr/include/stdlib.h
- Xfile_cache.o: /usr/include/dirent.h /usr/include/sys/dirent.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Xos.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Xosdefs.h /usr/include/sys/types.h
- Xftp.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- Xftp.o: /usr/include/string.h /usr/include/fcntl.h /usr/include/sys/fcntlcom.h
- Xftp.o: /usr/include/sys/stat.h /usr/include/unistd.h /usr/include/sys/time.h
- Xftp.o: /usr/include/sys/time.h /usr/include/stdio.h /usr/include/sys/socket.h
- Xftp.o: /usr/include/netinet/in.h /usr/include/arpa/inet.h
- Xftp.o: /usr/include/netdb.h /usr/include/errno.h /usr/include/sys/errno.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Intrinsic.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Xlib.h
- Xftp.o: /usr/local/X.V11R5/include/X11/X.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Xfuncproto.h /usr/include/stddef.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Xutil.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Xresource.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Core.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Composite.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Constraint.h
- Xftp.o: /usr/local/X.V11R5/include/X11/Object.h
- Xftp.o: /usr/local/X.V11R5/include/X11/RectObj.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xos.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xosdefs.h /usr/include/sys/types.h
- Xmain.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- Xmain.o: /usr/include/string.h /usr/include/fcntl.h
- Xmain.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
- Xmain.o: /usr/include/unistd.h /usr/include/sys/time.h /usr/include/sys/time.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/Xm.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Intrinsic.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xlib.h
- Xmain.o: /usr/local/X.V11R5/include/X11/X.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xfuncproto.h /usr/include/stddef.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xutil.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xresource.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Core.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Composite.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Constraint.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Object.h
- Xmain.o: /usr/local/X.V11R5/include/X11/RectObj.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Shell.h
- Xmain.o: /usr/local/X.V11R5/include/X11/Xatom.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/XmStrDefs.h
- Xmain.o: /usr/local/X.V11R5/include/X11/StringDefs.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/VirtKeys.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/VendorS.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/PushBG.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/Text.h /usr/include/stdio.h
- Xmain.o: /usr/local/X.V11R5/include/Xm/List.h /usr/include/signal.h
- Xmain.o: /usr/include/sys/signal.h /usr/include/vm/faultcode.h
- Xmain.o: /usr/include/pwd.h /usr/include/sys/socket.h /usr/include/netdb.h
- Xmain.o: prefs.h control.h ui_funcs.h config.h patchlevel.h
- Xprefs.o: /usr/local/X.V11R5/include/X11/Xos.h
- Xprefs.o: /usr/local/X.V11R5/include/X11/Xosdefs.h /usr/include/sys/types.h
- Xprefs.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- Xprefs.o: /usr/include/string.h /usr/include/fcntl.h
- Xprefs.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stat.h
- Xprefs.o: /usr/include/unistd.h /usr/include/sys/time.h
- Xprefs.o: /usr/include/sys/time.h /usr/include/stdlib.h /usr/include/stdio.h
- Xprefs.o: prefs.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/cursorfont.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/Xm.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Intrinsic.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Xlib.h /usr/include/sys/types.h
- Xui_funcs.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/X.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Xfuncproto.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Xosdefs.h /usr/include/stddef.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Xutil.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Xresource.h /usr/include/string.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Core.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Composite.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Constraint.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Object.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/RectObj.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Shell.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/Xatom.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/XmStrDefs.h
- Xui_funcs.o: /usr/local/X.V11R5/include/X11/StringDefs.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/VirtKeys.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/VendorS.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/MainW.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/List.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/RowColumn.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/PushBG.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/Form.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/BulletinB.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/CascadeB.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/Frame.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/LabelG.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/Text.h /usr/include/stdio.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/MessageB.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/ToggleBG.h
- Xui_funcs.o: /usr/local/X.V11R5/include/Xm/SelectioB.h prefs.h control.h
- Xui_funcs.o: ui_funcs.h
- END_OF_FILE
- if test 17441 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'Manifest' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Manifest'\"
- else
- echo shar: Extracting \"'Manifest'\" \(572 characters\)
- sed "s/^X//" >'Manifest' <<'END_OF_FILE'
- XImakefile Used to produce makefile
- XMakefile If you cant use the makefile, try to edit & use this
- XREADME Instructions on compiling, installing
- XTODO For future versions
- Xcache.c Source file
- Xcontrol.c Source file
- Xfile_cache.c Source file
- Xftp.c Source file
- Xmain.c Source file
- Xprefs.c Source file
- Xui_funcs.c Source file
- Xcache.h Source file
- Xconfig.h Source file
- Xcontrol.h Source file
- Xfile_cache.h Source file
- Xftp.h Source file
- Xpatchlevel.h Source file
- Xprefs.h Source file
- Xui_funcs.h Source file
- Xxgetftp.man Man page (uses the man macros)
- Xxgetftp.doc Plain text man page
- END_OF_FILE
- if test 572 -ne `wc -c <'Manifest'`; then
- echo shar: \"'Manifest'\" unpacked with wrong size!
- fi
- # end of 'Manifest'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(1734 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X==========================================================================
- Xxgetftp v1.0
- X==========================================================================
- X
- XI. Authors:
- X
- X Salim Alam
- X University of Colorado, Boulder
- X salim@cs.colorado.edu
- X
- X==========================================================================
- X
- XII. Distribution Policy:
- X
- X This program is copyright Salim Alam, 1993. It is freely distributable
- X under the GNU Software License.
- X
- X==========================================================================
- X
- XIII. Building and Installing xgetftp:
- X
- X a. Edit the file "config.h" to your satisfaction.
- X b. Type "xmkmf -a" to build the makefile. If this doesnt work for some
- X reason, you can try and use the Makefile included.
- X c. Type "make" to build the program.
- X d. Type "make install" to install it.
- X e. Type "make install.man" to install the man page.
- X f. Type "make clean" to clean up.
- X
- X==========================================================================
- X
- XIV. Running xgetftp:
- X
- XBecause of the persistent cache, xgetftp is in some ways unusual.
- XPlease make sure that you carefully read the man page (an ASCII
- Xversion is available as xgetftp.doc if you don't want to install
- Xa man page), especially the parts pertaining to the cache.
- X
- X==========================================================================
- X
- XV. Acknowledgments:
- X
- XThe following people helped beta-test this program. Also, the Imakefile
- Xand formatting of the man page were done by Rob. Thanks guys!
- X
- XRobert G Henderson <robh@eclipse.cs.colorado.edu>
- XChristopher Joslyn <joslyn@spot.Colorado.EDU>
- XRich Neves <neves@cs.colorado.edu>
- X
- X==========================================================================
- END_OF_FILE
- if test 1734 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'TODO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'TODO'\"
- else
- echo shar: Extracting \"'TODO'\" \(828 characters\)
- sed "s/^X//" >'TODO' <<'END_OF_FILE'
- X
- X
- X- Auto selection of "find text" widget in Archie Search
- X- Option to "uncache" viewed file -- on view file dialog
- X- Add simple "confirm" requester for caches... maybe better to confirm
- X also the cache directory.
- X- Allow hostname to also handle IP numbers
- X- Better ftp response code handling
- X- Add confirm to close connection ; probably need to have a blocking widget
- X- Widget/menu item to skip response codes --- in case some server doesnt
- X give us enough responses
- X- Cache-consistency checks
- X- Limiting size of dir. cache in memory
- X- "Hidden files" preference
- X- Some kind of background/batch transfer capability
- X- Keep track of where user last exited at each site and take him/her back
- X to the same directory upon reconnection
- X- Add response view window
- X- Better recovery when error occurs while deleting dir cache.
- X
- Xv1.0
- X
- END_OF_FILE
- if test 828 -ne `wc -c <'TODO'`; then
- echo shar: \"'TODO'\" unpacked with wrong size!
- fi
- # end of 'TODO'
- fi
- if test -f 'cache.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cache.c'\"
- else
- echo shar: Extracting \"'cache.c'\" \(11774 characters\)
- sed "s/^X//" >'cache.c' <<'END_OF_FILE'
- X/***************************************************************************
- X * MODULE:
- X * cache.c
- X *
- X * DESCRIPTION:
- X * Provides functions to maintain a directory cache.
- X *
- X * AUTHOR:
- X * Salim Alam
- X * University of Colorado, Boulder
- X *
- X * MODIFICATION LOG:
- X * 93.01.27 S.A. Now closing cache saved/loaded files correctly
- X * 92.12.15 S.A. Fixed bug, made cache_load_levels more robust
- X * 92.12.09 S.A. Added dir caching functions.
- X * 92.12.01 S.A. Added fCached flag.
- X * 92.10.27 S.A. Fixed bugs in cache_init_level & cache_set_root, added
- X * file types.
- X *
- X **************************************************************************/
- X
- X#include <stdio.h>
- X#include "cache.h"
- X
- X#ifndef TRUE
- X#define TRUE 1
- X#define FALSE 0
- X#endif
- X
- X/************************* public module variables ************************/
- X
- Xcacheinfo_ptr toplevel = NULL;
- Xcacheinfo_ptr currlevel = NULL;
- X
- X
- X
- X/************************* private module variables ***********************/
- X
- X/*
- X * curr_path holds pointers to names of directories leading to the
- X * current path. For example, curr_path[0] would be the names of
- X * the root directory, etc. The concatenation of all the names
- X * (with the appropriate "/"s appended) yield the current directory.
- X *
- X * curr_path_index is the index to the most recent directory name.
- X *
- X * Note that memory only needs to be allocated for the root. All other
- X * entries will be pointers into the fileinfo structure.
- X */
- X#define MAX_PATH_LEN 20
- Xstatic int curr_path_index = -1;
- Xstatic char *curr_path[MAX_PATH_LEN];
- X
- X#define MAX_LINESIZE 256 /* Max. size of a line in a dir listing */
- X#define MAX_LINKS 256 /* Max. # of traversed entries / level */
- X
- X/************************* path handling functions ************************/
- X
- Xvoid cache_set_root(char *root)
- X/*
- X * saves the root name.
- X */
- X{
- X int len = strlen(root);
- X
- X /*
- X * save complete pathname of the root, without the "/" postfix
- X */
- X curr_path_index = 0;
- X if (root[len-1] == '/') len--;
- X curr_path[0] = (char *) malloc(len + 1);
- X strncpy(curr_path[0], root, len);
- X curr_path[0][len] = '\0';
- X#ifdef DEBUG
- X printf("cache_set_root: Saving root as: '%s'\n", curr_path[0]);
- X#endif
- X}
- X
- X
- X
- Xvoid cache_next_dir(char *dir)
- X/*
- X * saves the pointer to the dir name.
- X */
- X{
- X if (++curr_path_index >= MAX_PATH_LEN)
- X {
- X fprintf(stderr, "WARNING: cache_next_dir: out of stack space.\n");
- X return;
- X }
- X
- X curr_path[curr_path_index] = dir;
- X}
- X
- X
- X
- Xvoid cache_prev_dir(void)
- X/*
- X * tells us to cd up.
- X */
- X{
- X if (curr_path_index <= 0)
- X {
- X fprintf(stderr, "WARNING: cache_prev_dir: stack underflow.\n");
- X return;
- X }
- X
- X curr_path_index--;
- X}
- X
- X
- X
- Xchar *cache_make_filename(char *filename)
- X/*
- X * Creates a string with the complete path for the given file.
- X * The address of the string is returned. This string should be
- X * freed later.
- X */
- X{
- X char *s;
- X int i, path_len = 0, total_len;
- X
- X for (i=0; i <= curr_path_index; i++)
- X path_len += strlen(curr_path[i]) + 1;
- X
- X total_len = path_len + strlen(filename);
- X
- X s = (char *) malloc( total_len + 1);
- X sprintf(s, "%s/", curr_path[0]);
- X
- X for (i = 1; i <= curr_path_index; i++)
- X {
- X strcat(s, curr_path[i]);
- X strcat(s, "/");
- X }
- X
- X strcat(s, filename);
- X
- X return s;
- X}
- X
- X
- X
- X/************************* cache maintainance functions *******************/
- X
- Xint cache_init_level(cacheinfo_ptr *level, cacheinfo_ptr prev, char *filename)
- X/*
- X * Given a ftp directory listing in file "filename" (which should not be
- X * open), this function saves the names of the files and directories in the
- X * listing into the parameter *level which should be initially NULL. The
- X * parameter "prev" is a pointer to the cache item for the parent directory
- X * -- if the root directory is being cached then "prev" should be NULL.
- X *
- X * The format of the file "filename" should be _exactly_ as produced by
- X * an FTP data connection when given a "LIST" command. This includes
- X * the first line that gives the total.
- X *
- X * Memory will be allocated for the cacheinfo entry *level, as well
- X * as for the fileinfo entries within.
- X *
- X * Returns TRUE if success and FALSE if file is unreadable.
- X *
- X */
- X{
- X FILE *fp;
- X char line[100];
- X int c, i;
- X int entries = -1;
- X int len;
- X fileinfo *fi;
- X char *s;
- X
- X /*
- X * open file and ready it for reading lines of info.
- X */
- X if ((fp=fopen(filename,"r")) == NULL)
- X {
- X fprintf(stderr,"cache_init_level: can't open file '%s'\n", filename);
- X return FALSE;
- X }
- X
- X while ( (c=fgetc(fp)) != EOF )
- X if (c=='\n') entries++; /* count # of lines */
- X
- X fseek(fp, 0, 0);
- X#ifdef DEBUG
- X printf("cache_init_level: %d entries.\n", entries);
- X#endif
- X fgets(line, 98, fp); /* skip the first line */
- X
- X /*
- X * initialize level
- X */
- X if (*level != NULL)
- X fprintf(stderr, "WARNING: cache_init_level: level re-init.\n");
- X
- X *level = (cacheinfo *) malloc(sizeof(cacheinfo));
- X (*level)->prev_level = prev;
- X (*level)->num_entries = entries;
- X (*level)->entry_arr = (fileinfo *) malloc(entries * sizeof(fileinfo));
- X
- X
- X /*
- X * read in entries
- X */
- X for (i=0; i < entries; i++)
- X {
- X fgets(line, 98, fp);
- X len = strlen(line);
- X
- X /* check for newline */
- X if (line[len-1] == '\n')
- X line[(len--) - 1] = '\0';
- X else
- X fprintf(stderr, "WARNING: cache_init_level: incomplete entry.\n");
- X
- X /* If we got this in ASCII mode, there will be a linefeed as well */
- X if (line[len-1]=='\r')
- X line[(len--) - 1] = '\0';
- X
- X fi = & ( (*level)->entry_arr[i] );
- X fi->line = (char *) malloc(len+1);
- X strcpy(fi->line, line);
- X fi->next_level = NULL;
- X
- X fi->type = (line[0]=='-')? fitypFILE :
- X (line[0]=='d')? fitypDIRECTORY :
- X fitypLINK;
- X
- X fi->fCached = 0;
- X
- X /* point to name */
- X s = fi->line + len - 1;
- X while (*s && (*s != ' ')) s--;
- X fi->name = s+1;
- X }
- X
- X fclose(fp);
- X return TRUE;
- X}
- X
- X
- Xvoid cache_free_levels(cacheinfo_ptr *plevel)
- X/*
- X * Recursively deallocates the given level and all levels below it.
- X */
- X{
- X int i;
- X fileinfo *fi;
- X
- X for (i=0; i < (*plevel)->num_entries; i++)
- X {
- X fi = & ( (*plevel)->entry_arr[i] );
- X free ( fi->line );
- X if (fi->next_level)
- X {
- X cache_free_levels(&(fi->next_level));
- X }
- X }
- X
- X free( (*plevel)->entry_arr );
- X free( *plevel );
- X *plevel = NULL;
- X}
- X
- X
- X/*************************** saving/loading caches **********************/
- X
- Xint cache_save_cache(char *filepath)
- X/*
- X * Given the complete pathname of the directory cache file, this
- X * function saves the directory cache to that file.
- X *
- X * Returns TRUE for success, FALSE otherwise.
- X */
- X{
- X FILE *fp;
- X int stat;
- X
- X if ( (fp = fopen(filepath, "w")) == NULL )
- X {
- X fprintf(stderr,"cache_save_cache: can't open '%s'.\n", filepath);
- X return FALSE;
- X }
- X
- X /*
- X * Save the 'root' of remote hierarchy, with "/" appended
- X */
- X fprintf(fp, "%s/\n", curr_path[0]);
- X
- X /*
- X * Save the rest of the directory tree
- X */
- X stat = cache_save_levels(toplevel, fp);
- X
- X /*
- X * Close file and exit
- X */
- X fflush(fp);
- X fclose(fp);
- X
- X return stat;
- X}
- X
- X
- X
- Xint cache_save_levels(cacheinfo_ptr level, FILE *fp)
- X/*
- X * Given a level "level", and file pointer to an open, writable
- X * file, this function writes out the current level and all
- X * child levels to the file. The cache is output in using inorder
- X * traversal.
- X *
- X * Returns TRUE if successful, FALSE otherwise.
- X */
- X{
- X fileinfo *fi;
- X int i, nlinks = 0;
- X
- X /*
- X * Print out number of items
- X */
- X fprintf(fp, "%d\n", level->num_entries);
- X
- X /*
- X * Print out all entries for this level
- X */
- X for (i=0; i < level->num_entries; i++)
- X {
- X fi = & (level->entry_arr[i]);
- X fprintf(fp, "%s\n", fi->line);
- X if (fi->next_level) nlinks++;
- X }
- X
- X /*
- X * Print out the links
- X */
- X fprintf(fp, "%d\n", nlinks);
- X for (i=0; i < level->num_entries; i++)
- X {
- X if (level->entry_arr[i].next_level)
- X fprintf(fp, "%d\n", i);
- X }
- X
- X /*
- X * Traverse and save other levels
- X */
- X for (i=0; i < level->num_entries; i++)
- X {
- X if (level->entry_arr[i].next_level)
- X cache_save_levels(level->entry_arr[i].next_level, fp);
- X }
- X
- X return TRUE;
- X}
- X
- X
- X
- Xint cache_load_levels(cacheinfo_ptr *plevel, cacheinfo_ptr prev, FILE *fp)
- X/*
- X * Given a double-pointer to a level "plevel", and a file pointer to an
- X * open readable file, this function loads in the data for "plevel" and
- X * all its children levels. "prev" specifies a pointer to the parent
- X * level, or NULL "plevel" is the root. Memory is dynamically allocated
- X * for "plevel" and all its children.
- X *
- X * Returns TRUE on success, FALSE otherwise.
- X */
- X{
- X int n_entries;
- X int n_links;
- X int i, len;
- X int links[MAX_LINKS];
- X char line[MAX_LINESIZE];
- X int remove_newline(char *);
- X fileinfo *fi;
- X
- X /*
- X * Read #entries & alloc memory for this level
- X */
- X if (fscanf(fp, "%d\n", &n_entries)==EOF)
- X {
- X fprintf(stderr, "cache_load_levels: no entries!\n");
- X return FALSE;
- X }
- X
- X *plevel = (cacheinfo *) malloc(sizeof(cacheinfo));
- X (*plevel)->prev_level = prev;
- X (*plevel)->num_entries = n_entries;
- X (*plevel)->entry_arr = (fileinfo *) malloc(n_entries * sizeof(fileinfo));
- X
- X /*
- X * Read in entries
- X */
- X for (i=0; i < n_entries; i++)
- X {
- X char *s;
- X
- X fgets(line, MAX_LINESIZE-1, fp);
- X len = remove_newline(line);
- X fi = & ( (*plevel)->entry_arr[i] );
- X fi->line = (char *) malloc(len+1);
- X strcpy(fi->line, line);
- X fi->next_level = NULL;
- X fi->type = (line[0]=='-')? fitypFILE :
- X (line[0]=='d')? fitypDIRECTORY :
- X fitypLINK;
- X s = fi->line + len - 1;
- X while (*s && (*s != ' ')) s--;
- X fi->name = s+1;
- X }
- X
- X
- X /*
- X * Read in links
- X */
- X fscanf(fp, "%d\n", &n_links);
- X if (n_links > MAX_LINKS)
- X {
- X fprintf(stderr, "cache_load_levels: #links > %d! Aborting!\n",
- X MAX_LINKS);
- X return FALSE;
- X }
- X
- X for (i=0; i < n_links; i++)
- X fscanf(fp, "%d\n", &(links[i]));
- X
- X
- X /*
- X * Traverse the necessary levels
- X */
- X for (i=0; i < n_links; i++)
- X {
- X fi = & ( (*plevel)->entry_arr[links[i]] );
- X cache_load_levels(& (fi->next_level), *plevel, fp);
- X }
- X
- X return TRUE;
- X}
- X
- X
- X
- Xint cache_load_cache(char *filepath)
- X/*
- X * Given the complete path to the cache file, this function loads in
- X * the cached directory hierarchy into "toplevel".
- X *
- X * WARNING: This function will attempt to free the root stored in
- X * curr_path as well as toplevel. These should either be
- X * NULL or point to valid data.
- X *
- X * Returns TRUE on success, FALSE otherwise.
- X */
- X{
- X FILE *fp;
- X int len, stat;
- X char line[MAX_LINESIZE];
- X int remove_newline(char *);
- X
- X
- X /*
- X * Open file
- X */
- X if ( (fp=fopen(filepath,"r")) == NULL )
- X {
- X /* fprintf(stderr, "cache_load_cache: can't open '%s'.\n", filepath); */
- X return FALSE;
- X }
- X
- X /*
- X * Free everything
- X */
- X if (curr_path[0])
- X free(curr_path[0]);
- X
- X if (toplevel)
- X cache_free_levels(&toplevel);
- X
- X
- X /*
- X * Read in root
- X */
- X fgets(line, MAX_LINESIZE-1, fp);
- X remove_newline(line);
- X cache_set_root(line);
- X
- X
- X /*
- X * Read in everything else
- X */
- X stat = cache_load_levels(&toplevel, NULL, fp);
- X
- X /*
- X * Close file and exit
- X */
- X fclose(fp);
- X return stat;
- X}
- X
- X
- X/*************************** misc functions ******************************/
- X
- Xint remove_newline(char *s)
- X/*
- X * Given a string s, removes the newline at the end of s.
- X * Returns length of modified string.
- X */
- X{
- X int len = strlen(s);
- X
- X if (s[len-1] == '\n')
- X s[--len] = '\0';
- X
- X return len;
- X}
- X
- X
- X/*************************** debugging functions *************************/
- X
- Xvoid cache_print_level(cacheinfo_ptr level)
- X{
- X fileinfo *fi;
- X int ent;
- X
- X for (ent=0; ent < level->num_entries; ent++)
- X {
- X printf("%s:", level->entry_arr[ent].name);
- X printf("'%s'\n", level->entry_arr[ent].line);
- X }
- X}
- END_OF_FILE
- if test 11774 -ne `wc -c <'cache.c'`; then
- echo shar: \"'cache.c'\" unpacked with wrong size!
- fi
- # end of 'cache.c'
- fi
- if test -f 'cache.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cache.h'\"
- else
- echo shar: Extracting \"'cache.h'\" \(1135 characters\)
- sed "s/^X//" >'cache.h' <<'END_OF_FILE'
- X/*
- X * HEADER: cache.h
- X */
- X
- X/*
- X * The following typedefs are exported to other modules, but are not
- X * meant to be used explicitly.
- X */
- X
- Xtypedef struct _cacheinfo *cacheinfo_ptr;
- X
- X#define fitypFILE 0
- X#define fitypDIRECTORY 1
- X#define fitypLINK 2
- X
- Xtypedef struct _fileinfo
- X{
- X char *line;
- X char *name;
- X char type;
- X char fCached;
- X cacheinfo_ptr next_level;
- X} fileinfo;
- X
- Xtypedef struct _cacheinfo
- X{
- X int num_entries;
- X fileinfo *entry_arr;
- X cacheinfo_ptr prev_level;
- X} cacheinfo;
- X
- X
- X/*
- X * The following variables are exported to other modules. They should
- X * be managed using the functions provided by this module.
- X */
- X
- Xextern cacheinfo_ptr toplevel;
- Xextern cacheinfo_ptr currlevel;
- X
- X
- X/*
- X * Public function prototypes.
- X */
- X
- Xvoid
- Xcache_set_root(char *root);
- X
- Xvoid
- Xcache_next_dir(char *dir);
- X
- Xvoid
- Xcache_prev_dir(void);
- X
- Xchar *
- Xcache_make_filename(char *filename);
- X
- Xint
- Xcache_init_level(cacheinfo_ptr *level, cacheinfo_ptr prev, char *filename);
- X
- Xvoid
- Xcache_print_level(cacheinfo_ptr level);
- X
- Xvoid
- Xcache_free_levels(cacheinfo_ptr *plevel);
- X
- Xint
- Xcache_save_cache(char * filepath);
- X
- Xint
- Xcache_load_cache(char * filepath);
- END_OF_FILE
- if test 1135 -ne `wc -c <'cache.h'`; then
- echo shar: \"'cache.h'\" unpacked with wrong size!
- fi
- # end of 'cache.h'
- fi
- if test -f 'config.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'config.h'\"
- else
- echo shar: Extracting \"'config.h'\" \(523 characters\)
- sed "s/^X//" >'config.h' <<'END_OF_FILE'
- X/*************************************************************************
- X *
- X * User configuration file
- X *
- X * Modify before compiling and installing program
- X *
- X ************************************************************************/
- X
- X/*
- X * ARCHIEBIN should have complete path for archie client program.
- X */
- X#define ARCHIEBIN "/usr/local/bin/archie"
- X
- X/*
- X * ARCHIESERVER defines the server to use. The archie client
- X * defined above should allow a "-server" option.
- X *
- X */
- X#define ARCHIESERVER "archie.sura.net"
- END_OF_FILE
- if test 523 -ne `wc -c <'config.h'`; then
- echo shar: \"'config.h'\" unpacked with wrong size!
- fi
- # end of 'config.h'
- fi
- echo shar: End of archive 1 \(of 4\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! |
- "It's intuitively obvious to the most | sources-x@imd.sterling.com
- casual observer..." |
-