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