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