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