xref: /csrg-svn/usr.bin/ftp/ftp_var.h (revision 26497)
121741Sdist /*
226049Sminshall  * Copyright (c) 1985 Regents of the University of California.
321741Sdist  * All rights reserved.  The Berkeley software License Agreement
421741Sdist  * specifies the terms and conditions for redistribution.
521741Sdist  *
6*26497Sminshall  *	@(#)ftp_var.h	5.3 (Berkeley) 03/07/86
721741Sdist  */
810298Ssam 
910298Ssam /*
1010298Ssam  * FTP global variables.
1110298Ssam  */
1210298Ssam 
1310298Ssam /*
1410298Ssam  * Options and other state info.
1510298Ssam  */
1610298Ssam int	trace;			/* trace packets exchanged */
1711652Ssam int	hash;			/* print # for each buffer transferred */
1811652Ssam int	sendport;		/* use PORT cmd for each data connection */
1910298Ssam int	verbose;		/* print messages coming back from server */
2010298Ssam int	connected;		/* connected to server */
2110298Ssam int	fromatty;		/* input is from a terminal */
2210298Ssam int	interactive;		/* interactively prompt on m* cmds */
2310298Ssam int	debug;			/* debugging level */
2410298Ssam int	bell;			/* ring bell on cmd completion */
2511349Ssam int	doglob;			/* glob local file names */
2610298Ssam int	autologin;		/* establish user account on connection */
2726049Sminshall int	proxy;			/* proxy server connection active */
2826049Sminshall int	proxflag;		/* proxy connection exists */
2926049Sminshall int	sunique;		/* store files on server with unique name */
3026049Sminshall int	runique;		/* store local files with unique name */
3126049Sminshall int	mcase;			/* map upper to lower case for mget names */
3226049Sminshall int	ntflag;			/* use ntin ntout tables for name translation */
3326049Sminshall int	mapflag;		/* use mapin mapout templates on file names */
3426049Sminshall int	code;			/* return/reply code for ftp command */
3526049Sminshall int	crflag;			/* if 1, strip car. rets. on ascii gets */
3626049Sminshall char	pasv[64];		/* passive port for proxy data connection */
3726049Sminshall char	*altarg;		/* argv[1] with no shell-like preprocessing  */
3826049Sminshall char	ntin[17];		/* input translation table */
3926049Sminshall char	ntout[17];		/* output translation table */
4026049Sminshall #include <sys/param.h>
4126049Sminshall char	mapin[MAXPATHLEN];	/* input map template */
4226049Sminshall char	mapout[MAXPATHLEN];	/* output map template */
4310298Ssam char	typename[32];		/* name of file transfer type */
4410298Ssam int	type;			/* file transfer type */
4510298Ssam char	structname[32];		/* name of file transfer structure */
4610298Ssam int	stru;			/* file transfer structure */
4710298Ssam char	formname[32];		/* name of file transfer format */
4810298Ssam int	form;			/* file transfer format */
4910298Ssam char	modename[32];		/* name of file transfer mode */
5010298Ssam int	mode;			/* file transfer mode */
5111220Ssam char	bytename[32];		/* local byte size in ascii */
5211220Ssam int	bytesize;		/* local byte size in binary */
5310298Ssam 
5410298Ssam char	*hostname;		/* name of host connected to */
5510298Ssam 
5610298Ssam struct	servent *sp;		/* service spec for tcp/ftp */
5710298Ssam 
5810298Ssam #include <setjmp.h>
5910298Ssam jmp_buf	toplevel;		/* non-local goto stuff for cmd scanner */
6010298Ssam 
6110298Ssam char	line[200];		/* input line buffer */
6210298Ssam char	*stringbase;		/* current scan point in line buffer */
6310298Ssam char	argbuf[200];		/* argument storage buffer */
6410298Ssam char	*argbase;		/* current storage point in arg buffer */
6510298Ssam int	margc;			/* count of arguments on input line */
6610298Ssam char	*margv[20];		/* args parsed from input line */
6726049Sminshall int     cpend;                  /* flag: if != 0, then pending server reply */
6826049Sminshall int	mflag;			/* flag: if != 0, then active multi command */
6910298Ssam 
7010298Ssam int	options;		/* used during socket creation */
7110298Ssam 
7210298Ssam /*
7310298Ssam  * Format of command table.
7410298Ssam  */
7510298Ssam struct cmd {
7610298Ssam 	char	*c_name;	/* name of command */
7710298Ssam 	char	*c_help;	/* help string */
7810298Ssam 	char	c_bell;		/* give bell when command completes */
7911652Ssam 	char	c_conn;		/* must be connected to use command */
8026049Sminshall 	char	c_proxy;	/* proxy server may execute */
8110298Ssam 	int	(*c_handler)();	/* function to call */
8210298Ssam };
8310298Ssam 
8426049Sminshall struct macel {
8526049Sminshall 	char mac_name[9];	/* macro name */
8626049Sminshall 	char *mac_start;	/* start of macro in macbuf */
8726049Sminshall 	char *mac_end;		/* end of macro in macbuf */
8826049Sminshall };
8926049Sminshall 
9026049Sminshall int macnum;			/* number of defined macros */
91*26497Sminshall struct macel macros[16];
9226049Sminshall char macbuf[4096];
9326049Sminshall 
9410298Ssam extern	char *tail();
9510298Ssam extern	char *index();
9610298Ssam extern	char *rindex();
9711652Ssam extern	char *remglob();
9810298Ssam extern	int errno;
99*26497Sminshall extern	char *mktemp();
100*26497Sminshall extern	char *strncpy();
101*26497Sminshall extern	char *strncat();
102*26497Sminshall extern	char *strcat();
103*26497Sminshall extern	char *strcpy();
104