xref: /csrg-svn/usr.bin/ftp/ftp_var.h (revision 34901)
121741Sdist /*
226049Sminshall  * Copyright (c) 1985 Regents of the University of California.
333737Sbostic  * All rights reserved.
421741Sdist  *
533737Sbostic  * Redistribution and use in source and binary forms are permitted
6*34901Sbostic  * provided that the above copyright notice and this paragraph are
7*34901Sbostic  * duplicated in all such forms and that any documentation,
8*34901Sbostic  * advertising materials, and other materials related to such
9*34901Sbostic  * distribution and use acknowledge that the software was developed
10*34901Sbostic  * by the University of California, Berkeley.  The name of the
11*34901Sbostic  * University may not be used to endorse or promote products derived
12*34901Sbostic  * from this software without specific prior written permission.
13*34901Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34901Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34901Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1633737Sbostic  *
17*34901Sbostic  *	@(#)ftp_var.h	5.5 (Berkeley) 06/29/88
1821741Sdist  */
1910298Ssam 
2010298Ssam /*
2110298Ssam  * FTP global variables.
2210298Ssam  */
2310298Ssam 
2410298Ssam /*
2510298Ssam  * Options and other state info.
2610298Ssam  */
2710298Ssam int	trace;			/* trace packets exchanged */
2811652Ssam int	hash;			/* print # for each buffer transferred */
2911652Ssam int	sendport;		/* use PORT cmd for each data connection */
3010298Ssam int	verbose;		/* print messages coming back from server */
3110298Ssam int	connected;		/* connected to server */
3210298Ssam int	fromatty;		/* input is from a terminal */
3310298Ssam int	interactive;		/* interactively prompt on m* cmds */
3410298Ssam int	debug;			/* debugging level */
3510298Ssam int	bell;			/* ring bell on cmd completion */
3611349Ssam int	doglob;			/* glob local file names */
3710298Ssam int	autologin;		/* establish user account on connection */
3826049Sminshall int	proxy;			/* proxy server connection active */
3926049Sminshall int	proxflag;		/* proxy connection exists */
4026049Sminshall int	sunique;		/* store files on server with unique name */
4126049Sminshall int	runique;		/* store local files with unique name */
4226049Sminshall int	mcase;			/* map upper to lower case for mget names */
4326049Sminshall int	ntflag;			/* use ntin ntout tables for name translation */
4426049Sminshall int	mapflag;		/* use mapin mapout templates on file names */
4526049Sminshall int	code;			/* return/reply code for ftp command */
4626049Sminshall int	crflag;			/* if 1, strip car. rets. on ascii gets */
4726049Sminshall char	pasv[64];		/* passive port for proxy data connection */
4826049Sminshall char	*altarg;		/* argv[1] with no shell-like preprocessing  */
4926049Sminshall char	ntin[17];		/* input translation table */
5026049Sminshall char	ntout[17];		/* output translation table */
5126049Sminshall #include <sys/param.h>
5226049Sminshall char	mapin[MAXPATHLEN];	/* input map template */
5326049Sminshall char	mapout[MAXPATHLEN];	/* output map template */
5410298Ssam char	typename[32];		/* name of file transfer type */
5510298Ssam int	type;			/* file transfer type */
5610298Ssam char	structname[32];		/* name of file transfer structure */
5710298Ssam int	stru;			/* file transfer structure */
5810298Ssam char	formname[32];		/* name of file transfer format */
5910298Ssam int	form;			/* file transfer format */
6010298Ssam char	modename[32];		/* name of file transfer mode */
6110298Ssam int	mode;			/* file transfer mode */
6211220Ssam char	bytename[32];		/* local byte size in ascii */
6311220Ssam int	bytesize;		/* local byte size in binary */
6410298Ssam 
6510298Ssam char	*hostname;		/* name of host connected to */
6610298Ssam 
6710298Ssam struct	servent *sp;		/* service spec for tcp/ftp */
6810298Ssam 
6910298Ssam #include <setjmp.h>
7010298Ssam jmp_buf	toplevel;		/* non-local goto stuff for cmd scanner */
7110298Ssam 
7210298Ssam char	line[200];		/* input line buffer */
7310298Ssam char	*stringbase;		/* current scan point in line buffer */
7410298Ssam char	argbuf[200];		/* argument storage buffer */
7510298Ssam char	*argbase;		/* current storage point in arg buffer */
7610298Ssam int	margc;			/* count of arguments on input line */
7710298Ssam char	*margv[20];		/* args parsed from input line */
7826049Sminshall int     cpend;                  /* flag: if != 0, then pending server reply */
7926049Sminshall int	mflag;			/* flag: if != 0, then active multi command */
8010298Ssam 
8110298Ssam int	options;		/* used during socket creation */
8210298Ssam 
8310298Ssam /*
8410298Ssam  * Format of command table.
8510298Ssam  */
8610298Ssam struct cmd {
8710298Ssam 	char	*c_name;	/* name of command */
8810298Ssam 	char	*c_help;	/* help string */
8910298Ssam 	char	c_bell;		/* give bell when command completes */
9011652Ssam 	char	c_conn;		/* must be connected to use command */
9126049Sminshall 	char	c_proxy;	/* proxy server may execute */
9210298Ssam 	int	(*c_handler)();	/* function to call */
9310298Ssam };
9410298Ssam 
9526049Sminshall struct macel {
9626049Sminshall 	char mac_name[9];	/* macro name */
9726049Sminshall 	char *mac_start;	/* start of macro in macbuf */
9826049Sminshall 	char *mac_end;		/* end of macro in macbuf */
9926049Sminshall };
10026049Sminshall 
10126049Sminshall int macnum;			/* number of defined macros */
10226497Sminshall struct macel macros[16];
10326049Sminshall char macbuf[4096];
10426049Sminshall 
10510298Ssam extern	char *tail();
10610298Ssam extern	char *index();
10710298Ssam extern	char *rindex();
10811652Ssam extern	char *remglob();
10910298Ssam extern	int errno;
11026497Sminshall extern	char *mktemp();
11126497Sminshall extern	char *strncpy();
11226497Sminshall extern	char *strncat();
11326497Sminshall extern	char *strcat();
11426497Sminshall extern	char *strcpy();
115