home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-25 | 44.9 KB | 1,607 lines |
- Newsgroups: comp.sources.misc
- From: mgleason@cse.unl.edu (Mike Gleason)
- Subject: v39i057: ncftp - Alternative User Interface for FTP, v1.5.0, Part05/05
- Message-ID: <1993Aug26.000650.24541@sparky.sterling.com>
- X-Md4-Signature: 39010a522fb7895b84b073b64aa35d3e
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: NCEMRSoft
- Date: Thu, 26 Aug 1993 00:06:50 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
- Posting-number: Volume 39, Issue 57
- Archive-name: ncftp/part05
- Environment: UNIX, ANSI-C, !SVR4
- Supersedes: ncftp: Volume 35, Issue 4-7
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: Makefile defaults.h ftp.h ftprc.h glob.h main.h
- # patchlevel.h set.h sys.h tips.c util.h v2_Note
- # Wrapped by kent@sparky on Wed Aug 25 18:59:17 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 5 (of 5)."'
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(7705 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X# Makefile for ncftp
- X#
- X# Major sections delimited by a dash lines. If several lines set the same
- X# make variable, you can choose between the commented #samples, or just
- X# type what you want manually.
- X#--------------------------------------------------------------------------
- X
- X
- X# System dependent definitions. See the README, part B.
- X#--------------------------------------------------------------------------
- XSDEFS =
- X
- X
- X# Program definitions. See the README, part C.
- X#--------------------------------------------------------------------------
- X#PDEFS =
- X#PDEFS = -DGETLINE
- X#PDEFS = -DREADLINE -DCURSES
- X#PDEFS = -DSOCKS
- XPDEFS = -DDEBUG -DDB_ERRS
- X
- X
- X# Choose your compiler and flags below. Make sure you use an ANSI compiler
- X# that handles new style function declarations and prototypes (gcc should).
- X#--------------------------------------------------------------------------
- XCC = cc
- X#CC = gcc
- X
- X#CFLAGS = -O
- XCFLAGS = -g
- X
- X#LFLAGS = -s
- XLFLAGS =
- X
- X
- X# Additional libraries and/or object files.
- X#
- X# For each library, add -lLIBNAME to the LIBS line below, for a library
- X# named libLIBNAME.a.
- X#
- X# For each object file, just add the pathname of the object file.
- X#
- X# Some may need any of -lsocket, -lnet, -linet, -lintl, or -lnsl.
- X# You'll need -lcurses or -ltermcap if CURSES is defined.
- X# You'll need -lreadline AND either -lcurses or -ltermcap if you
- X# want to use the GNU Readline library.
- X# You'll need -lgetline (compile it as a library) if you want to use
- X# getline.
- X# You'll need to know where the Rconnect.o object file is if you want
- X# to use Socks.
- X#--------------------------------------------------------------------------
- X#LIBS =
- X#LIBS = -ldbmalloc
- X#LIBS = -lgetline
- X#LIBS = -lreadline -lcurses
- X#LIBS = ../lib/Rconnect.o
- X
- X
- X# If the libraries are in a non-standard directory, or you if want to use
- X# getline or readline and they aren't installed system-wide, add the
- X# extra directories to look in here, using -L's.
- X#--------------------------------------------------------------------------
- X#LIBDIRS =
- XLIBDIRS = -L$(HOME)/src
- X#LIBDIRS = -L./getline
- X#LIBDIRS = -L./readline
- X
- X
- X# Additional headers.
- X# If you defined READLINE or GETLINE, you have to tell where it's header
- X# file can be found.
- X#--------------------------------------------------------------------------
- X#HDRDIRS = -I.
- XHDRDIRS = -I$(HOME)/src
- X#HDRDIRS = -I./getline
- X#HDRDIRS = -I./readline
- X
- X
- X# If you want to 'make install,' edit these variables, otherwise don't
- X# worry about it.
- X#--------------------------------------------------------------------------
- XBINDIR = /usr/local
- XMANDIR = /usr/man/man1
- XRM = rm -f
- XCP = cp
- X
- X
- X#************************************************
- X#*** SHOULD NOT NEED TO EDIT BELOW THIS POINT ***
- X#************************************************
- X
- XDEFS = $(PDEFS) $(SDEFS)
- XMK = $(CC) $(CFLAGS) $(DEFS) $(HDRDIRS) $(LFLAGS) $(LIBDIRS) $(LIBS)
- X
- XNAME = ncftp
- XMAN = ncftp.1
- XALL = $(SRCS) $(HEADERS) patchlevel.h Blurb README Makefile $(MAN) \
- Xv2_Note
- X
- XVERS=150
- XPKGNAME = ncftp$(VERS)
- XTARNAME = $(PKGNAME).tar
- X
- XSRCS = cmds.c cmdtab.c ftp.c ftprc.c getpass.c glob.c main.c open.c set.c \
- Xtips.c util.c
- X
- XHEADERS = cmds.h copyright.h defaults.h ftp.h ftprc.h getpass.h glob.h \
- Xmain.h open.h set.h sys.h util.h
- X
- XOBJS = cmds.o cmdtab.o ftp.o ftprc.o getpass.o glob.o main.o open.o set.o \
- Xtips.o util.o
- X
- XC_COMPILE = $(CC) $(CFLAGS) $(DEFS) $(HDRDIRS)
- XC_COMPILE2 = $(CC) $(CFLAGS) $(DEFS) -DMK='"$(MK)"' $(HDRDIRS)
- X
- Xall: $(NAME) done
- X
- X$(NAME): $(OBJS)
- X $(CC) $(LFLAGS) $(LIBDIRS) $(OBJS) -o $(NAME) $(LIBS)
- X
- Xinstall: $(NAME)
- X $(CP) $(NAME) $(BINDIR)/$(NAME)
- X $(CP) $(MAN) $(MANDIR)/$(MAN)
- X
- Xuninstall:
- X $(RM) $(BINDIR)/$(NAME)
- X $(RM) $(MANDIR)/$(MAN)
- X
- Xcmds.o:
- X $(C_COMPILE2) cmds.c -c -o cmds.o
- X
- X.c.o:
- X $(C_COMPILE) -c $<
- X
- Xclean:
- X rm -f $(OBJS) core $(NAME)
- X
- XSGI_CFLAGS = -prototypes -xansi -fullwarn -woff 211,269,270,303,309,24,51
- XFTPDIR=/usr/people/ftp/pub/mgleason
- X
- Xshared: $(OBJS)
- X $(CC) $(OBJS) $(LIBDIRS) -o $(NAME) -lc_s $(LIBS) -s
- X -@ls -l $(NAME)
- X
- Xlint: $(SRCS)
- X lint $(SRCS) $(CFLAGS) $(DEFS) > './Junk/lint'
- X
- Xtags:
- X ctags -x $(SRCS) $(HEADERS) | sort -f > tags
- X
- Xtar:
- X tar cvf - $(ALL) | compress > $(TARNAME).Z
- X ls -l $(TARNAME).Z
- X
- Xgz:
- X tar cvf - $(ALL) | gzip > $(TARNAME).z
- X ls -l $(TARNAME).z
- X
- Xshar2:
- X shar $(ALL) > $(NAME).shar
- X
- Xshar:
- X shar $(ALL) | cat Blurb - > $(NAME).shar
- X
- Xdone: $(NAME)
- X -@ls -l $(NAME)
- X -@echo 'Done.'
- X
- X
- Xpixie: $(NAME) $(NAME).Counts $(NAME).Addrs
- X prof -pixie $(NAME) $(NAME).Addrs $(NAME).Counts -feedback Feedback
- X
- X$(NAME).Addrs: $(NAME)
- X pixie -o $(NAME).pixie $(NAME)
- X
- X$(NAME).Counts: ftp $(NAME).Addrs
- X $(NAME).pixie
- X
- Xprofile:
- X rm -f *.[ou]
- X cc $(SGI_CFLAGS) $(SRCS) $(DEFS) -g -p -o ncftp.prof
- X ncftp.prof
- X prof ncftp.prof mon.out
- X
- Xrmobjs:
- X -@rm -f *.[ou]
- X
- Xfreshdebug: rmobjs
- X pmake "CFLAGS=$(SGI_CFLAGS) -g" LFLAGS=-g
- X
- Xdebug:
- X pmake "CFLAGS=$(SGI_CFLAGS) -g" LFLAGS=-g
- X
- Xopt: rmobjs
- X pmake "CFLAGS=-O2 $(SGI_CFLAGS)" LFLAGS=-s
- X -@ls -l $(NAME)
- X
- Xshopt: opt shared
- X
- Xgopt: rmobjs
- X pmake CC=gcc "CFLAGS=-O2 $(SGI_CFLAGS)" LFLAGS=-s
- X -@ls -l $(NAME)
- X
- XJUNK = ~/N/Junk
- X
- Xmantst: ncftp.1
- X nroff -man ncftp.1 > $(JUNK)/ncftp.man
- X less $(JUNK)/ncftp.man
- X
- Xsz:
- X sz -e $(ALL)
- X
- Xgetline:
- X -rm util.o cmds.o tips.o
- X make PDEFS=-DGETLINE LIBS=-lgetline LIBDIRS=-L$(HOME)/src/ncftp/getline \
- X HDRDIRS=-I$(HOME)/src/ncftp/getline
- X
- Xfinst:
- X -@mkdir /tmp/$(PKGNAME)
- X cp -r $(ALL) /tmp/$(PKGNAME)
- X (cd /tmp ; tar cvf - $(PKGNAME) | gzip -f > $(FTPDIR)/$(TARNAME).z )
- X chmod 644 $(FTPDIR)/$(TARNAME).z
- X -@ls -l $(FTPDIR)/$(TARNAME).z
- X -@rm -rf /tmp/$(PKGNAME)
- X
- Xdepend:
- X cc -M $(SRCS) | grep -v '/' >> Makefile
- X
- Xprotos:
- X apply "mkptypes -x -A %1 > %1.pr" $(SRCS)
- X -@echo 'Done.'
- X
- Xpatch:
- X -rm -rf /tmp/old /tmp/new
- X -mkdir /tmp/old /tmp/new
- X cp ~/ncftp.shar /tmp/old/oldncftp.shar
- X (cd /tmp/old ; unshar -n oldncftp.shar )
- X make shar
- X cp ncftp.shar /tmp/new
- X (cd /tmp/new; unshar -n ncftp.shar )
- X rm /tmp/new/ncftp.shar /tmp/old/oldncftp.shar
- X (cd /tmp/old ; diff -c . ../new > ../pch)
- X
- Xcoall:
- X co -u -f $(SRCS) $(HEADERS)
- X
- Xnewver:
- X ci -Nv$(VERS) -f "-mv$(VERS) release" -M -u $(SRCS) $(HEADERS)
- X
- Xciall:
- X ci -q -M -u $(SRCS) $(HEADERS)
- X
- X# Dependencies:
- Xcmds.o: cmds.c
- Xcmds.o: sys.h
- Xcmds.o: util.h
- Xcmds.o: cmds.h
- Xcmds.o: main.h
- Xcmds.o: ftp.h
- Xcmds.o: ftprc.h
- Xcmds.o: getpass.h
- Xcmds.o: glob.h
- Xcmds.o: set.h
- Xcmds.o: defaults.h
- Xcmds.o: copyright.h
- Xcmdtab.o: cmdtab.c
- Xcmdtab.o: sys.h
- Xcmdtab.o: util.h
- Xcmdtab.o: cmds.h
- Xcmdtab.o: main.h
- Xcmdtab.o: ftp.h
- Xcmdtab.o: ftprc.h
- Xcmdtab.o: glob.h
- Xcmdtab.o: open.h
- Xcmdtab.o: set.h
- Xcmdtab.o: copyright.h
- Xftp.o: ftp.c
- Xftp.o: sys.h
- Xftp.o: util.h
- Xftp.o: ftp.h
- Xftp.o: cmds.h
- Xftp.o: main.h
- Xftp.o: ftprc.h
- Xftp.o: getpass.h
- Xftp.o: defaults.h
- Xftp.o: copyright.h
- Xftprc.o: ftprc.c
- Xftprc.o: sys.h
- Xftprc.o: util.h
- Xftprc.o: ftprc.h
- Xftprc.o: main.h
- Xftprc.o: cmds.h
- Xftprc.o: set.h
- Xftprc.o: defaults.h
- Xftprc.o: copyright.h
- Xgetpass.o: getpass.c
- Xgetpass.o: sys.h
- Xgetpass.o: util.h
- Xgetpass.o: cmds.h
- Xgetpass.o: getpass.h
- Xgetpass.o: copyright.h
- Xglob.o: glob.c
- Xglob.o: sys.h
- Xglob.o: util.h
- Xglob.o: glob.h
- Xglob.o: cmds.h
- Xglob.o: copyright.h
- Xmain.o: main.c
- Xmain.o: sys.h
- Xmain.o: util.h
- Xmain.o: cmds.h
- Xmain.o: main.h
- Xmain.o: ftp.h
- Xmain.o: ftprc.h
- Xmain.o: open.h
- Xmain.o: set.h
- Xmain.o: defaults.h
- Xmain.o: copyright.h
- Xopen.o: open.c
- Xopen.o: sys.h
- Xopen.o: util.h
- Xopen.o: open.h
- Xopen.o: cmds.h
- Xopen.o: ftp.h
- Xopen.o: ftprc.h
- Xopen.o: main.h
- Xopen.o: defaults.h
- Xopen.o: copyright.h
- Xset.o: set.c
- Xset.o: sys.h
- Xset.o: util.h
- Xset.o: cmds.h
- Xset.o: main.h
- Xset.o: set.h
- Xset.o: defaults.h
- Xset.o: copyright.h
- Xtips.o: tips.c
- Xtips.o: sys.h
- Xtips.o: util.h
- Xutil.o: util.c
- Xutil.o: sys.h
- Xutil.o: util.h
- Xutil.o: cmds.h
- Xutil.o: main.h
- Xutil.o: ftp.h
- Xutil.o: ftprc.h
- Xutil.o: defaults.h
- Xutil.o: copyright.h
- END_OF_FILE
- if test 7705 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'defaults.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'defaults.h'\"
- else
- echo shar: Extracting \"'defaults.h'\" \(2610 characters\)
- sed "s/^X//" >'defaults.h' <<'END_OF_FILE'
- X/* Defaults.h: default values for ftp's common variables */
- X
- X/* These are all surrounded by #ifndef blocks so you can just use
- X * the -D flag with your compiler (i.e. -DZCAT=\"/usr/local/bin/zcat\").
- X */
- X
- X#ifndef _DEFAULTS_H_
- X#define _DEFAULTS_H_
- X
- X/* $RCSfile: defaults.h,v $
- X * $Revision: 14020.13 $
- X * $Date: 93/07/09 10:58:27 $
- X */
- X
- X#ifndef NEWMAILMESSAGE /* For english speakers, "You have new mail." */
- X#define NEWMAILMESSAGE "You have new mail."
- X#endif
- X
- X#ifndef ZCAT /* Usually "zcat," but use the full pathname */
- X /* if possible. */
- X#define ZCAT "zcat"
- X#endif
- X
- X#ifndef MAX_XFER_BUFSIZE
- X#define MAX_XFER_BUFSIZE 32768
- X#endif
- X
- X#ifndef dANONOPEN /* 1 or 0, usually 1 */
- X#define dANONOPEN 1
- X#endif
- X
- X#ifndef dDEBUG /* 1 or 0, usually 0 */
- X#define dDEBUG 0
- X#endif
- X
- X#ifndef dMPROMPT /* Usually 1, I prefer 0... */
- X#define dMPROMPT 0
- X#endif
- X
- X#ifndef dVERBOSE /* V_QUIET, V_ERRS, V_TERSE, V_VERBOSE */
- X#define dVERBOSE V_TERSE
- X#endif
- X
- X#ifndef dPROMPT /* short: "@Bftp@P>" */
- X /* long: "@B@E @UNcFTP@P @B@M@D@P ->" */
- X#define dPROMPT "@B@c@Mncftp@P>" /* new two line prompt */
- X#endif
- X
- X#ifndef dPAGER /* if set to empty string, act like 'cat' */
- X#define dPAGER "more"
- X#endif
- X
- X#ifndef dLOGNAME /* usu. put in the user's home directory. */
- X#define dLOGNAME "~/.ftplog"
- X#endif
- X
- X#ifndef dRECENTF /* usu. put in the user's home directory. */
- X#define dRECENTF "~/.ncrecent"
- X#endif
- X
- X#ifndef dMAXRECENTS /* limit to how many recent sites to save. */
- X#define dMAXRECENTS 16
- X#endif
- X
- X#ifndef dRECENT_ON /* Do you want the recent log on? */
- X /* usually 1. */
- X#define dRECENT_ON 1
- X#endif
- X
- X /* Do you want logging on by default? */
- X#ifndef dLOGGING /* usually 0 */
- X#define dLOGGING 0
- X#endif
- X
- X#ifndef dTYPE /* usually TYPE_A */
- X#define dTYPE TYPE_A
- X#endif
- X
- X#ifndef dTYPESTR /* usually "ascii" */
- X#define dTYPESTR "ascii"
- X#endif
- X
- X#ifndef dREDIALDELAY /* usu. 60 (seconds). */
- X#define dREDIALDELAY 60
- X#endif
- X
- X#ifndef CMDLINELEN
- X#define CMDLINELEN 256
- X#endif
- X
- X#ifndef RECEIVEDLINELEN
- X#define RECEIVEDLINELEN 256
- X#endif
- X
- X#ifndef MAXMACROS
- X#define MAXMACROS 16
- X#endif
- X
- X#ifndef MACBUFLEN /* usually 4096. */
- X#define MACBUFLEN 4096
- X#endif
- X
- X/* Do you want binary transfers by default? */
- X#ifndef dAUTOBINARY /* usually 1 */
- X#define dAUTOBINARY 1
- X#endif
- X
- X#ifndef dPROGRESS
- X#define dPROGRESS pr_philbar /* can be: pr_none, pr_percent, pr_philbar,
- X * or pr_kbytes
- X */
- X#endif
- X
- X/* Default login name at gateway */
- X#ifdef GATEWAY
- X# ifndef dGATEWAY_LOGIN
- X# define dGATEWAY_LOGIN "ftp"
- X# endif
- X#endif
- X
- X#endif /* _DEFAULTS_H_ */
- X
- X/* eof */
- END_OF_FILE
- if test 2610 -ne `wc -c <'defaults.h'`; then
- echo shar: \"'defaults.h'\" unpacked with wrong size!
- fi
- # end of 'defaults.h'
- fi
- if test -f 'ftp.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ftp.h'\"
- else
- echo shar: Extracting \"'ftp.h'\" \(1375 characters\)
- sed "s/^X//" >'ftp.h' <<'END_OF_FILE'
- X/* ftp.h */
- X
- X#ifndef _ftp_h_
- X#define _ftp_h_
- X
- X/* $RCSfile: ftp.h,v $
- X * $Revision: 14020.11 $
- X * $Date: 93/07/09 11:04:12 $
- X */
- X
- X#define IS_FILE 1
- X#define IS_STREAM 0
- X#define IS_PIPE -1
- X
- X/* Progress-meter types. */
- X#define pr_none 0
- X#define pr_percent 1
- X#define pr_philbar 2
- X#define pr_kbytes 3
- X#define pr_dots 4
- X#define pr_last pr_dots
- X
- Xint hookup(char *, unsigned int);
- Xint Login(char *userNamePtr, char *passWordPtr, char *accountPtr, int doInit);
- Xvoid cmdabort SIG_PARAMS;
- Xint command(char *);
- Xint quiet_command(char *);
- Xint verbose_command(char *);
- Xint getreply(int);
- Xint start_progress(int, char *);
- Xint progress_report(int);
- Xvoid end_progress(char *, char *, char *);
- Xvoid close_file(FILE **, int);
- Xvoid abortsend SIG_PARAMS;
- Xint sendrequest(char *, char *, char *);
- Xvoid abortrecv SIG_PARAMS;
- Xvoid GetLSRemoteDir(char *, char *);
- Xint AdjustLocalFileName(char *);
- Xint SetToAsciiForLS(int, int);
- Xint IssueCommand(char *, char *);
- XFILE *OpenOutputFile(int, char *, char *, sig_t *);
- Xvoid ReceiveBinary(FILE *, FILE *, int *, char *);
- Xvoid AddRedirLine(char *);
- Xvoid ReceiveAscii(FILE *, FILE *, int *, char *, int);
- Xvoid CloseOutputFile(FILE *, int, char *, time_t);
- Xvoid ResetOldType(int);
- Xint FileType(char *);
- Xvoid CloseData(void);
- Xint recvrequest(char *, char *, char *, char *);
- Xint initconn(void);
- XFILE *dataconn(char *);
- X
- X#endif /* _ftp_h_ */
- X
- X/* eof ftp.h */
- END_OF_FILE
- if test 1375 -ne `wc -c <'ftp.h'`; then
- echo shar: \"'ftp.h'\" unpacked with wrong size!
- fi
- # end of 'ftp.h'
- fi
- if test -f 'ftprc.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ftprc.h'\"
- else
- echo shar: Extracting \"'ftprc.h'\" \(931 characters\)
- sed "s/^X//" >'ftprc.h' <<'END_OF_FILE'
- X/* ftprc.h */
- X
- X#ifndef _ftprc_h_
- X#define _ftprc_h_
- X
- X/* $RCSfile: ftprc.h,v $
- X * $Revision: 14020.11 $
- X * $Date: 93/05/21 05:45:31 $
- X */
- X
- X#define NETRC "netrc"
- X#define FTPRC "ncftprc"
- X
- X#define RC_DELIM " \n\t,"
- X
- Xtypedef struct site *siteptr;
- Xtypedef struct site {
- X char *name; /* name (or IP address) of site */
- X siteptr next;
- X} site;
- X
- Xtypedef struct recentsite {
- X char *name; /* name (or IP address) of site */
- X char *dir; /* directory we were in last time we called. */
- X time_t lastcall; /* when this site was called last. */
- X} recentsite;
- X
- Xint thrash_rc(void);
- Xvoid AddNewSitePtr(char *word);
- Xint ruserpass2(char *host, char **user, char **pass, char **acct);
- Xvoid GetFullSiteName(char *host, char *lastdir);
- Xvoid ReadRecentSitesFile(void);
- Xvoid WriteRecentSitesFile(void);
- Xvoid AddRecentSite(char *host, char *lastdir);
- Xvoid UpdateRecentSitesList(char *host, char *lastdir);
- Xvoid PrintSiteList(void);
- X
- X#endif
- X/* eof */
- END_OF_FILE
- if test 931 -ne `wc -c <'ftprc.h'`; then
- echo shar: \"'ftprc.h'\" unpacked with wrong size!
- fi
- # end of 'ftprc.h'
- fi
- if test -f 'glob.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'glob.h'\"
- else
- echo shar: Extracting \"'glob.h'\" \(375 characters\)
- sed "s/^X//" >'glob.h' <<'END_OF_FILE'
- X/* glob.h */
- X
- X#ifndef _glob_h_
- X#define _glob_h_ 1
- X
- X/* $RCSfile: glob.h,v $
- X * $Revision: 14020.11 $
- X * $Date: 93/05/21 05:45:32 $
- X */
- X
- Xchar **glob(char *v);
- Xint letter(char c);
- Xint digit(char c);
- Xint any(int c, char *s);
- Xint blklen(char **av);
- Xchar **blkcpy(char **oav, char **bv);
- Xvoid blkfree(char **av0);
- Xchar **copyblk(char **v);
- Xint gethdir(char *home_dir);
- X
- X#endif
- X
- END_OF_FILE
- if test 375 -ne `wc -c <'glob.h'`; then
- echo shar: \"'glob.h'\" unpacked with wrong size!
- fi
- # end of 'glob.h'
- fi
- if test -f 'main.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'main.h'\"
- else
- echo shar: Extracting \"'main.h'\" \(889 characters\)
- sed "s/^X//" >'main.h' <<'END_OF_FILE'
- X/* main.h */
- X
- X#ifndef _main_h_
- X#define _main_h_
- X
- X/* $RCSfile: main.h,v $
- X * $Revision: 14020.12 $
- X * $Date: 93/05/21 05:45:33 $
- X */
- X
- Xstruct userinfo {
- X str32 username;
- X string homedir;
- X string shell;
- X string hostname;
- X int uid;
- X};
- X
- Xvoid intr SIG_PARAMS;
- Xint getuserinfo(void);
- Xint init_arrays(void);
- Xvoid init_transfer_buffer(void);
- Xvoid init_prompt(void);
- Xvoid lostpeer SIG_PARAMS;
- Xvoid cmdscanner(int top);
- Xchar *strprompt(void);
- Xvoid makeargv(void);
- Xchar *slurpstring(void);
- Xint help(int argc, char **argv);
- Xvoid trim_log(void);
- Xint CheckNewMail(void);
- X
- X#ifdef CURSES
- Xvoid tcap_put(char *cap);
- Xvoid termcap_init(void);
- Xvoid termcap_get(char *dest, char *attr);
- X#ifdef NO_CONST
- Xextern char *tgetstr(char *, char **);
- X#else
- Xextern char *tgetstr(const char *, char **);
- X#endif
- X#endif /* CURSES */
- X/* Should be in a 'tips.h,' but... */
- Xvoid PrintTip(void);
- X
- X#endif /* _main_h_ */
- X
- END_OF_FILE
- if test 889 -ne `wc -c <'main.h'`; then
- echo shar: \"'main.h'\" unpacked with wrong size!
- fi
- # end of 'main.h'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(6991 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X/* patchlevel.h */
- X
- X/*
- X * v1.0.0 - December 6, 1992.
- X * Initial release.
- X *
- X * v1.0.1 - December 8, 1992.
- X * Added default value for NCARGS in glob.c for systems that don't define it.
- X * Fixed pdir bug which was caused by me mistakenly adding the page-a-
- X * compressed-file feature to ls instead of page. Fixed bug in documentation,
- X * which had the same error! Added spec for Ultrix in sys.h. Fixed error
- X * in sys.h that recommended -Dconst instead of -Dconst="". Added GETPASS
- X * compile flag to use getpass() instead of getpass2(), which make compiling
- X * easier if the compiler choked in cmds.c. Added GETCWDSIZET for systems
- X * whose getcwd() takes a size_t instead of an int.
- X *
- X * v1.0.2 - Jan 17, 1993.
- X * Using the cpp symbol CONST instead of const to tell
- X * the compiler not to use the 'const' directive. Checking for __sgi as
- X * well as sgi in sys.h. Added #ifndef __GNUC__ block to make SunOS users
- X * use gcc. You can avoid trying to include <unistd.h> by defining
- X * NO_UNISTDH. Added DG/UX entry in sys.h. Also added still another cpp
- X * symbol, BAD_INETADDR, which is used if inet_addr returns a structure
- X * instead of a u_long (this is only for DG/UX so far). Changed long to
- X * int in wait(). Added default value for NCARGS in glob.c. Added cpp
- X * symbol NO_STDLIBH for systems without <stdlib.h>. Fixed 'quote.'
- X * Fixed 'size.' Set all's string variable are printed in double quotes.
- X * Ansi-escapes is init'd to 1 if TERM==xterm. Fixed 'type tenex.' Set
- X * verbose makes sure verbose is within bounds and prints messages now.
- X * Better getpass2. Tries .ncftprc before .netrc. @N adds a \n to prompt.
- X * ls() is more flexible. Macdef and $ print current macros if no arg
- X * is given. getpass2 is now Getpass, and accompanying this are
- X * more cpp symbols SGTTYB and TERMIOS. Better SCO support. No longer using
- X * gets(), instead using own Gets() which is safer. Better termcap support,
- X * or actually curses support, to get ansi-escape sequences. Using -FC
- X * instead of -CF for ls flags, do avoid a rare conflict. Progress meters
- X * work better. Phil Dietz added a cool bar graph one, and I added another
- X * similar to the default percentage meter that shows the # KB transferred,
- X * which will work on systems not supporting SIZE. Fixed floating point
- X * exception bug in put/mput. Fixed implicit_cd to work with wuarchive-ish
- X * cd messages. Added NeXT and DYNIX blocks in sys.h.
- X * Fixed bug in _cd, that was trying to use wildcards when it
- X * shouldn't. Fixed bug in macdef. Fixed small bug in getreply. Turned
- X * off echoing during the progress-meter. Added syslogging capability.
- X *
- X * v1.4.0 - Summer 1993, not finished yet.
- X * Fixed error in CONST block in ftpdefs.h. Fixed error in sys.h so that when
- X * you compile with -DGETPASS it uses getpass. 'ls' bug with wildcards
- X * fixed. 'ls' enhanced to take multiple remote paths. Added new cpp symbol
- X * STRICT_PROTOS so I don't have to worry about the correct declarations of
- X * int returning functions. Moved termcap_init() up. Changed value of
- X * tcap_plain to "me" from "se." Defining TERMIOS by default for SunOS.
- X * Edited perror to not print ioctl errors (for SunOS only). Making sure
- X * we use ioctl only on tty files. Using <arpa/ftp.h> for SCO to get
- X * MAXPATHLEN instead of <sys/arpa.h>. 386BSD and Pyramid OSx entries added
- X * to sys.h. Fixed subtle error in FGets macro. Using private _Strn
- X * string routines, with macros to them instead of the strn routines.
- X * Added support for GNU Readline (not included). Added BROKEN_MEMCPY
- X * CPP symbol for other systems with same bug as that of SCO (see ftp.c).
- X * Changed mail detection code a bit, hopefully ending the false alarms
- X * that some systems were having. New CPP symbol, dFTP_PORT, lets you define
- X * the default ftp port if your OS (i.e. ISC unix) is wrong. Fixed bugs
- X * in 'rstatus' and 'syst;' apparently no one noticed... Phased out
- X * mls and mdir since ls does it all now. Added dPROGRESS to defaults.h to
- X * set the default progress indicator. Colon-mode wasn't quiet; fixed.
- X * Some new prompt @flags added. @flags that may result in an empty string
- X * are set so that when they do print something, they tack on a trailing
- X * space. May have fixed bug that caused 'page' to drop connection when
- X * you quit your pager. NcFTP tries to prevent itself from becoming a
- X * mindless zombie process. Fixed bug in 'rename.' Added another progress
- X * indicator that doesn't use any backspaces. Firewall support added by
- X * Dave Wolfe (dwolfe@pffft.sps.mot.com). Saving the entire servent struct,
- X * not just a ptr to it. Support the DOTDIR env variable. Fetched files'
- X * modification times now set to that on the server. Added RO-Var "netrc."
- X * Munged Makefile to support 'install' and 'uninstall,' and passing the
- X * installation parameters as a -D flag. Awesome new recent site log!
- X * Can type 'open' by itself to print out the sites in our netrc/recent
- X * buffers. Added show command. Drastic changes in source code; cmds.c
- X * made smaller by spawning set.c and util.c; ftpdefs.h eliminated. Improved
- X * on-line help. Revamped the command table, by eliminating obselete fields
- X * and adding a usage field to print a cmd's usage message. Removed all the
- X * useless settings of the 'code' variable. Added tips.c. Better support
- X * for ~s and environment vars in pathnames. Ascii transfers can get whole
- X * lines at a time instead of just chars at a time, so ascii transfers may
- X * be a bit faster. Old FTP commands are acknowledged at least. Some
- X * additions for Apollo in sys.h. Code in ftp.c cleaned up a bit, most
- X * notably the obnoxiously long recvrequest() function has been broken up
- X * into quite a few subroutines; it's still too long for my taste, though.
- X * Incorporated some stuff by Tom Dickey. Enhanced Perror() function to
- X * print more stuff if DB_ERRS is defined. Added 'ftpcat' mode. You can
- X * now turnoff the startup msg. GNU gzip support added. Added dbprintf()
- X * function to print the debug messages. Changed mind and decided to
- X * read the whole stream anyway on aborts for better stability; you can
- X * still try the aborting the stream if you define TryAbort. Added 'site'
- X * command. Fixed bug where verbose was left set to V_QUIET when you used
- X * colon-mode. Printing a warning when you try something like 'ls -t *.Z,'
- X * because wildcards don't work right with ls flags. Verbose and debug can
- X * be set directly from the cmd line (i.e. -D 3, not -DDD). Verbosity can
- X * be set using their ascii names, in addition to it's number, like 'set
- X * verbose = quiet.' Removed setpeer from cmds.c, and created new files,
- X * open.{c,h} dedicated to it; broke up setpeer into smaller sub-procs,
- X * and commented whole file (yay!). Added a new user var, anon-open,
- X * for those folks who don't want anon logins as the default.
- X */
- END_OF_FILE
- if test 6991 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- if test -f 'set.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'set.h'\"
- else
- echo shar: Extracting \"'set.h'\" \(1029 characters\)
- sed "s/^X//" >'set.h' <<'END_OF_FILE'
- X/* Set.h */
- X
- X#ifndef _set_h_
- X#define _set_h_
- X
- X/* $RCSfile: set.h,v $
- X * $Revision: 14020.11 $
- X * $Date: 93/06/26 06:21:32 $
- X */
- X
- X/* Variable types. */
- X#define INT 1
- X#define LONG 2
- X#define STR 3
- X#define BOOL 4
- X
- Xtypedef void (*setvarproc)(char *, int);
- Xstruct var {
- X char *name;
- X short nmlen;
- X short type;
- X short conn_required;
- X void *var;
- X setvarproc proc;
- X};
- X
- X#define VARENTRY(n,t,c,v,p) { (n), (short)(sizeof(n) - 1), (t), (c), (v), (setvarproc)(p) }
- X#define NVARS ((int) (sizeof(vars)/sizeof(struct var)))
- X
- Xvoid set_prompt(char *new, int unset);
- Xvoid set_log(char *fname, int unset);
- Xvoid set_ldir(char *ldir, int unset);
- X#ifdef GATEWAY
- Xvoid set_gateway(char *, int);
- Xvoid set_gatelogin(char *, int);
- X#endif
- Xvoid set_pager(char *new, int unset);
- Xvoid set_verbose(char *new, int unset);
- Xvoid set_type(char *newtype, int unset);
- Xstruct var *match_var(char *varname);
- Xvoid show_var(struct var *v);
- Xvoid show(char *varname);
- Xint do_show(int argc, char **argv);
- Xint set(int argc, char **argv);
- X
- X#endif /* _set_h_ */
- END_OF_FILE
- if test 1029 -ne `wc -c <'set.h'`; then
- echo shar: \"'set.h'\" unpacked with wrong size!
- fi
- # end of 'set.h'
- fi
- if test -f 'sys.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sys.h'\"
- else
- echo shar: Extracting \"'sys.h'\" \(7142 characters\)
- sed "s/^X//" >'sys.h' <<'END_OF_FILE'
- X/* Sys.h
- X * See the README for details.
- X */
- X
- X/* $RCSfile: sys.h,v $
- X * $Revision: 14020.13 $
- X * $Date: 93/06/21 06:42:11 $
- X */
- X
- X#ifdef __sun
- X# ifndef sun
- X# define sun 1
- X# endif
- X#endif
- X
- X#ifdef sun
- X# if !defined(__GNUC__) && !defined(__STDC__) && !defined(SunOverride)
- X ^^^ "You need to use an ANSI C compiler. Try using gcc or acc." ^^^
- X# endif
- X# define System "SunOS"
- X# ifndef RINDEX
- X# define RINDEX 1
- X# endif
- X# ifndef TERMIOS
- X# define TERMIOS 1
- X# endif
- X# ifndef HAS_DOMAINNAME
- X# define HAS_DOMAINNAME 1
- X# endif
- X#endif /* sun */
- X
- X#ifdef __sgi
- X# ifndef sgi
- X# define sgi 1
- X# endif
- X#endif
- X
- X#ifdef sgi
- X# define System "IRIX"
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X# ifndef HERROR
- X# define HERROR 1
- X# endif
- X# ifndef U_WAIT
- X# define U_WAIT 1
- X# endif
- X# ifndef STRICT_PROTOS
- X# define STRICT_PROTOS 1
- X# endif
- X#endif /* sgi */
- X
- X#ifdef _AIX
- X# define System "AIX"
- X# define SYSSELECTH 1
- X#endif /* _AIX */
- X
- X#ifdef SCO324
- X# define System "SCO Unix"
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X# ifndef BROKEN_MEMCPY
- X# define BROKEN_MEMCPY 1
- X# endif
- X#endif /* SCO */
- X
- X#ifdef aux
- X# define System "A/UX"
- X# ifndef BROKEN_MEMCPY
- X# define BROKEN_MEMCPY 1
- X# endif
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X#endif
- X
- X#ifdef NeXT
- X# define System "NeXTStep"
- X# ifndef RINDEX
- X# define RINDEX 1
- X# endif
- X# ifndef BSD
- X# define BSD 1
- X# endif
- X# ifndef NO_UNISTDH
- X# define NO_UNISTDH 1
- X# endif
- X# ifndef NO_UTIMEH
- X# define NO_UTIMEH
- X# endif
- X#endif
- X
- X#ifdef pyr
- X# define System "OSx"
- X# ifndef BSD
- X# define BSD 1
- X# endif
- X# ifndef SGTTYB
- X# define SGTTYB 1
- X# endif
- X# ifndef NO_STDLIBH
- X# define NO_STDLIBH 1
- X# endif
- X# include <sys/types.h>
- Xextern int errno;
- X#endif /* pyr */
- X
- X#ifdef DYNIX
- X# define System "Dynix"
- X# ifndef BSD
- X# define BSD 1
- X# endif
- X# ifndef SGTTYB
- X# define SGTTYB 1
- X# endif
- X# ifndef NO_STDLIBH
- X# define NO_STDLIBH 1
- X# endif
- X#endif /* DYNIX */
- X
- X#ifdef ultrix
- X# define System "Ultrix"
- X# ifndef BSD
- X# define BSD 1
- X# endif
- X# ifndef __GNUC__
- X# ifndef NO_CONST
- X# define NO_CONST 1
- X# endif
- X# endif
- X#endif /* ultrix */
- X
- X#ifdef __hpux
- X# ifndef HPUX
- X# define HPUX 1
- X# endif
- X# define Select(a,b,c,d,e) select((a), (int *)(b), (c), (d), (e))
- X#endif
- X
- X#ifdef HPUX
- X# define System "HP-UX"
- X# ifndef _HPUX_SOURCE
- X# define _HPUX_SOURCE 1
- X# endif
- X# ifndef GETCWDSIZET
- X# define GETCWDSIZET 1
- X# endif
- X# define SYSV 1
- X#endif /* HPUX */
- X
- X#ifdef SINIX
- X# define System "SINIX"
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X/* You may need to add -lresolv, -lport, -lcurses to MORELIBS in Makefile. */
- X#endif
- X
- X#ifdef BULL /* added 23nov92 for Bull DPX/2 */
- X# define _POSIX_SOURCE
- X# define _XOPEN_SOURCE
- X# define _BULL_SOURCE
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X# define bull
- X# define System "Bull DPX/2 BOS"
- X# include <sys/types.h>
- X# define SYSSELECTH
- X#endif /* BULL */ /* added 23nov92 for Bull DPX/2 */
- X
- X#ifdef __dgux
- X# ifndef DGUX
- X# define DGUX 1
- X# endif
- X#endif
- X
- X#ifdef DGUX
- X# ifndef _DGUX_SOURCE
- X# define _DGUX_SOURCE
- X# endif
- X# define GETCWDSIZET 1
- X# define BAD_INETADDR 1
- X# define SYSV 1
- X# define System "DG/UX"
- X#endif /* DGUX */
- X
- X#ifdef apollo
- X# ifndef BSD
- X# define BSD 43
- X# endif
- X# define SIG_PARAMS (int sig, ...)
- X# define NO_UTIMEH 1
- X# define System "Apollo"
- X#endif
- X
- X/* -------------------------------------------------------------------- */
- X
- X#ifdef _SYSV
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X#endif
- X
- X#ifdef USG
- X# ifndef SYSV
- X# define SYSV 1
- X# endif
- X#endif
- X
- X#ifdef _BSD
- X# ifndef BSD
- X# define BSD 1
- X# endif
- X#endif
- X
- X#ifdef SYSV
- X# ifndef RINDEX
- X# define RINDEX 1
- X# endif
- X# define bcopy(s,d,l) memcpy((d),(s),(l))
- X#ifdef __386BSD__
- X# define TERMIOS
- X# ifndef BSD
- X# define BSD
- X# endif
- X#endif
- X
- X# define bzero(cp,l) memset((cp),0,(l))
- X#endif
- X
- X#ifdef BSD
- X# ifndef __386BSD__
- X# ifndef SYSDIRH
- X# define SYSDIRH 1
- X# endif
- X# ifndef SGTTYB
- X# define SGTTYB
- X# endif
- X# endif
- X# ifndef SGTTYB
- X# define SGTTYB
- X# endif
- X# ifndef RINDEX
- X# define RINDEX 1
- X# endif
- X#endif
- X
- X/*
- X * Some systems besides System V don't use rindex/index (like SunOS).
- X * Add -DRINDEX to your SDEFS line if you need to.
- X */
- X#ifdef RINDEX
- X /* or #include <strings.h> if you have it. */
- X# define rindex strrchr
- X# define index strchr
- X#endif /* RINDEX */
- X
- X#ifdef SOCKS
- X#define Getsockname(d,a,l) Rgetsockname((d), (struct sockaddr *)(a), (l))
- X#else
- X#ifdef SYSV
- X# define Getsockname(d,a,l) getsockname((d), (void *)(a), (l))
- X#else
- X# define Getsockname(d,a,l) getsockname((d), (struct sockaddr *)(a), (l))
- X#endif
- X#endif
- X
- X#ifndef Select
- X# define Select(a,b,c,d,e) select((a), (b), (c), (d), (e))
- X#endif
- X
- X#ifdef GETPASS
- X# define Getpass getpass
- X#endif
- X
- X/* Enable connections through firewall gateways */
- X#ifndef GATEWAY
- X# define GATEWAY 1
- X#endif
- X
- X#ifdef _POSIX_SOURCE
- X# define TERMIOS
- X#endif
- X
- X#include <stdio.h>
- X#ifndef NO_STDLIBH
- X# include <stdlib.h>
- X#else
- Xextern void *malloc(size_t);
- Xextern void *calloc(size_t, size_t);
- Xextern void *malloc(size_t);
- Xextern void free(void *);
- Xextern void *realloc(void *, size_t);
- Xextern void exit(int);
- X
- X#ifdef NO_CONST
- Xextern char *getenv(char *);
- Xextern int atoi(char *);
- X#else
- Xextern char *getenv(const char *);
- Xextern int atoi(const char *);
- X#endif
- X
- X#endif /* NO_STDLIBH */
- X
- X#ifdef NO_UNISTDH
- Xchar *getlogin (void);
- X#ifdef NO_CONST
- Xextern char *getenv(char *);
- X#else
- Xextern char *getenv(const char *);
- X#endif
- X#endif /* NO_UNISTDH */
- X
- X#ifdef NO_STD_PROTOS
- X#include <sys/time.h>
- X#include <sys/types.h>
- X#include <sys/socket.h>
- X#include <time.h>
- Xextern int _filbuf(FILE *);
- Xextern int _flsbuf(int, FILE *);
- Xextern int fflush(FILE *);
- Xextern int fprintf(FILE *, char *, ...);
- Xextern int fputc(int, FILE *);
- Xextern int fputs(char *, FILE *);
- Xextern int fclose(FILE *);
- Xextern int pclose(FILE *);
- Xextern void perror(char *);
- Xextern int printf(char *, ...);
- Xextern int rewind(FILE *);
- Xextern int sscanf(char *, char *, ...);
- X
- Xextern char * mktemp(char *);
- Xextern int rename(char *, char *);
- X
- Xextern int gettimeofday(struct timeval *, struct timezone *);
- Xextern time_t mktime(struct tm *);
- Xextern int strftime(char *, int, char *, struct tm *);
- Xextern time_t time(time_t *);
- X
- Xextern int tolower(int);
- X
- X#ifndef bcopy
- Xextern void bcopy(char *, char *, size_t);
- X#endif
- X#ifndef bzero
- Xextern void bzero(char *, size_t);
- X#endif
- X
- X#ifdef SOCKS
- Xextern int Raccept(int, struct sockaddr *, int *);
- Xextern int Rbind(int, struct sockaddr *, int, unsigned long);
- Xextern int Rconnect(int, struct sockaddr *, int);
- Xextern int Rlisten(int, int);
- Xextern int Rgetsockname(int, struct sockaddr *, int *);
- X#else
- Xextern int accept(int, struct sockaddr *, int *);
- Xextern int bind(int, struct sockaddr *, int);
- Xextern int connect(int, struct sockaddr *, int);
- Xextern int listen(int, int);
- Xextern int getsockname(int, struct sockaddr *, int *);
- X#endif
- Xextern int gethostname(char *, int), getdomainname(char *, int);
- Xextern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
- Xextern int send(int, char *, int, int);
- Xextern int setsockopt(int, int, int, char *, int);
- Xextern int shutdown(int, int);
- Xextern int socket(int, int, int);
- X#endif /* NO_STD_PROTOS */
- X
- X/* eof sys.h */
- END_OF_FILE
- if test 7142 -ne `wc -c <'sys.h'`; then
- echo shar: \"'sys.h'\" unpacked with wrong size!
- fi
- # end of 'sys.h'
- fi
- if test -f 'tips.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tips.c'\"
- else
- echo shar: Extracting \"'tips.c'\" \(5050 characters\)
- sed "s/^X//" >'tips.c' <<'END_OF_FILE'
- X/* tips.c */
- X
- X/* $RCSfile: tips.c,v $
- X * $Revision: 14020.11 $
- X * $Date: 93/05/21 05:44:39 $
- X */
- X
- X#include "sys.h"
- X
- X#ifndef NO_TIPS
- X
- X#include "util.h"
- X#ifndef NO_UNISTDH
- X# include <unistd.h>
- X#endif
- X
- X/* Make sure that the indentations are spaces, not tabs.
- X * Try newform -i-4 < tips.c > tips.c.new
- X *
- X * Always add new tips right above the last one.
- X */
- X
- Xstatic char *tiplist[] = {
- X "Have you tried typing 'open' by itself lately?",
- X
- X "If you don't want a .ncrecent file in your home directory, put the \n\
- X command '#unset recent-list' in your .netrc/.ncftprc file.",
- X
- X "pseudo-filename-completion is supported in some commands. To use it,\n\
- X use a wildcard expression that will match exactly one file. I.e., if you\n\
- X want to fetch obnoxiouslylongfilename.zip, try 'get obn*.zip.' Note that\n\
- X you can't use the cd command with this feature (yet).",
- X
- X "You don't need to type the exact site name with open. If a site is in\n\
- X your .netrc/.ncftprc or the recent-list (.ncrecent), just type a unique\n\
- X abbreviation (substring really). I.e. 'open wuar' if you have the site\n\
- X wuarchive.wustl.edu in your rc or recent-list.",
- X
- X "You can put set commands in your .netrc/.ncftprc, by adding lines such\n\
- X as '#set local-dir /usr/tmp' to the file, which will be run at startup.",
- X
- X "Abuse the power of the .netrc! Put in entries for your favorite sites.\n\
- X Sample .netrc (or .ncftprc):\n\
- X #set pager \"less -M\"\n\
- X \n\
- X machine wuarchive.wustl.edu\n\
- X macdef init\n\
- X cd /pub\n\
- X get README\n\
- X dir\n\
- X (blank line to end macro)",
- X
- X "If you want to keep your .netrc's for ftp and ncftp separate, name\n\
- X ncftp's rc to .ncftprc.",
- X
- X "Type 'open' by itself to get a list of the sites in your recent-list and\n\
- X your .netrc. You can then supply '#5' at the prompt, or use 'open #5'\n\
- X later.",
- X
- X "Colon-mode is a quick way to get a file from your shell. Try something\n\
- X like 'ncftp wuarchive.wustl.edu:/pub/README.'",
- X
- X "The open command accepts several flags. Do a 'help open' for details.",
- X
- X "Sometimes a directory listing is several screens long and you won't\n\
- X remember the thing you wanted. Use the 'predir' command to re-view the\n\
- X listing. The program keeps the copy locally, so you won't have to wait\n\
- X for the remote server to re-send it to you.",
- X
- X "Use the 'page' (or 'more') command to view a remote file with your pager.",
- X
- X "ncftp may be keeping detailed information on everything you transfer.\n\
- X Run the 'version' command and if you see SYSLOG, your actions are being\n\
- X recorded on the system log.",
- X
- X "Try the 'redir' command to re-display the last directory listing (ls,\n\
- X dir, ls -lrt, etc). 'predir' does the same, only with your pager.",
- X
- X "This program is pronounced Nik-F-T-P. NCEMRSoft is Nik'-mer-soft.",
- X
- X "Never pick Nebraska to win a big game.",
- X
- X#ifdef GETLINE
- X "NcFTP was compiled with the Getline command-line/history editor! (by\n\
- X Chris Thewalt <thewalt@ce.berkeley.edu>). To activate it, use the up\n\
- X and down arrows to scroll through the history, and/or use EMACS-style\n\
- X commands to edit the line.",
- X#endif
- X
- X#ifdef READLINE
- X "NcFTP was compiled with the GNU Readline command-line/history editor!\n\
- X To activate it, use the up & down arrows to scroll through the history,\n\
- X and/or use EMACS-style (or maybe VI-style) commands to edit the line.",
- X#endif
- X
- X "You can get the newest version of NcFTP from cse.unl.edu, in the\n\
- X /pub/mgleason directory.",
- X
- X "The type of progress-meter that will be used depends if the remote host\n\
- X supports the SIZE command, and whether your terminal is capable of ANSI\n\
- X escape codes.",
- X
- X "To report a bug, mail your message to mgleason@cse.unl.edu. Include the\n\
- X output of the 'version' command in your message. An easy way to do that\n\
- X is to compose your message, then do a 'ncftp -H >> msg.'",
- X
- X "Sick and tired of these tips? Put '#unset tips' in your .netrc/.ncftprc."
- X};
- X
- X/* Not another dinky header, por favor. */
- X#define NTIPS ((int) (sizeof(tiplist) / sizeof(char *)))
- Xvoid PrintTip(void);
- Xextern int fromatty, debug;
- X
- Xint tips = 1;
- X#endif /* NO_TIPS */
- X
- Xvoid PrintTip(void)
- X{
- X#ifndef NO_TIPS
- X int cheap_rn, i, tn;
- X string str;
- X
- X if (tips && fromatty) {
- X cheap_rn = (int) getpid() % NTIPS;
- X if (debug) {
- X (void) printf("pid: %d; ntips: %d\n", getpid(), NTIPS);
- X (void) Gets("*** Tip# (-1 == all): ", str, sizeof(str));
- X tn = atoi(str) - 1;
- X if (tn == -1)
- X tn = 0;
- X if (tn < -1)
- X for(i=0; i<NTIPS; i++)
- X (void) printf("Tip: %s\n", tiplist[i]);
- X else if (tn < NTIPS)
- X (void) printf("Tip: %s\n", tiplist[tn]);
- X } else
- X (void) printf("Tip: %s\n", tiplist[cheap_rn]);
- X }
- X#endif /* NO_TIPS */
- X} /* PrintTip */
- X
- X/* tips.c */
- END_OF_FILE
- if test 5050 -ne `wc -c <'tips.c'`; then
- echo shar: \"'tips.c'\" unpacked with wrong size!
- fi
- # end of 'tips.c'
- fi
- if test -f 'util.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'util.h'\"
- else
- echo shar: Extracting \"'util.h'\" \(2072 characters\)
- sed "s/^X//" >'util.h' <<'END_OF_FILE'
- X/* Util.h */
- X
- X#ifndef _util_h_
- X#define _util_h_
- X
- X/* $RCSfile: util.h,v $
- X * $Revision: 14020.12 $
- X * $Date: 93/07/09 11:32:49 $
- X */
- X
- Xtypedef char string[128], str32[32], longstring[512];
- Xtypedef char Hostname[64];
- X
- X/* For Perror. */
- X#ifdef DB_ERRS
- X# ifdef __LINE__
- X# define PERROR(p,e) Perror(p, __LINE__, e)
- X void Perror(char *, int, char *);
- X# else
- X# define PERROR(p,e) Perror(p, e)
- X void Perror(char *, char *);
- X# endif
- X#else
- X# define PERROR(p,e) Perror(e)
- X void Perror(char *);
- X#endif
- X
- X#ifdef NO_VARARGS
- X# define dbprintf if (debug) (void) printf
- X#else
- X# ifndef DB_STREAM
- X# define DB_STREAM stdout
- X# endif
- X void dbprintf(char *fmt, ...);
- X#endif
- X
- X/* For 'Getopt.' */
- X#define BADCH ((int)'?')
- X#define EMSG ""
- X
- X/* Handy macros. */
- X#define Strncpy(d,s) _Strncpy((char *) (d), (char *) (s), (size_t) sizeof(d))
- X#define Strncat(d,s) _Strncat((char *) (d), (char *) (s), (size_t) sizeof(d))
- X#define FGets(a,b) fgets((a), (int) (sizeof(a) - 2), (b))
- X
- X#ifndef NO_CONST
- Xtypedef int (*cmp_t)(const void *, const void *);
- X#else
- Xtypedef int (*cmp_t)(void *, void *);
- X#endif
- X
- X#define QSort(base,n,sz,cmp) \
- X qsort(base, (size_t)(n), (size_t)(sz), (cmp_t)(cmp))
- X
- X#ifndef SIG_PARAMS
- X#define SIG_PARAMS (int sig)
- X#endif
- Xtypedef void (*sig_t) SIG_PARAMS;
- X
- X#define Signal(a,proc) signal((a), (sig_t)(proc))
- X
- X/* Protos. */
- Xchar *_Strncat(char *dst, char *src, register size_t n);
- Xchar *_Strncpy(char *dst, char *src, register size_t n);
- Xchar *NewString(char *oldstr);
- Xchar **re_makeargv(char *promptstr, int *argc);
- Xchar *onoff(int);
- Xint StrToBool(char *s);
- Xint confirm(char *cmd, char *file);
- Xvoid fatal(char *msg);
- Xchar *get_cwd(char *buf, int size);
- Xint tmp_name(char *str);
- Xint Getopt(int argc, char **argv, char *opstring);
- Xvoid Getopt_Reset(void);
- Xchar *Gets(char *promptstr, char *sline, size_t size);
- Xsize_t RemoveTrailingNewline(char *cp, int *stripped);
- Xunsigned long UnLSDate(char *dstr);
- Xchar *Strpcpy(char *dst, char *src);
- Xint UserLoggedIn(void);
- Xchar *LocalPath(char *path);
- Xchar *LocalDotPath(char *path);
- Xchar *GetHomeDir(char *home);
- X
- X#endif /* _util_h_ */
- END_OF_FILE
- if test 2072 -ne `wc -c <'util.h'`; then
- echo shar: \"'util.h'\" unpacked with wrong size!
- fi
- # end of 'util.h'
- fi
- if test -f 'v2_Note' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'v2_Note'\"
- else
- echo shar: Extracting \"'v2_Note'\" \(2712 characters\)
- sed "s/^X//" >'v2_Note' <<'END_OF_FILE'
- XVersion 1.5 of NcFTP is an interim release. Version 2.0 is much cooler,
- Xbut it wasn't ready to go by my self-imposed deadline of September 1, 1993.
- XThe reason for that deadline is that my senior year will be getting under
- Xway, and I don't want to work on the program during that period. Last year
- XI spent too much time on NcFTP and other projects, and not enough time on
- Xstudies. As a result, my grades slipped a bit. Therefore I will be
- Xstudying more and programming, reading news, and reading email less. If
- Xyou send me email, I _will_ read it, but it may take me awhile to get to it,
- Xand I may not answer. Please don't be offended. I really regret having
- Xto release code that is such a mess. I should have wrote the code from
- Xscratch, rather than build it upon the original BSD code (which is a mess
- Xitself!).
- X
- XThis version is based on the betas of 1.4. 1.4 was almost finished when
- XI decided to add some significant features, and clean up the code so it
- Xis better organized and easier to read. That version is called 2.0, and
- Xisn't finished yet. The innards are totally different from that of 1.4
- X(and 1.5), so patches to 1.5 won't work at all on 2.0. During the process
- Xof adding stuff and cleaning up, a couple of bugs creeped in that will
- Xtake time to resolve. Maybe I can work on it during Christmas break.
- X
- XI apologize in advance for bugs I fixed in 2.0 but forgot to re-fix
- Xin 1.5 (I think I got'em all, though).
- X
- XHere is a list of things that are in the 2.0 code but not this version:
- X
- X* Easy-to-read, better organized, commented code.
- X* Using my own "style guide," so source is coded uniformly.
- X* Unlimited global macros. These are really nice! They take arguments,
- X so you can make mini-scripts. The macros can be typed as if they
- X were commands; no more $macroname crap.
- X* No-longer using .netrc and it's format. This was necessary for the
- X global macros anyway, and it allowed me to add some other features,
- X like host aliases. Old .netrc's won't work. Sorry!
- X* Improved command line parser, that lets any command use > and |, so
- X it behaves like a real shell command line (almost).
- X* Improved 'redir' that works automatically, can reformat listings with
- X different ls flags, all without refetching it over the network. It
- X will also facilitate remote globbing... AND remote filename completion!
- X* Many little things I can't begin to list.
- X
- XKeep that in mind if you want to make a feature enhancement. I'm telling
- Xyou this now so you don't spend your time programming something that is
- Xalready done for the 2.0 release. Also note that patches for 1.5 will
- Xhave to be re-coded for 2.0. (The gist is that you should wait until
- X2.0 is done before doing anything major).
- END_OF_FILE
- if test 2712 -ne `wc -c <'v2_Note'`; then
- echo shar: \"'v2_Note'\" unpacked with wrong size!
- fi
- # end of 'v2_Note'
- fi
- echo shar: End of archive 5 \(of 5\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-