ftp_var.h revision 1.36.2.1 1 1.36.2.1 wrstuden /* $NetBSD: ftp_var.h,v 1.36.2.1 1999/12/27 18:36:58 wrstuden Exp $ */
2 1.34 itojun
3 1.36.2.1 wrstuden /*-
4 1.36.2.1 wrstuden * Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
5 1.34 itojun * All rights reserved.
6 1.36.2.1 wrstuden *
7 1.36.2.1 wrstuden * This code is derived from software contributed to The NetBSD Foundation
8 1.36.2.1 wrstuden * by Luke Mewburn.
9 1.36.2.1 wrstuden *
10 1.34 itojun * Redistribution and use in source and binary forms, with or without
11 1.34 itojun * modification, are permitted provided that the following conditions
12 1.34 itojun * are met:
13 1.34 itojun * 1. Redistributions of source code must retain the above copyright
14 1.34 itojun * notice, this list of conditions and the following disclaimer.
15 1.34 itojun * 2. Redistributions in binary form must reproduce the above copyright
16 1.34 itojun * notice, this list of conditions and the following disclaimer in the
17 1.34 itojun * documentation and/or other materials provided with the distribution.
18 1.36.2.1 wrstuden * 3. All advertising materials mentioning features or use of this software
19 1.36.2.1 wrstuden * must display the following acknowledgement:
20 1.36.2.1 wrstuden * This product includes software developed by the NetBSD
21 1.36.2.1 wrstuden * Foundation, Inc. and its contributors.
22 1.36.2.1 wrstuden * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.36.2.1 wrstuden * contributors may be used to endorse or promote products derived
24 1.36.2.1 wrstuden * from this software without specific prior written permission.
25 1.36.2.1 wrstuden *
26 1.36.2.1 wrstuden * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.36.2.1 wrstuden * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.36.2.1 wrstuden * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.36.2.1 wrstuden * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.36.2.1 wrstuden * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.36.2.1 wrstuden * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.36.2.1 wrstuden * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.36.2.1 wrstuden * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.36.2.1 wrstuden * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.36.2.1 wrstuden * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.36.2.1 wrstuden * POSSIBILITY OF SUCH DAMAGE.
37 1.34 itojun */
38 1.6 tls
39 1.1 cgd /*
40 1.3 cgd * Copyright (c) 1985, 1989, 1993, 1994
41 1.3 cgd * The Regents of the University of California. All rights reserved.
42 1.1 cgd *
43 1.1 cgd * Redistribution and use in source and binary forms, with or without
44 1.1 cgd * modification, are permitted provided that the following conditions
45 1.1 cgd * are met:
46 1.1 cgd * 1. Redistributions of source code must retain the above copyright
47 1.1 cgd * notice, this list of conditions and the following disclaimer.
48 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
49 1.1 cgd * notice, this list of conditions and the following disclaimer in the
50 1.1 cgd * documentation and/or other materials provided with the distribution.
51 1.1 cgd * 3. All advertising materials mentioning features or use of this software
52 1.1 cgd * must display the following acknowledgement:
53 1.1 cgd * This product includes software developed by the University of
54 1.1 cgd * California, Berkeley and its contributors.
55 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
56 1.1 cgd * may be used to endorse or promote products derived from this software
57 1.1 cgd * without specific prior written permission.
58 1.1 cgd *
59 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 1.1 cgd * SUCH DAMAGE.
70 1.1 cgd *
71 1.6 tls * @(#)ftp_var.h 8.4 (Berkeley) 10/9/94
72 1.1 cgd */
73 1.1 cgd
74 1.1 cgd /*
75 1.36.2.1 wrstuden * Copyright (C) 1997 and 1998 WIDE Project.
76 1.36.2.1 wrstuden * All rights reserved.
77 1.36.2.1 wrstuden *
78 1.36.2.1 wrstuden * Redistribution and use in source and binary forms, with or without
79 1.36.2.1 wrstuden * modification, are permitted provided that the following conditions
80 1.36.2.1 wrstuden * are met:
81 1.36.2.1 wrstuden * 1. Redistributions of source code must retain the above copyright
82 1.36.2.1 wrstuden * notice, this list of conditions and the following disclaimer.
83 1.36.2.1 wrstuden * 2. Redistributions in binary form must reproduce the above copyright
84 1.36.2.1 wrstuden * notice, this list of conditions and the following disclaimer in the
85 1.36.2.1 wrstuden * documentation and/or other materials provided with the distribution.
86 1.36.2.1 wrstuden * 3. Neither the name of the project nor the names of its contributors
87 1.36.2.1 wrstuden * may be used to endorse or promote products derived from this software
88 1.36.2.1 wrstuden * without specific prior written permission.
89 1.36.2.1 wrstuden *
90 1.36.2.1 wrstuden * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
91 1.36.2.1 wrstuden * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
92 1.36.2.1 wrstuden * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
93 1.36.2.1 wrstuden * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
94 1.36.2.1 wrstuden * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
95 1.36.2.1 wrstuden * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
96 1.36.2.1 wrstuden * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
97 1.36.2.1 wrstuden * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
98 1.36.2.1 wrstuden * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
99 1.36.2.1 wrstuden * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
100 1.36.2.1 wrstuden * SUCH DAMAGE.
101 1.36.2.1 wrstuden */
102 1.36.2.1 wrstuden
103 1.36.2.1 wrstuden /*
104 1.1 cgd * FTP global variables.
105 1.1 cgd */
106 1.1 cgd
107 1.32 cgd #ifdef SMALL
108 1.32 cgd #undef NO_EDITCOMPLETE
109 1.32 cgd #define NO_EDITCOMPLETE
110 1.32 cgd #undef NO_PROGRESS
111 1.32 cgd #define NO_PROGRESS
112 1.32 cgd #endif
113 1.32 cgd
114 1.3 cgd #include <sys/param.h>
115 1.26 lukem
116 1.26 lukem #include <netinet/in.h>
117 1.26 lukem #include <arpa/inet.h>
118 1.26 lukem
119 1.3 cgd #include <setjmp.h>
120 1.12 lukem #include <stringlist.h>
121 1.12 lukem
122 1.32 cgd #ifndef NO_EDITCOMPLETE
123 1.12 lukem #include <histedit.h>
124 1.32 cgd #endif /* !NO_EDITCOMPLETE */
125 1.3 cgd
126 1.3 cgd #include "extern.h"
127 1.3 cgd
128 1.8 lukem
129 1.36.2.1 wrstuden /*
130 1.36.2.1 wrstuden * Format of command table.
131 1.36.2.1 wrstuden */
132 1.36.2.1 wrstuden struct cmd {
133 1.36.2.1 wrstuden char *c_name; /* name of command */
134 1.36.2.1 wrstuden char *c_help; /* help string */
135 1.36.2.1 wrstuden char c_bell; /* give bell when command completes */
136 1.36.2.1 wrstuden char c_conn; /* must be connected to use command */
137 1.36.2.1 wrstuden char c_proxy; /* proxy server may execute */
138 1.36.2.1 wrstuden #ifndef NO_EDITCOMPLETE
139 1.36.2.1 wrstuden char *c_complete; /* context sensitive completion list */
140 1.36.2.1 wrstuden #endif /* !NO_EDITCOMPLETE */
141 1.36.2.1 wrstuden void (*c_handler) __P((int, char **)); /* function to call */
142 1.36.2.1 wrstuden };
143 1.36.2.1 wrstuden
144 1.36.2.1 wrstuden /*
145 1.36.2.1 wrstuden * Format of macro table
146 1.36.2.1 wrstuden */
147 1.36.2.1 wrstuden struct macel {
148 1.36.2.1 wrstuden char mac_name[9]; /* macro name */
149 1.36.2.1 wrstuden char *mac_start; /* start of macro in macbuf */
150 1.36.2.1 wrstuden char *mac_end; /* end of macro in macbuf */
151 1.36.2.1 wrstuden };
152 1.36.2.1 wrstuden
153 1.36.2.1 wrstuden /*
154 1.36.2.1 wrstuden * Format of option table
155 1.36.2.1 wrstuden */
156 1.36.2.1 wrstuden struct option {
157 1.36.2.1 wrstuden char *name;
158 1.36.2.1 wrstuden char *value;
159 1.36.2.1 wrstuden };
160 1.36.2.1 wrstuden
161 1.36.2.1 wrstuden
162 1.36.2.1 wrstuden /*
163 1.36.2.1 wrstuden * Global defines
164 1.36.2.1 wrstuden */
165 1.36.2.1 wrstuden #define FTPBUFLEN MAXPATHLEN + 200
166 1.36.2.1 wrstuden #define MAX_IN_PORT_T 0xffffU
167 1.36.2.1 wrstuden
168 1.36.2.1 wrstuden #define HASHBYTES 1024 /* default mark for `hash' command */
169 1.33 lukem #define DEFAULTINCR 1024 /* default increment for `rate' command */
170 1.36.2.1 wrstuden #define STALLTIME 5 /* # of seconds of no xfer before "stalling" */
171 1.13 lukem
172 1.18 lukem #define FTP_PORT 21 /* default if ! getservbyname("ftp/tcp") */
173 1.18 lukem #define HTTP_PORT 80 /* default if ! getservbyname("http/tcp") */
174 1.18 lukem #ifndef GATE_PORT
175 1.18 lukem #define GATE_PORT 21 /* default if ! getservbyname("ftpgate/tcp") */
176 1.18 lukem #endif
177 1.18 lukem #ifndef GATE_SERVER
178 1.18 lukem #define GATE_SERVER "" /* default server */
179 1.18 lukem #endif
180 1.14 lukem
181 1.36.2.1 wrstuden #define DEFAULTPAGER "more" /* default pager if $PAGER isn't set */
182 1.36.2.1 wrstuden #define DEFAULTPROMPT "ftp> " /* default prompt if `set prompt' is empty */
183 1.36.2.1 wrstuden #define DEFAULTRPROMPT "" /* default rprompt if `set rprompt' is empty */
184 1.36.2.1 wrstuden
185 1.36.2.1 wrstuden #define TMPFILE "ftpXXXXXXXXXX"
186 1.36.2.1 wrstuden
187 1.36.2.1 wrstuden
188 1.36.2.1 wrstuden #ifndef GLOBAL
189 1.36.2.1 wrstuden #define GLOBAL extern
190 1.36.2.1 wrstuden #endif
191 1.8 lukem
192 1.1 cgd /*
193 1.1 cgd * Options and other state info.
194 1.1 cgd */
195 1.36.2.1 wrstuden GLOBAL int trace; /* trace packets exchanged */
196 1.36.2.1 wrstuden GLOBAL int hash; /* print # for each buffer transferred */
197 1.36.2.1 wrstuden GLOBAL int mark; /* number of bytes between hashes */
198 1.36.2.1 wrstuden GLOBAL int sendport; /* use PORT/LPRT cmd for each data connection */
199 1.36.2.1 wrstuden GLOBAL int verbose; /* print messages coming back from server */
200 1.36.2.1 wrstuden GLOBAL int connected; /* 1 = connected to server, -1 = logged in */
201 1.36.2.1 wrstuden GLOBAL int fromatty; /* input is from a terminal */
202 1.36.2.1 wrstuden GLOBAL int interactive; /* interactively prompt on m* cmds */
203 1.36.2.1 wrstuden GLOBAL int confirmrest; /* confirm rest of current m* cmd */
204 1.36.2.1 wrstuden GLOBAL int debug; /* debugging level */
205 1.36.2.1 wrstuden GLOBAL int bell; /* ring bell on cmd completion */
206 1.36.2.1 wrstuden GLOBAL int doglob; /* glob local file names */
207 1.36.2.1 wrstuden GLOBAL int autologin; /* establish user account on connection */
208 1.36.2.1 wrstuden GLOBAL int proxy; /* proxy server connection active */
209 1.36.2.1 wrstuden GLOBAL int proxflag; /* proxy connection exists */
210 1.36.2.1 wrstuden GLOBAL int gatemode; /* use gate-ftp */
211 1.36.2.1 wrstuden GLOBAL char *gateserver; /* server to use for gate-ftp */
212 1.36.2.1 wrstuden GLOBAL int sunique; /* store files on server with unique name */
213 1.36.2.1 wrstuden GLOBAL int runique; /* store local files with unique name */
214 1.36.2.1 wrstuden GLOBAL int mcase; /* map upper to lower case for mget names */
215 1.36.2.1 wrstuden GLOBAL int ntflag; /* use ntin ntout tables for name translation */
216 1.36.2.1 wrstuden GLOBAL int mapflag; /* use mapin mapout templates on file names */
217 1.36.2.1 wrstuden GLOBAL int preserve; /* preserve modification time on files */
218 1.36.2.1 wrstuden GLOBAL int progress; /* display transfer progress bar */
219 1.36.2.1 wrstuden GLOBAL int code; /* return/reply code for ftp command */
220 1.36.2.1 wrstuden GLOBAL int crflag; /* if 1, strip car. rets. on ascii gets */
221 1.36.2.1 wrstuden GLOBAL int passivemode; /* passive mode enabled */
222 1.36.2.1 wrstuden GLOBAL int activefallback; /* fall back to active mode if passive fails */
223 1.36.2.1 wrstuden GLOBAL char *altarg; /* argv[1] with no shell-like preprocessing */
224 1.36.2.1 wrstuden GLOBAL char ntin[17]; /* input translation table */
225 1.36.2.1 wrstuden GLOBAL char ntout[17]; /* output translation table */
226 1.36.2.1 wrstuden GLOBAL char mapin[MAXPATHLEN]; /* input map template */
227 1.36.2.1 wrstuden GLOBAL char mapout[MAXPATHLEN]; /* output map template */
228 1.36.2.1 wrstuden GLOBAL char typename[32]; /* name of file transfer type */
229 1.36.2.1 wrstuden GLOBAL int type; /* requested file transfer type */
230 1.36.2.1 wrstuden GLOBAL int curtype; /* current file transfer type */
231 1.36.2.1 wrstuden GLOBAL char structname[32]; /* name of file transfer structure */
232 1.36.2.1 wrstuden GLOBAL int stru; /* file transfer structure */
233 1.36.2.1 wrstuden GLOBAL char formname[32]; /* name of file transfer format */
234 1.36.2.1 wrstuden GLOBAL int form; /* file transfer format */
235 1.36.2.1 wrstuden GLOBAL char modename[32]; /* name of file transfer mode */
236 1.36.2.1 wrstuden GLOBAL int mode; /* file transfer mode */
237 1.36.2.1 wrstuden GLOBAL char bytename[32]; /* local byte size in ascii */
238 1.36.2.1 wrstuden GLOBAL int bytesize; /* local byte size in binary */
239 1.36.2.1 wrstuden GLOBAL int anonftp; /* automatic anonymous login */
240 1.36.2.1 wrstuden GLOBAL int dirchange; /* remote directory changed by cd command */
241 1.36.2.1 wrstuden GLOBAL int flushcache; /* set HTTP cache flush headers with request */
242 1.36.2.1 wrstuden GLOBAL int rate_get; /* maximum get xfer rate */
243 1.36.2.1 wrstuden GLOBAL int rate_get_incr; /* increment for get xfer rate */
244 1.36.2.1 wrstuden GLOBAL int rate_put; /* maximum put xfer rate */
245 1.36.2.1 wrstuden GLOBAL int rate_put_incr; /* increment for put xfer rate */
246 1.36.2.1 wrstuden GLOBAL int retry_connect; /* seconds between retrying connection */
247 1.36.2.1 wrstuden GLOBAL int ttywidth; /* width of tty */
248 1.36.2.1 wrstuden GLOBAL char *tmpdir; /* temporary directory */
249 1.36.2.1 wrstuden GLOBAL FILE *ttyout; /* stdout, or stderr if retrieving to stdout */
250 1.36.2.1 wrstuden GLOBAL int epsv4; /* use EPSV/EPRT on IPv4 connections */
251 1.36.2.1 wrstuden GLOBAL int epsv4bad; /* EPSV doesn't work on the current server */
252 1.36.2.1 wrstuden GLOBAL int editing; /* command line editing enabled */
253 1.12 lukem
254 1.32 cgd #ifndef NO_EDITCOMPLETE
255 1.36.2.1 wrstuden GLOBAL EditLine *el; /* editline(3) status structure */
256 1.36.2.1 wrstuden GLOBAL History *hist; /* editline(3) history structure */
257 1.36.2.1 wrstuden GLOBAL char *cursor_pos; /* cursor position we're looking for */
258 1.36.2.1 wrstuden GLOBAL size_t cursor_argc; /* location of cursor in margv */
259 1.36.2.1 wrstuden GLOBAL size_t cursor_argo; /* offset of cursor in margv[cursor_argc] */
260 1.32 cgd #endif /* !NO_EDITCOMPLETE */
261 1.12 lukem
262 1.36.2.1 wrstuden GLOBAL off_t bytes; /* current # of bytes read */
263 1.36.2.1 wrstuden GLOBAL off_t filesize; /* size of file being transferred */
264 1.36.2.1 wrstuden GLOBAL char *direction; /* direction transfer is occurring */
265 1.36.2.1 wrstuden GLOBAL off_t restart_point; /* offset to restart transfer */
266 1.1 cgd
267 1.36.2.1 wrstuden GLOBAL char *hostname; /* name of host connected to */
268 1.36.2.1 wrstuden GLOBAL int unix_server; /* server is unix, can use binary for ascii */
269 1.36.2.1 wrstuden GLOBAL int unix_proxy; /* proxy is unix, can use binary for ascii */
270 1.36.2.1 wrstuden GLOBAL char remotepwd[MAXPATHLEN]; /* remote dir */
271 1.36.2.1 wrstuden GLOBAL char *username; /* name of user logged in as. (dynamic) */
272 1.25 thorpej
273 1.36.2.1 wrstuden GLOBAL char *ftpport; /* port number to use for FTP connections */
274 1.36.2.1 wrstuden GLOBAL char *httpport; /* port number to use for HTTP connections */
275 1.36.2.1 wrstuden GLOBAL char *gateport; /* port number to use for gateftp connections */
276 1.1 cgd
277 1.36.2.1 wrstuden GLOBAL char *outfile; /* filename to output URLs to */
278 1.36.2.1 wrstuden GLOBAL int restartautofetch; /* restart auto-fetch */
279 1.36.2.1 wrstuden
280 1.36.2.1 wrstuden GLOBAL sigjmp_buf toplevel; /* non-local goto stuff for cmd scanner */
281 1.36.2.1 wrstuden
282 1.36.2.1 wrstuden GLOBAL char line[FTPBUFLEN]; /* input line buffer */
283 1.36.2.1 wrstuden GLOBAL char *stringbase; /* current scan point in line buffer */
284 1.36.2.1 wrstuden GLOBAL char argbuf[FTPBUFLEN]; /* argument storage buffer */
285 1.36.2.1 wrstuden GLOBAL char *argbase; /* current storage point in arg buffer */
286 1.36.2.1 wrstuden GLOBAL StringList *marg_sl; /* stringlist containing margv */
287 1.36.2.1 wrstuden GLOBAL int margc; /* count of arguments on input line */
288 1.36.2.1 wrstuden #define margv (marg_sl->sl_str) /* args parsed from input line */
289 1.36.2.1 wrstuden GLOBAL int cpend; /* flag: if != 0, then pending server reply */
290 1.36.2.1 wrstuden GLOBAL int mflag; /* flag: if != 0, then active multi command */
291 1.36.2.1 wrstuden
292 1.36.2.1 wrstuden GLOBAL int options; /* used during socket creation */
293 1.36.2.1 wrstuden
294 1.36.2.1 wrstuden GLOBAL int sndbuf_size; /* socket send buffer size */
295 1.36.2.1 wrstuden GLOBAL int rcvbuf_size; /* socket receive buffer size */
296 1.36.2.1 wrstuden
297 1.36.2.1 wrstuden GLOBAL int macnum; /* number of defined macros */
298 1.36.2.1 wrstuden GLOBAL struct macel macros[16];
299 1.36.2.1 wrstuden GLOBAL char macbuf[4096];
300 1.36.2.1 wrstuden
301 1.36.2.1 wrstuden GLOBAL char home[MAXPATHLEN]; /* home directory (for lcd) */
302 1.36.2.1 wrstuden GLOBAL char reply_string[BUFSIZ]; /* first line of previous reply */
303 1.36.2.1 wrstuden
304 1.36.2.1 wrstuden GLOBAL FILE *cin;
305 1.36.2.1 wrstuden GLOBAL FILE *cout;
306 1.36.2.1 wrstuden GLOBAL int data;
307 1.36.2.1 wrstuden
308 1.36.2.1 wrstuden extern struct cmd cmdtab[];
309 1.36.2.1 wrstuden extern struct option optiontab[];
310 1.36.2.1 wrstuden
311 1.36.2.1 wrstuden extern char *__progname; /* from crt0.o */
312 1.1 cgd
313 1.1 cgd
314 1.36.2.1 wrstuden #define EMPTYSTRING(x) ((x) == NULL || (*(x) == '\0'))
315 1.36.2.1 wrstuden #define FREEPTR(x) if ((x) != NULL) { free(x); (x) = NULL; }
316