extern.h revision 1.26 1 /* $NetBSD: extern.h,v 1.26 2006/10/31 20:07:32 christos Exp $ */
2
3 /*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * @(#)extern.h 8.2 (Berkeley) 4/20/95
32 * $NetBSD: extern.h,v 1.26 2006/10/31 20:07:32 christos Exp $
33 */
34
35 #ifndef __EXTERN_H__
36 #define __EXTERN_H__
37
38 struct name;
39 struct name *cat(struct name *, struct name *);
40 struct name *delname(struct name *, char []);
41 struct name *elide(struct name *);
42 struct name *extract(char [], int);
43 struct grouphead;
44 struct name *gexpand(struct name *, struct grouphead *, int, int);
45 struct name *lexpand(char *, int);
46 struct name *nalloc(char [], int);
47 struct header;
48 struct name *outof(struct name *, FILE *, struct header *);
49 struct name *put(struct name *, struct name *);
50 struct name *tailof(struct name *);
51 struct name *usermap(struct name *);
52 FILE *Fdopen(int, const char *);
53 FILE *Fopen(const char *, const char *);
54 FILE *Popen(const char *, const char *);
55 FILE *collect(struct header *, int);
56 char *copy(char *, char *);
57 char *copyin(const char *, char **);
58 void *csalloc(size_t, size_t);
59 char *detract(struct name *, int);
60 const char *expand(const char *);
61 const char *getdeadletter(void);
62 const char *getname(uid_t);
63 struct message;
64 char *hfield(const char [], const struct message *);
65 FILE *infix(struct header *, FILE *);
66 char *ishfield(const char [], char[], const char *);
67 char *name1(struct message *, int);
68 char *nameof(struct message *, int);
69 const char *nextword(const char *, char *);
70 char *readtty(const char [], char []);
71 char *reedit(char *);
72 FILE *run_editor(FILE *, off_t, int, int);
73 void *salloc(size_t);
74 char *savestr(const char *);
75 FILE *setinput(const struct message *);
76 char *skin(char *);
77 char *skip_comment(char *);
78 char *snarf(char [], int *);
79 const char *username(void);
80 char *value(const char []);
81 char *vcopy(const char []);
82 char *yankword(char *, char []);
83 int Fclose(FILE *);
84 int More(void *);
85 int Pclose(FILE *);
86 int Respond(void *);
87 int Type(void *);
88 int _Respond(int []);
89 int _respond(int *);
90 void alter(char *);
91 int alternates(void *);
92 void announce(void);
93 int append(struct message *, FILE *);
94 int argcount(char **);
95 void assign(const char [], const char []);
96 int bangexp(char *);
97 int blankline(char []);
98 void brokpipe(int);
99 int charcount(char *, int);
100 int check(int, int);
101 void clob1(int);
102 int clobber(void *);
103 void close_all_files(void);
104 int cmatch(const char *, char *);
105 void collhup(int);
106 void collint(int);
107 void collstop(int);
108 void commands(void);
109 int copycmd(void *);
110 int core(void *);
111 int count(struct name *);
112 int delete(void *);
113 int delm(int []);
114 int deltype(void *);
115 void demail(void);
116 int dosh(void *);
117 int dot_lock(const char *, int, FILE *, const char *);
118 void dot_unlock(const char *);
119 int echo(void *);
120 int edit1(int *, int);
121 int editor(void *);
122 void edstop(void);
123 int elsecmd(void *);
124 int endifcmd(void *);
125 int execute(char [], int);
126 int exwrite(const char [], FILE *, int);
127 void fail(const char [], const char []);
128 int file(void *);
129 struct grouphead *
130 findgroup(char []);
131 void findmail(const char *, char *);
132 int first(int, int);
133 void fixhead(struct header *, struct name *);
134 void fmt(const char *, struct name *, FILE *, int);
135 int folders(void *);
136 int forward(char [], FILE *, char *, int);
137 void free_child(int);
138 int from(void *);
139 off_t fsize(FILE *);
140 int getfold(char *);
141 int getmsglist(char *, int *, int);
142 int getrawlist(const char [], char **, int);
143 int getuserid(char []);
144 int grabh(struct header *, int);
145 int group(void *);
146 void hangup(int);
147 int hash(const char *);
148 void hdrstop(int);
149 int headers(void *);
150 int help(void *);
151 void holdsigs(void);
152 int ifcmd(void *);
153 int igfield(void *);
154 int unalias(void *);
155 struct ignoretab;
156 int ignore1(char *[], struct ignoretab *, const char *);
157 int igshow(struct ignoretab *, const char *);
158 void intr(int);
159 int inc(void *);
160 int incfile(void);
161 int isdate(const char []);
162 int isdir(const char []);
163 int isfileaddr(char *);
164 int ishead(const char []);
165 int isign(const char *, struct ignoretab []);
166 int isprefix(char *, const char *);
167 void istrcpy(char *, const char *);
168 const struct cmd *
169 lex(char []);
170 void load(const char *);
171 struct var *
172 lookup(const char []);
173 #ifdef MIME_SUPPORT
174 int mail(struct name *,
175 struct name *, struct name *, struct name *, char *,
176 struct attachment *);
177 #else
178 int mail(struct name *,
179 struct name *, struct name *, struct name *, char *);
180 #endif
181 void mail1(struct header *, int);
182 void makemessage(FILE *, int);
183 void mark(int);
184 int markall(char [], int);
185 int matchsender(char *, int);
186 int matchsubj(char *, int);
187 int mboxit(void *);
188 int member(char *, struct ignoretab *);
189 void mesedit(FILE *, int);
190 void mespipe(FILE *, char []);
191 int messize(void *);
192 int metamess(int, int);
193 int more(void *);
194 int newfileinfo(int);
195 int next(void *);
196 int null(void *);
197 struct headline;
198 void parse(const char [], struct headline *, char []);
199 int pcmdlist(void *);
200 int pdot(void *);
201 int pipecmd(void *);
202 void prepare_child(sigset_t *, int, int);
203 int preserve(void *);
204 void prettyprint(struct name *);
205 void printgroup(char []);
206 void printhead(int);
207 int puthead(struct header *, FILE *, int);
208 int putline(FILE *, const char *, int);
209 int pversion(void *);
210 void quit(void);
211 int quitcmd(void *);
212 int upcase(int);
213 int mail_readline(FILE *, char *, int);
214 void register_file(FILE *, int, int);
215 void regret(int);
216 void relsesigs(void);
217 int respond(void *);
218 int retfield(void *);
219 int rexit(void *);
220 int rm(char *);
221 int run_command(const char *, sigset_t *, int, int, ...);
222 int save(void *);
223 int Save(void *);
224 int save1(char [], int, const char *, struct ignoretab *);
225 void savedeadletter(FILE *);
226 int saveigfield(void *);
227 int savemail(const char [], FILE *);
228 int saveretfield(void *);
229 int scan(char **);
230 void scaninit(void);
231 int schdir(void *);
232 int screensize(void);
233 int scroll(void *);
234 #ifdef MIME_SUPPORT
235 int sendmessage(struct message *, FILE *, struct ignoretab *,
236 const char *, struct mime_info *);
237 #else
238 int sendmessage(struct message *, FILE *, struct ignoretab *,
239 const char *);
240 #endif
241 int sendmail(void *);
242 int set(void *);
243 int setfile(const char *);
244 void setmsize(int);
245 void setptr(FILE *, off_t);
246 void setscreensize(void);
247 int shell(void *);
248 int show(void *);
249 void sigchild(int);
250 void sort(char **);
251 int source(void *);
252 void spreserve(void);
253 void sreset(void);
254 int start_command(const char *, sigset_t *, int, int, ...);
255 void statusput(struct message *, FILE *, const char *);
256 void stop(int);
257 int stouch(void *);
258 int swrite(void *);
259 void tinit(void);
260 int top(void *);
261 void touch(struct message *);
262 void ttyint(int);
263 void ttystop(int);
264 int type(void *);
265 #ifdef MIME_SUPPORT
266 int view(void *);
267 int View(void *);
268 int page(void *);
269 int Page(void *);
270 int print(void *);
271 int Print(void *);
272 int type1(int *, int, int, int);
273 #else
274 int type1(int *, int, int);
275 #endif
276 int undeletecmd(void *);
277 void unmark(int);
278 const char **unpack(struct name *);
279 int unread(void *);
280 void unregister_file(FILE *);
281 int unset(void *);
282 int unstack(void);
283 void v_free(char *);
284 int visual(void *);
285 int wait_child(int);
286 int wait_command(int);
287 int writeback(FILE *);
288
289 #ifdef MIME_SUPPORT
290 FILE *last_registered_file(int);
291 void close_top_files(FILE *);
292 void flush_files(FILE *, int);
293 #endif
294
295 #ifdef SMOPTS_CMD
296 int smoptscmd(void *);
297 int unsmopts(void *);
298 struct smopts_s *findsmopts(const char *, int);
299 #endif
300
301 int get_Hflag(char **);
302 int show_headers(int) __attribute__((__noreturn__));
303 int markread(void *);
304
305 extern const char *version;
306 extern char *tmpdir;
307 extern const struct cmd cmdtab[];
308 extern int wait_status;
309
310 #endif /* __EXTERN_H__ */
311