extern.h revision 1.30 1 1.30 christos /* $NetBSD: extern.h,v 1.30 2007/10/27 15:14:50 christos Exp $ */
2 1.4 christos
3 1.1 deraadt /*-
4 1.1 deraadt * Copyright (c) 1992, 1993
5 1.1 deraadt * The Regents of the University of California. All rights reserved.
6 1.1 deraadt *
7 1.1 deraadt * Redistribution and use in source and binary forms, with or without
8 1.1 deraadt * modification, are permitted provided that the following conditions
9 1.1 deraadt * are met:
10 1.1 deraadt * 1. Redistributions of source code must retain the above copyright
11 1.1 deraadt * notice, this list of conditions and the following disclaimer.
12 1.1 deraadt * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 deraadt * notice, this list of conditions and the following disclaimer in the
14 1.1 deraadt * documentation and/or other materials provided with the distribution.
15 1.18 agc * 3. Neither the name of the University nor the names of its contributors
16 1.1 deraadt * may be used to endorse or promote products derived from this software
17 1.1 deraadt * without specific prior written permission.
18 1.1 deraadt *
19 1.1 deraadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.1 deraadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1 deraadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1 deraadt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.1 deraadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1 deraadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1 deraadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1 deraadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 deraadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1 deraadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1 deraadt * SUCH DAMAGE.
30 1.1 deraadt *
31 1.30 christos * @(#)extern.h 8.2 (Berkeley) 4/20/95
32 1.30 christos * $NetBSD: extern.h,v 1.30 2007/10/27 15:14:50 christos Exp $
33 1.1 deraadt */
34 1.1 deraadt
35 1.26 christos #ifndef __EXTERN_H__
36 1.26 christos #define __EXTERN_H__
37 1.26 christos
38 1.27 christos /*
39 1.27 christos * from cmd1.c
40 1.27 christos */
41 1.30 christos int More(void *);
42 1.30 christos int Type(void *);
43 1.30 christos int folders(void *);
44 1.30 christos int from(void *);
45 1.30 christos int headers(void *);
46 1.30 christos int inc(void *);
47 1.30 christos int mboxit(void *);
48 1.30 christos int more(void *);
49 1.30 christos int pcmdlist(void *);
50 1.30 christos int pdot(void *);
51 1.30 christos int pipecmd(void *);
52 1.30 christos int scroll(void *);
53 1.30 christos int stouch(void *);
54 1.30 christos int top(void *);
55 1.30 christos int type(void *);
56 1.27 christos #ifdef MIME_SUPPORT
57 1.30 christos int page(void *);
58 1.30 christos int Page(void *);
59 1.30 christos int print(void *);
60 1.30 christos int Print(void *);
61 1.30 christos int view(void *);
62 1.30 christos int View(void *);
63 1.27 christos #endif
64 1.27 christos /* XXX - should these be elsewhere? */
65 1.30 christos void printhead(int);
66 1.30 christos char * sget_msgnum(struct message *, struct message *);
67 1.30 christos void show_msgnum(FILE *, struct message *, struct message *);
68 1.27 christos
69 1.27 christos /*
70 1.27 christos * from cmd2.c
71 1.27 christos */
72 1.30 christos int Detach(void *);
73 1.30 christos int Save(void *);
74 1.30 christos int clobber(void *);
75 1.30 christos int copycmd(void *);
76 1.30 christos int core(void *);
77 1.30 christos int delete(void *);
78 1.30 christos int deltype(void *);
79 1.30 christos int detach(void *);
80 1.30 christos int igfield(void *);
81 1.30 christos int next(void *);
82 1.30 christos int retfield(void *);
83 1.30 christos int save(void *);
84 1.30 christos int saveigfield(void *);
85 1.30 christos int saveretfield(void *);
86 1.30 christos int swrite(void *);
87 1.30 christos int undeletecmd(void *);
88 1.27 christos
89 1.27 christos /*
90 1.27 christos * from cmd3.c
91 1.27 christos */
92 1.30 christos int Respond(void *);
93 1.30 christos int alternates(void *);
94 1.30 christos int bounce(void *);
95 1.30 christos int dosh(void *);
96 1.30 christos int echo(void *);
97 1.30 christos int elsecmd(void *);
98 1.30 christos int endifcmd(void *);
99 1.30 christos int file(void *);
100 1.30 christos int bounce(void *);
101 1.30 christos int forward(void *);
102 1.30 christos int group(void *);
103 1.30 christos int help(void *);
104 1.30 christos int ifcmd(void *);
105 1.30 christos int ifdefcmd(void *v);
106 1.30 christos int ifndefcmd(void *v);
107 1.30 christos int markread(void *);
108 1.30 christos int messize(void *);
109 1.30 christos int null(void *);
110 1.30 christos int preserve(void *);
111 1.30 christos int respond(void *);
112 1.30 christos int rexit(void *);
113 1.30 christos int schdir(void *);
114 1.30 christos int set(void *);
115 1.30 christos int shell(void *);
116 1.30 christos int show(void *);
117 1.30 christos int unalias(void *);
118 1.30 christos int unread(void *);
119 1.30 christos int unset(void *);
120 1.27 christos /* XXX - Should this be elsewhere? */
121 1.30 christos void sort(const char **);
122 1.27 christos
123 1.27 christos /*
124 1.27 christos * from cmd4.c
125 1.27 christos */
126 1.27 christos struct smopts_s *findsmopts(const char *, int);
127 1.27 christos int smoptscmd(void *);
128 1.27 christos int unsmoptscmd(void *);
129 1.27 christos
130 1.27 christos /*
131 1.27 christos * from cmdtab.c
132 1.27 christos */
133 1.27 christos extern const struct cmd cmdtab[];
134 1.27 christos
135 1.27 christos /*
136 1.27 christos * from collect.c
137 1.27 christos */
138 1.30 christos FILE * collect(struct header *, int);
139 1.30 christos void savedeadletter(FILE *);
140 1.27 christos
141 1.27 christos /*
142 1.27 christos * from dotlock.c
143 1.27 christos */
144 1.30 christos int dot_lock(const char *, int, FILE *, const char *);
145 1.30 christos void dot_unlock(const char *);
146 1.27 christos
147 1.27 christos /*
148 1.27 christos * from edit.c
149 1.27 christos */
150 1.30 christos int editor(void *);
151 1.30 christos int visual(void *);
152 1.30 christos FILE * run_editor(FILE *, off_t, int, int);
153 1.27 christos
154 1.27 christos /*
155 1.27 christos * from fio.c
156 1.27 christos */
157 1.27 christos const char *expand(const char *);
158 1.30 christos off_t fsize(FILE *);
159 1.27 christos const char *getdeadletter(void);
160 1.30 christos int getfold(char *, size_t);
161 1.30 christos void holdsigs(void);
162 1.30 christos int mail_readline(FILE *, char *, int);
163 1.30 christos int putline(FILE *, const char *, int);
164 1.30 christos void relsesigs(void);
165 1.30 christos int rm(char *);
166 1.30 christos FILE * setinput(const struct message *);
167 1.30 christos void setptr(FILE *, off_t);
168 1.27 christos
169 1.27 christos /*
170 1.27 christos * from getname.c
171 1.27 christos */
172 1.27 christos const char *getname(uid_t);
173 1.30 christos int getuserid(char []);
174 1.27 christos
175 1.27 christos /*
176 1.27 christos * from head.c
177 1.27 christos */
178 1.30 christos int ishead(const char []);
179 1.30 christos void parse(const char [], struct headline *, char []);
180 1.27 christos
181 1.27 christos /*
182 1.27 christos * from lex.c
183 1.27 christos */
184 1.30 christos void announce(void);
185 1.30 christos void commands(void);
186 1.28 christos enum execute_contxt_e { ec_normal, ec_composing, ec_autoprint };
187 1.30 christos int execute(char [], enum execute_contxt_e);
188 1.30 christos int incfile(void);
189 1.27 christos const struct cmd *lex(char []);
190 1.30 christos void load(const char *);
191 1.30 christos int newfileinfo(int);
192 1.30 christos int pversion(void *);
193 1.30 christos int setfile(const char *);
194 1.30 christos char * shellpr(char *);
195 1.30 christos char * get_cmdname(char *);
196 1.27 christos
197 1.27 christos /*
198 1.27 christos * from list.c
199 1.27 christos */
200 1.30 christos int first(int, int);
201 1.30 christos int get_Hflag(char **);
202 1.30 christos int getmsglist(char *, int *, int);
203 1.30 christos int getrawlist(const char [], char **, int);
204 1.30 christos int show_headers_and_exit(int) __attribute__((__noreturn__));
205 1.27 christos
206 1.27 christos /*
207 1.27 christos * from main.c
208 1.27 christos */
209 1.27 christos struct name *lexpand(char *, int);
210 1.30 christos void setscreensize(void);
211 1.30 christos int main(int, char **);
212 1.27 christos
213 1.27 christos /*
214 1.27 christos * from names.c
215 1.27 christos */
216 1.27 christos struct name *cat(struct name *, struct name *);
217 1.30 christos int count(struct name *);
218 1.27 christos struct name *delname(struct name *, char []);
219 1.30 christos char * detract(struct name *, int);
220 1.30 christos struct name * elide(struct name *);
221 1.30 christos struct name * extract(char [], int);
222 1.30 christos struct name * gexpand(struct name *, struct grouphead *, int, int);
223 1.30 christos struct name * nalloc(char [], int);
224 1.30 christos struct name * outof(struct name *, FILE *, struct header *);
225 1.30 christos const char ** unpack(struct name *);
226 1.30 christos struct name * usermap(struct name *);
227 1.27 christos #if 0
228 1.30 christos void prettyprint(struct name *); /* commented out? */
229 1.27 christos #endif
230 1.27 christos
231 1.27 christos /*
232 1.27 christos * from popen.c
233 1.27 christos */
234 1.30 christos int Fclose(FILE *);
235 1.30 christos FILE * Fdopen(int, const char *);
236 1.30 christos FILE * Fopen(const char *, const char *);
237 1.30 christos int Pclose(FILE *);
238 1.30 christos FILE * Popen(const char *, const char *);
239 1.30 christos void close_all_files(void);
240 1.30 christos void close_top_files(FILE *);
241 1.30 christos void free_child(int);
242 1.30 christos void prepare_child(sigset_t *, int, int);
243 1.30 christos FILE * last_registered_file(int);
244 1.30 christos void register_file(FILE *, int, int);
245 1.30 christos int run_command(const char *, sigset_t *, int, int, ...);
246 1.30 christos void sigchild(int);
247 1.30 christos int start_command(const char *, sigset_t *, int, int, ...);
248 1.30 christos int wait_child(int);
249 1.25 christos #ifdef MIME_SUPPORT
250 1.30 christos void flush_files(FILE *, int);
251 1.25 christos #endif
252 1.25 christos
253 1.27 christos /*
254 1.27 christos * from quit.c
255 1.27 christos */
256 1.30 christos void quit(void);
257 1.30 christos int quitcmd(void *);
258 1.27 christos
259 1.27 christos /*
260 1.27 christos * from send.c
261 1.27 christos */
262 1.27 christos #ifndef MIME_SUPPORT
263 1.27 christos # define sendmessage(a,b,c,d,e) legacy_sendmessage(a,b,c,d)
264 1.27 christos # define mail(a,b,c,d,e,f) legacy_mail(a,b,c,d,e)
265 1.26 christos #endif
266 1.30 christos int sendmessage(struct message *, FILE *, struct ignoretab *, const char *, struct mime_info *);
267 1.30 christos int mail(struct name *, struct name *, struct name *, struct name *, char *, struct attachment *);
268 1.30 christos void mail1(struct header *, int);
269 1.30 christos void mail2(FILE *, const char **);
270 1.30 christos int puthead(struct header *, FILE *, int);
271 1.30 christos int sendmail(void *);
272 1.27 christos
273 1.27 christos /*
274 1.27 christos * from strings.c
275 1.27 christos */
276 1.30 christos void * csalloc(size_t, size_t);
277 1.30 christos void * salloc(size_t);
278 1.30 christos void sreset(void);
279 1.30 christos void spreserve(void);
280 1.26 christos
281 1.27 christos /*
282 1.27 christos * from support.c
283 1.27 christos */
284 1.30 christos void add_ignore(const char *, struct ignoretab *);
285 1.30 christos void alter(char *);
286 1.30 christos int argcount(char **);
287 1.30 christos int blankline(char []);
288 1.30 christos char * copy(char *, char *);
289 1.30 christos char * hfield(const char [], const struct message *);
290 1.30 christos int isdir(const char []);
291 1.30 christos int isign(const char *, struct ignoretab []);
292 1.30 christos void istrcpy(char *, const char *);
293 1.30 christos int member(char *, struct ignoretab *);
294 1.30 christos char * nameof(struct message *, int);
295 1.30 christos int sasprintf(char **ret, const char *format, ...);
296 1.30 christos char * savestr(const char *);
297 1.27 christos struct message *set_m_flag(int, int, int);
298 1.30 christos char * skin(char *);
299 1.30 christos int source(void *);
300 1.30 christos void touch(struct message *);
301 1.30 christos int unstack(void);
302 1.30 christos int upcase(int);
303 1.30 christos void cathelp(const char *);
304 1.26 christos
305 1.27 christos /*
306 1.27 christos * from temp.c
307 1.27 christos */
308 1.30 christos void tinit(void);
309 1.27 christos
310 1.27 christos /*
311 1.27 christos * from tty.c
312 1.27 christos */
313 1.30 christos int grabh(struct header *, int);
314 1.27 christos
315 1.27 christos /*
316 1.27 christos * from vars.c
317 1.27 christos */
318 1.30 christos void assign(const char [], const char []);
319 1.30 christos struct grouphead * findgroup(const char []);
320 1.30 christos int hash(const char *);
321 1.30 christos struct var * lookup(const char []);
322 1.30 christos void printgroup(const char []);
323 1.30 christos void v_free(char *);
324 1.30 christos char * value(const char []);
325 1.30 christos char * vcopy(const char []);
326 1.27 christos
327 1.27 christos /*
328 1.27 christos * from v7.local.c
329 1.27 christos */
330 1.30 christos void demail(void);
331 1.30 christos void findmail(const char *, char *, size_t);
332 1.27 christos const char *username(void);
333 1.27 christos
334 1.27 christos /*
335 1.27 christos * from version.c
336 1.27 christos */
337 1.21 christos extern const char *version;
338 1.27 christos
339 1.27 christos
340 1.27 christos #ifndef THREAD_SUPPORT
341 1.27 christos /*
342 1.27 christos * Specials from fio.c (if THREAD_SUPPORT is not defined).
343 1.27 christos * With THREAD_SUPPORT, they live in thread.c.
344 1.27 christos */
345 1.27 christos struct message *next_message(struct message *);
346 1.27 christos struct message *prev_message(struct message *);
347 1.27 christos struct message *get_message(int);
348 1.30 christos int get_msgnum(struct message *);
349 1.30 christos int get_msgCount(void);
350 1.27 christos
351 1.27 christos /* we remap these commands */
352 1.27 christos # define get_abs_msgCount get_msgCount
353 1.27 christos # define get_abs_message(a) get_message(a)
354 1.27 christos # define next_abs_message(a) next_message(a)
355 1.27 christos
356 1.27 christos /* we trash these commands */
357 1.27 christos # define do_recursion() 0
358 1.27 christos # define thread_recursion(mp,fn,args) fn(mp,args)
359 1.27 christos # define thread_fix_old_links(nmessage,message,omsgCount)
360 1.27 christos # define thread_fix_new_links(message,omsgCount,msgCount)
361 1.27 christos #endif /* THREAD_SUPPORT */
362 1.26 christos
363 1.26 christos #endif /* __EXTERN_H__ */
364