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