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