new copyright notice
[unix-history] / usr / src / usr.bin / ftp / ftp_var.h
CommitLineData
edf71f48 1/*
dcd54a7f 2 * Copyright (c) 1985, 1989 Regents of the University of California.
11c5f0a3 3 * All rights reserved.
edf71f48 4 *
1343342a 5 * %sccs.include.redist.c%
11c5f0a3 6 *
1343342a 7 * @(#)ftp_var.h 5.9 (Berkeley) %G%
edf71f48 8 */
88648cc6
SL
9
10/*
11 * FTP global variables.
12 */
13
14/*
15 * Options and other state info.
16 */
17int trace; /* trace packets exchanged */
5ac6fc46
SL
18int hash; /* print # for each buffer transferred */
19int sendport; /* use PORT cmd for each data connection */
88648cc6
SL
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 */
faf9f493 26int doglob; /* glob local file names */
88648cc6 27int autologin; /* establish user account on connection */
9069f68e
GM
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 */
9069f68e
GM
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 */
88648cc6 44char typename[32]; /* name of file transfer type */
dcd54a7f
MK
45int type; /* requested file transfer type */
46int curtype; /* current file transfer type */
88648cc6
SL
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 */
d33c618b
SL
53char bytename[32]; /* local byte size in ascii */
54int bytesize; /* local byte size in binary */
88648cc6
SL
55
56char *hostname; /* name of host connected to */
dcd54a7f
MK
57int unix_server; /* server is unix, can use binary for ascii */
58int unix_proxy; /* proxy is unix, can use binary for ascii */
88648cc6
SL
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 */
9069f68e
GM
71int cpend; /* flag: if != 0, then pending server reply */
72int mflag; /* flag: if != 0, then active multi command */
88648cc6
SL
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 */
5ac6fc46 83 char c_conn; /* must be connected to use command */
9069f68e 84 char c_proxy; /* proxy server may execute */
88648cc6
SL
85 int (*c_handler)(); /* function to call */
86};
87
9069f68e
GM
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 */
04480325 95struct macel macros[16];
9069f68e
GM
96char macbuf[4096];
97
88648cc6
SL
98extern char *tail();
99extern char *index();
100extern char *rindex();
5ac6fc46 101extern char *remglob();
88648cc6 102extern int errno;
04480325
GM
103extern char *mktemp();
104extern char *strncpy();
105extern char *strncat();
106extern char *strcat();
107extern char *strcpy();