xref: /csrg-svn/usr.bin/ftp/ftp_var.h (revision 26049)
121741Sdist /*
2*26049Sminshall  * 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*26049Sminshall  *	@(#)ftp_var.h	5.2 (Berkeley) 02/03/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 */
27*26049Sminshall int	proxy;			/* proxy server connection active */
28*26049Sminshall int	proxflag;		/* proxy connection exists */
29*26049Sminshall int	sunique;		/* store files on server with unique name */
30*26049Sminshall int	runique;		/* store local files with unique name */
31*26049Sminshall int	mcase;			/* map upper to lower case for mget names */
32*26049Sminshall int	ntflag;			/* use ntin ntout tables for name translation */
33*26049Sminshall int	mapflag;		/* use mapin mapout templates on file names */
34*26049Sminshall int	code;			/* return/reply code for ftp command */
35*26049Sminshall int	macroflg;		/* active macro */
36*26049Sminshall int	crflag;			/* if 1, strip car. rets. on ascii gets */
37*26049Sminshall char	pasv[64];		/* passive port for proxy data connection */
38*26049Sminshall char	*altarg;		/* argv[1] with no shell-like preprocessing  */
39*26049Sminshall char	ntin[17];		/* input translation table */
40*26049Sminshall char	ntout[17];		/* output translation table */
41*26049Sminshall #include <sys/param.h>
42*26049Sminshall char	mapin[MAXPATHLEN];	/* input map template */
43*26049Sminshall char	mapout[MAXPATHLEN];	/* output map template */
4410298Ssam char	typename[32];		/* name of file transfer type */
4510298Ssam int	type;			/* file transfer type */
4610298Ssam char	structname[32];		/* name of file transfer structure */
4710298Ssam int	stru;			/* file transfer structure */
4810298Ssam char	formname[32];		/* name of file transfer format */
4910298Ssam int	form;			/* file transfer format */
5010298Ssam char	modename[32];		/* name of file transfer mode */
5110298Ssam int	mode;			/* file transfer mode */
5211220Ssam char	bytename[32];		/* local byte size in ascii */
5311220Ssam int	bytesize;		/* local byte size in binary */
5410298Ssam 
5510298Ssam char	*hostname;		/* name of host connected to */
5610298Ssam 
5710298Ssam struct	servent *sp;		/* service spec for tcp/ftp */
5810298Ssam 
5910298Ssam #include <setjmp.h>
6010298Ssam jmp_buf	toplevel;		/* non-local goto stuff for cmd scanner */
6110298Ssam 
6210298Ssam char	line[200];		/* input line buffer */
6310298Ssam char	*stringbase;		/* current scan point in line buffer */
6410298Ssam char	argbuf[200];		/* argument storage buffer */
6510298Ssam char	*argbase;		/* current storage point in arg buffer */
6610298Ssam int	margc;			/* count of arguments on input line */
6710298Ssam char	*margv[20];		/* args parsed from input line */
68*26049Sminshall int     cpend;                  /* flag: if != 0, then pending server reply */
69*26049Sminshall int	mflag;			/* flag: if != 0, then active multi command */
7010298Ssam 
7110298Ssam int	options;		/* used during socket creation */
7210298Ssam 
7310298Ssam /*
7410298Ssam  * Format of command table.
7510298Ssam  */
7610298Ssam struct cmd {
7710298Ssam 	char	*c_name;	/* name of command */
7810298Ssam 	char	*c_help;	/* help string */
7910298Ssam 	char	c_bell;		/* give bell when command completes */
8011652Ssam 	char	c_conn;		/* must be connected to use command */
81*26049Sminshall 	char	c_proxy;	/* proxy server may execute */
8210298Ssam 	int	(*c_handler)();	/* function to call */
8310298Ssam };
8410298Ssam 
85*26049Sminshall struct macel {
86*26049Sminshall 	char mac_name[9];	/* macro name */
87*26049Sminshall 	char *mac_start;	/* start of macro in macbuf */
88*26049Sminshall 	char *mac_end;		/* end of macro in macbuf */
89*26049Sminshall };
90*26049Sminshall 
91*26049Sminshall int macnum;			/* number of defined macros */
92*26049Sminshall struct macel macros[16], *macpt;
93*26049Sminshall char macbuf[4096];
94*26049Sminshall 
9510298Ssam extern	char *tail();
9610298Ssam extern	char *index();
9710298Ssam extern	char *rindex();
9811652Ssam extern	char *remglob();
9910298Ssam extern	int errno;
100