xref: /netbsd-src/usr.bin/mail/extern.h (revision d48f14661dda8638fee055ba15d35bdfb29b9fa8)
1 /*	$NetBSD: extern.h,v 1.23 2006/03/03 13:36:27 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.23 2006/03/03 13:36:27 christos Exp $
33  */
34 
35 struct name;
36 struct name *cat(struct name *, struct name *);
37 struct name *delname(struct name *, char []);
38 struct name *elide(struct name *);
39 struct name *extract(char [], int);
40 struct grouphead;
41 struct name *gexpand(struct name *, struct grouphead *, int, int);
42 struct name *nalloc(char [], int);
43 struct header;
44 struct name *outof(struct name *, FILE *, struct header *);
45 struct name *put(struct name *, struct name *);
46 struct name *tailof(struct name *);
47 struct name *usermap(struct name *);
48 FILE	*Fdopen(int, const char *);
49 FILE	*Fopen(const char *, const char *);
50 FILE	*Popen(const char *, const char *);
51 FILE	*collect(struct header *, int);
52 char	*copy(char *, char *);
53 char	*copyin(const char *, char **);
54 char	*detract(struct name *, int);
55 const char *expand(const char *);
56 const char *getdeadletter(void);
57 const	char *getname(uid_t);
58 struct message;
59 char	*hfield(const char [], const struct message *);
60 FILE	*infix(struct header *, FILE *);
61 char	*ishfield(const char [], char[], const char *);
62 char	*name1(struct message *, int);
63 char	*nameof(struct message *, int);
64 const char	*nextword(const char *, char *);
65 char	*readtty(const char [], char []);
66 char 	*reedit(char *);
67 FILE	*run_editor(FILE *, off_t, int, int);
68 void	*salloc(size_t);
69 char	*savestr(const char *);
70 FILE	*setinput(const struct message *);
71 char	*skin(char *);
72 char	*skip_comment(char *);
73 char	*snarf(char [], int *);
74 const	char *username(void);
75 char	*value(const char []);
76 char	*vcopy(const char []);
77 char	*yankword(char *, char []);
78 int	 Fclose(FILE *);
79 int	 More(void *);
80 int	 Pclose(FILE *);
81 int	 Respond(void *);
82 int	 Type(void *);
83 int	 _Respond(int []);
84 int	 _respond(int *);
85 void	 alter(char *);
86 int	 alternates(void *);
87 void	 announce(void);
88 int	 append(struct message *, FILE *);
89 int	 argcount(char **);
90 void	 assign(const char [], const char []);
91 int	 bangexp(char *);
92 int	 blankline(char []);
93 void	 brokpipe(int);
94 int	 charcount(char *, int);
95 int	 check(int, int);
96 void	 clob1(int);
97 int	 clobber(void *);
98 void	 close_all_files(void);
99 int	 cmatch(const char *, char *);
100 void	 collhup(int);
101 void	 collint(int);
102 void	 collstop(int);
103 void	 commands(void);
104 int	 copycmd(void *);
105 int	 core(void *);
106 int	 count(struct name *);
107 int	 delete(void *);
108 int	 delm(int []);
109 int	 deltype(void *);
110 void	 demail(void);
111 int	 dosh(void *);
112 int	 dot_lock(const char *, int, FILE *, const char *);
113 void	 dot_unlock(const char *);
114 int	 echo(void *);
115 int	 edit1(int *, int);
116 int	 editor(void *);
117 void	 edstop(void);
118 int	 elsecmd(void *);
119 int	 endifcmd(void *);
120 int	 evalcol(int);
121 int	 execute(char [], int);
122 int	 exwrite(const char [], FILE *, int);
123 void	 fail(const char [], const char []);
124 int	 file(void *);
125 struct grouphead *
126 	 findgroup(char []);
127 void	 findmail(const char *, char *);
128 int	 first(int, int);
129 void	 fixhead(struct header *, struct name *);
130 void	 fmt(const char *, struct name *, FILE *, int);
131 int	 folders(void *);
132 int	 forward(char [], FILE *, char *, int);
133 void	 free_child(int);
134 int	 from(void *);
135 off_t	 fsize(FILE *);
136 int	 getfold(char *);
137 int	 gethfield(FILE *, char [], int, char **);
138 int	 getmsglist(char *, int *, int);
139 int	 getrawlist(const char [], char **, int);
140 int	 getuserid(char []);
141 int	 grabh(struct header *, int);
142 int	 group(void *);
143 void	 hangup(int);
144 int	 hash(const char *);
145 void	 hdrstop(int);
146 int	 headers(void *);
147 int	 help(void *);
148 void	 holdsigs(void);
149 int	 ifcmd(void *);
150 int	 igfield(void *);
151 int	 unalias(void *);
152 struct ignoretab;
153 int	 ignore1(char *[], struct ignoretab *, const char *);
154 int	 igshow(struct ignoretab *, const char *);
155 void	 intr(int);
156 int	 inc(void *);
157 int	 incfile(void);
158 int	 isdate(const char []);
159 int	 isdir(const char []);
160 int	 isfileaddr(char *);
161 int	 ishead(const char []);
162 int	 isign(const char *, struct ignoretab []);
163 int	 isprefix(char *, const char *);
164 void	 istrcpy(char *, const char *);
165 const struct cmd *
166 	 lex(char []);
167 void	 load(const char *);
168 struct var *
169 	 lookup(const char []);
170 int	 mail(struct name *,
171 	      struct name *, struct name *, struct name *, char *);
172 void	 mail1(struct header *, int);
173 void	 makemessage(FILE *, int);
174 void	 mark(int);
175 int	 markall(char [], int);
176 int	 matchsender(char *, int);
177 int	 matchsubj(char *, int);
178 int	 mboxit(void *);
179 int	 member(char *, struct ignoretab *);
180 void	 mesedit(FILE *, int);
181 void	 mespipe(FILE *, char []);
182 int	 messize(void *);
183 int	 metamess(int, int);
184 int	 more(void *);
185 int	 newfileinfo(int);
186 int	 next(void *);
187 int	 null(void *);
188 struct headline;
189 void	 parse(const char [], struct headline *, char []);
190 int	 pcmdlist(void *);
191 int	 pdot(void *);
192 void	 prepare_child(sigset_t *, int, int);
193 int	 preserve(void *);
194 void	 prettyprint(struct name *);
195 void	 printgroup(char []);
196 void	 printhead(int);
197 int	 puthead(struct header *, FILE *, int);
198 int	 putline(FILE *, const char *, int);
199 int	 pversion(void *);
200 void	 quit(void);
201 int	 quitcmd(void *);
202 int	 upcase(int);
203 int	 readline(FILE *, char *, int);
204 void	 register_file(FILE *, int, int);
205 void	 regret(int);
206 void	 relsesigs(void);
207 int	 respond(void *);
208 int	 retfield(void *);
209 int	 rexit(void *);
210 int	 rm(char *);
211 int	 run_command(const char *, sigset_t *, int, int, ...);
212 int	 save(void *);
213 int	 Save(void *);
214 int	 save1(char [], int, const char *, struct ignoretab *);
215 void	 savedeadletter(FILE *);
216 int	 saveigfield(void *);
217 int	 savemail(const char [], FILE *);
218 int	 saveretfield(void *);
219 int	 scan(char **);
220 void	 scaninit(void);
221 int	 schdir(void *);
222 int	 screensize(void);
223 int	 scroll(void *);
224 int	 sendmessage(struct message *, FILE *, struct ignoretab *,
225     const char *);
226 int	 sendmail(void *);
227 int	 set(void *);
228 int	 setfile(const char *);
229 void	 setmsize(int);
230 void	 setptr(FILE *, off_t);
231 void	 setscreensize(void);
232 int	 shell(void *);
233 void	 sigchild(int);
234 void	 sort(char **);
235 int	 source(void *);
236 void	 spreserve(void);
237 void	 sreset(void);
238 int	 start_command(const char *, sigset_t *, int, int, ...);
239 void	 statusput(struct message *, FILE *, const 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 *, int, int);
250 int	 undeletecmd(void *);
251 void	 unmark(int);
252 const char **unpack(struct name *);
253 int	 unread(void *);
254 void	 unregister_file(FILE *);
255 int	 unset(void *);
256 int	 unstack(void);
257 void	 v_free(char *);
258 int	 visual(void *);
259 int	 wait_child(int);
260 int	 wait_command(int);
261 int	 writeback(FILE *);
262 
263 extern const char *version;
264 extern char *tmpdir;
265 extern const struct cmd cmdtab[];
266 extern int wait_status;
267