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