new copyright notice
[unix-history] / usr / src / usr.bin / ftp / ftp_var.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 1985, 1989 Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 * @(#)ftp_var.h 5.9 (Berkeley) %G%
8 */
9
10/*
11 * FTP global variables.
12 */
13
14/*
15 * Options and other state info.
16 */
17int trace; /* trace packets exchanged */
18int hash; /* print # for each buffer transferred */
19int sendport; /* use PORT cmd for each data connection */
20int verbose; /* print messages coming back from server */
21int connected; /* connected to server */
22int fromatty; /* input is from a terminal */
23int interactive; /* interactively prompt on m* cmds */
24int debug; /* debugging level */
25int bell; /* ring bell on cmd completion */
26int doglob; /* glob local file names */
27int autologin; /* establish user account on connection */
28int proxy; /* proxy server connection active */
29int proxflag; /* proxy connection exists */
30int sunique; /* store files on server with unique name */
31int runique; /* store local files with unique name */
32int mcase; /* map upper to lower case for mget names */
33int ntflag; /* use ntin ntout tables for name translation */
34int mapflag; /* use mapin mapout templates on file names */
35int code; /* return/reply code for ftp command */
36int crflag; /* if 1, strip car. rets. on ascii gets */
37char pasv[64]; /* passive port for proxy data connection */
38char *altarg; /* argv[1] with no shell-like preprocessing */
39char ntin[17]; /* input translation table */
40char ntout[17]; /* output translation table */
41#include <sys/param.h>
42char mapin[MAXPATHLEN]; /* input map template */
43char mapout[MAXPATHLEN]; /* output map template */
44char typename[32]; /* name of file transfer type */
45int type; /* requested file transfer type */
46int curtype; /* current file transfer type */
47char structname[32]; /* name of file transfer structure */
48int stru; /* file transfer structure */
49char formname[32]; /* name of file transfer format */
50int form; /* file transfer format */
51char modename[32]; /* name of file transfer mode */
52int mode; /* file transfer mode */
53char bytename[32]; /* local byte size in ascii */
54int bytesize; /* local byte size in binary */
55
56char *hostname; /* name of host connected to */
57int unix_server; /* server is unix, can use binary for ascii */
58int unix_proxy; /* proxy is unix, can use binary for ascii */
59
60struct servent *sp; /* service spec for tcp/ftp */
61
62#include <setjmp.h>
63jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
64
65char line[200]; /* input line buffer */
66char *stringbase; /* current scan point in line buffer */
67char argbuf[200]; /* argument storage buffer */
68char *argbase; /* current storage point in arg buffer */
69int margc; /* count of arguments on input line */
70char *margv[20]; /* args parsed from input line */
71int cpend; /* flag: if != 0, then pending server reply */
72int mflag; /* flag: if != 0, then active multi command */
73
74int options; /* used during socket creation */
75
76/*
77 * Format of command table.
78 */
79struct cmd {
80 char *c_name; /* name of command */
81 char *c_help; /* help string */
82 char c_bell; /* give bell when command completes */
83 char c_conn; /* must be connected to use command */
84 char c_proxy; /* proxy server may execute */
85 int (*c_handler)(); /* function to call */
86};
87
88struct macel {
89 char mac_name[9]; /* macro name */
90 char *mac_start; /* start of macro in macbuf */
91 char *mac_end; /* end of macro in macbuf */
92};
93
94int macnum; /* number of defined macros */
95struct macel macros[16];
96char macbuf[4096];
97
98extern char *tail();
99extern char *index();
100extern char *rindex();
101extern char *remglob();
102extern int errno;
103extern char *mktemp();
104extern char *strncpy();
105extern char *strncat();
106extern char *strcat();
107extern char *strcpy();