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