[NTDLL]
[reactos.git] / base / applications / network / ftp / ftp_var.h
1 #include <winsock.h>
2 #include "fake.h"
3 #include "prototypes.h"
4 #include <setjmp.h>
5 #include <time.h>
6
7 //typedef void (*Sig_t)(int);
8
9 /* The following defines are from ftp.h and telnet.h from bsd.h */
10 /* All relevent copyrights below apply. */
11
12 #define IAC 255
13 #define DONT 254
14 #define DO 253
15 #define WONT 252
16 #define WILL 251
17 #define SB 250
18 #define GA 249
19 #define EL 248
20 #define EC 247
21 #define AYT 246
22 #define AO 245
23 #define IP 244
24 #define BREAK 243
25 #define DM 242
26 #define NOP 241
27 #define SE 240
28 #define EOR 239
29 #define ABORT 238
30 #define SUSP 237
31 #define xEOF 236
32
33
34 #define MAXPATHLEN 255
35 #define TYPE_A 'A'
36 #define TYPE_I 'I'
37 #define TYPE_E 'E'
38 #define TYPE_L 'L'
39
40 #define PRELIM 1
41 #define COMPLETE 2
42 #define CONTINUE 3
43 #define TRANSIENT 4
44
45 #define MODE_S 1
46 #define MODE_B 2
47 #define MODE_C 3
48
49 #define STRU_F 1
50 #define STRU_R 2
51 #define STRU_P 3
52
53 #define FORM_N 1
54 #define FORM_T 2
55 #define FORM_C 3
56
57
58 /*
59 * Copyright (c) 1985 Regents of the University of California.
60 * All rights reserved.
61 *
62 * Redistribution and use in source and binary forms are permitted
63 * provided that the above copyright notice and this paragraph are
64 * duplicated in all such forms and that any documentation,
65 * advertising materials, and other materials related to such
66 * distribution and use acknowledge that the software was developed
67 * by the University of California, Berkeley. The name of the
68 * University may not be used to endorse or promote products derived
69 * from this software without specific prior written permission.
70 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
71 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
72 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
73 *
74 * @(#)ftp_var.h 5.5 (Berkeley) 6/29/88
75 */
76
77 /*
78 * FTP global variables.
79 */
80
81 /*
82 * Options and other state info.
83 */
84 extern int trace; /* trace packets exchanged */
85 extern int hash; /* print # for each buffer transferred */
86 extern int sendport; /* use PORT cmd for each data connection */
87 extern int verbose; /* print messages coming back from server */
88 extern int connected; /* connected to server */
89 extern int fromatty; /* input is from a terminal */
90 extern int interactive; /* interactively prompt on m* cmds */
91 extern int debug; /* debugging level */
92 extern int bell; /* ring bell on cmd completion */
93 extern int doglob; /* glob local file names */
94 extern int proxy; /* proxy server connection active */
95 extern int proxflag; /* proxy connection exists */
96 extern int sunique; /* store files on server with unique name */
97 extern int runique; /* store local files with unique name */
98 extern int mcase; /* map upper to lower case for mget names */
99 extern int ntflag; /* use ntin ntout tables for name translation */
100 extern int mapflag; /* use mapin mapout templates on file names */
101 extern int code; /* return/reply code for ftp command */
102 extern int crflag; /* if 1, strip car. rets. on ascii gets */
103 extern char pasv[64]; /* passive port for proxy data connection */
104 extern int passivemode; /* passive mode enabled */
105 extern char *altarg; /* argv[1] with no shell-like preprocessing */
106 extern char ntin[17]; /* input translation table */
107 extern char ntout[17]; /* output translation table */
108
109 extern char mapin[MAXPATHLEN]; /* input map template */
110 extern char mapout[MAXPATHLEN]; /* output map template */
111 extern char typename[32]; /* name of file transfer type */
112 extern int type; /* file transfer type */
113 extern char structname[32]; /* name of file transfer structure */
114 extern int stru; /* file transfer structure */
115 extern char formname[32]; /* name of file transfer format */
116 extern int form; /* file transfer format */
117 extern char modename[32]; /* name of file transfer mode */
118 extern int mode; /* file transfer mode */
119 extern char bytename[32]; /* local byte size in ascii */
120 extern int bytesize; /* local byte size in binary */
121
122 extern jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
123
124 extern char line[200]; /* input line buffer */
125 extern char *stringbase; /* current scan point in line buffer */
126 extern char argbuf[200]; /* argument storage buffer */
127 extern char *argbase; /* current storage point in arg buffer */
128 extern int margc; /* count of arguments on input line */
129 extern const char *margv[20]; /* args parsed from input line */
130 extern int cpend; /* flag: if != 0, then pending server reply */
131 extern int mflag; /* flag: if != 0, then active multi command */
132
133 extern int options; /* used during socket creation */
134
135 /*
136 * Format of command table.
137 */
138 struct cmd {
139 const char *c_name; /* name of command */
140 const char *c_help; /* help string */
141 char c_bell; /* give bell when command completes */
142 char c_conn; /* must be connected to use command */
143 char c_proxy; /* proxy server may execute */
144 void (*c_handler)(); /* function to call */
145 };
146
147 struct macel {
148 char mac_name[9]; /* macro name */
149 char *mac_start; /* start of macro in macbuf */
150 char *mac_end; /* end of macro in macbuf */
151 };
152
153 extern int macnum; /* number of defined macros */
154 extern struct macel macros[16];
155 extern char macbuf[4096];
156
157 #if defined(__ANSI__) || defined(sparc)
158 typedef void sig_t;
159 #else
160 typedef int sig_t;
161 #endif
162
163 typedef int uid_t;
164