xref: /csrg-svn/usr.bin/ftp/ftp_var.h (revision 21741)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)ftp_var.h	5.1 (Berkeley) 05/31/85
7  */
8 
9 /*
10  * FTP global variables.
11  */
12 
13 /*
14  * Options and other state info.
15  */
16 int	trace;			/* trace packets exchanged */
17 int	hash;			/* print # for each buffer transferred */
18 int	sendport;		/* use PORT cmd for each data connection */
19 int	verbose;		/* print messages coming back from server */
20 int	connected;		/* connected to server */
21 int	fromatty;		/* input is from a terminal */
22 int	interactive;		/* interactively prompt on m* cmds */
23 int	debug;			/* debugging level */
24 int	bell;			/* ring bell on cmd completion */
25 int	doglob;			/* glob local file names */
26 int	autologin;		/* establish user account on connection */
27 
28 char	typename[32];		/* name of file transfer type */
29 int	type;			/* file transfer type */
30 char	structname[32];		/* name of file transfer structure */
31 int	stru;			/* file transfer structure */
32 char	formname[32];		/* name of file transfer format */
33 int	form;			/* file transfer format */
34 char	modename[32];		/* name of file transfer mode */
35 int	mode;			/* file transfer mode */
36 char	bytename[32];		/* local byte size in ascii */
37 int	bytesize;		/* local byte size in binary */
38 
39 char	*hostname;		/* name of host connected to */
40 
41 struct	servent *sp;		/* service spec for tcp/ftp */
42 
43 #include <setjmp.h>
44 jmp_buf	toplevel;		/* non-local goto stuff for cmd scanner */
45 
46 char	line[200];		/* input line buffer */
47 char	*stringbase;		/* current scan point in line buffer */
48 char	argbuf[200];		/* argument storage buffer */
49 char	*argbase;		/* current storage point in arg buffer */
50 int	margc;			/* count of arguments on input line */
51 char	*margv[20];		/* args parsed from input line */
52 
53 int	options;		/* used during socket creation */
54 
55 /*
56  * Format of command table.
57  */
58 struct cmd {
59 	char	*c_name;	/* name of command */
60 	char	*c_help;	/* help string */
61 	char	c_bell;		/* give bell when command completes */
62 	char	c_conn;		/* must be connected to use command */
63 	int	(*c_handler)();	/* function to call */
64 };
65 
66 extern	char *tail();
67 extern	char *index();
68 extern	char *rindex();
69 extern	char *remglob();
70 extern	int errno;
71