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