xref: /dragonfly/usr.bin/mail/extern.h (revision 7ce1da6a)
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. Neither the name of the University nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  *	@(#)extern.h	8.2 (Berkeley) 4/20/95
30  *
31  * $FreeBSD: src/usr.bin/mail/extern.h,v 1.3.6.3 2003/01/06 05:46:03 mikeh Exp $
32  */
33 
34 struct name *cat(struct name *, struct name *);
35 struct name *delname(struct name *, char []);
36 struct name *elide(struct name *);
37 struct name *extract(char [], int);
38 struct name *gexpand(struct name *, struct grouphead *, int, int);
39 struct name *nalloc(char [], int);
40 struct name *outof(struct name *, FILE *, struct header *);
41 struct name *put(struct name *, struct name *);
42 struct name *tailof(struct name *);
43 struct name *usermap(struct name *);
44 FILE	*Fdopen(int, const char *);
45 FILE	*Fopen(const char *, const char *);
46 FILE	*Popen(char *, const char *);
47 FILE	*collect(struct header *, int);
48 char	*copyin(char *, char **);
49 char	*detract(struct name *, int);
50 char	*expand(char *);
51 char	*getdeadletter(void);
52 char	*getname(int);
53 char	*hfield(const char *, struct message *);
54 FILE	*infix(struct header *, FILE *);
55 char	*ishfield(char [], char *, const char *);
56 char	*name1(struct message *, int);
57 char	*nameof(struct message *, int);
58 char	*nextword(char *, char *);
59 char	*readtty(const char *, char []);
60 char 	*reedit(char *);
61 FILE	*run_editor(FILE *, off_t, int, int);
62 char	*salloc(int);
63 char	*savestr(char *);
64 FILE	*setinput(struct message *);
65 char	*skin(char *);
66 char	*skip_comment(char *);
67 char	*snarf(char [], int *);
68 char	*username(void);
69 char	*value(const char *);
70 char	*vcopy(const char *);
71 char	*yankword(char *, char []);
72 char	*yanklogin(char *, char []);
73 int	 Fclose(FILE *);
74 int	 More(int *);
75 int	 Pclose(FILE *);
76 int	 Respond(int *);
77 int	 Type(int *);
78 int	 doRespond(int []);
79 int	 dorespond(int *);
80 void	 alter(char *);
81 int	 alternates(char **);
82 void	 announce(void);
83 int	 append(struct message *, FILE *);
84 int	 argcount(char **);
85 void	 assign(const char *, const char *);
86 int	 bangexp(char *, size_t);
87 void	 brokpipe(int) __dead2;
88 int	 charcount(char *, int);
89 int	 check(int, int);
90 void	 clob1(int);
91 int	 clobber(char **);
92 void	 close_all_files(void);
93 int	 cmatch(char *, char *);
94 void	 collhup(int) __dead2;
95 void	 collint(int);
96 void	 collstop(int);
97 void	 commands(void);
98 int	 copycmd(char []);
99 int	 core(void);
100 int	 count(struct name *);
101 int	 delete(int []);
102 int	 delm(int []);
103 int	 deltype(int []);
104 void	 demail(void);
105 int	 diction(const void *, const void *);
106 int	 dosh(char *);
107 int	 echo(char **);
108 int	 edit1(int *, int);
109 int	 editor(int *);
110 int	 elsecmd(void);
111 int	 endifcmd(void);
112 int	 evalcol(int);
113 int	 execute(char [], int);
114 int	 exwrite(char [], FILE *, int);
115 void	 fail(const char *, const char *);
116 int	 file(char **);
117 struct grouphead *
118 	 findgroup(char []);
119 void	 findmail(char *, char *, int);
120 int	 first(int, int);
121 void	 fixhead(struct header *, struct name *);
122 void	 fmt(const char *, struct name *, FILE *, int);
123 int	 folders(void);
124 int	 forward(char [], FILE *, char *, int);
125 void	 free_child(int);
126 int	 from(int *);
127 off_t	 fsize(FILE *);
128 int	 getfold(char *, int);
129 int	 gethfield(FILE *, char [], int, char **);
130 int	 getmsglist(char *, int *, int);
131 int	 getrawlist(char [], char **, int);
132 int	 getuserid(char []);
133 int	 grabh(struct header *, int);
134 int	 group(char **);
135 void	 hangup(int) __dead2;
136 int	 hash(const char *);
137 void	 hdrstop(int) __dead2;
138 int	 headers(int *);
139 int	 help(void);
140 void	 holdsigs(void);
141 int	 ifcmd(char **);
142 int	 igcomp(const void *, const void *);
143 int	 igfield(char *[]);
144 int	 ignore1(char *[], struct ignoretab *, const char *);
145 int	 igshow(struct ignoretab *, const char *);
146 int	 inc(void *);
147 int	 incfile(void);
148 void	 intr(int) __dead2;
149 int	 isdate(char []);
150 int	 isdir(char []);
151 int	 isfileaddr(char *);
152 int	 ishead(char []);
153 int	 isign(const char *, struct ignoretab []);
154 int	 isprefix(const char *, const char *);
155 void	 istrncpy(char *, const char *, size_t);
156 const struct cmd *
157 	 lex(char []);
158 void	 load(char *);
159 struct var *
160 	 lookup(const char *);
161 int	 mail(struct name *,
162 	    struct name *, struct name *, struct name *, char *, char *);
163 void	 mail1(struct header *, int);
164 void	 makemessage(FILE *, int);
165 int	 markall(char [], int);
166 int	 matchsender(char *, int);
167 int	 matchfield(char *, int);
168 int	 mboxit(int []);
169 int	 member(char *, struct ignoretab *);
170 void	 mesedit(FILE *, int);
171 void	 mespipe(FILE *, char []);
172 int	 messize(int *);
173 int	 metamess(int, int);
174 int	 more(int *);
175 int	 newfileinfo(int);
176 int	 next(int *);
177 int	 null(int);
178 void	 parse(char [], struct headline *, char []);
179 int	 pcmdlist(void);
180 int	 pdot(void);
181 void	 prepare_child(sigset_t *, int, int);
182 int	 preserve(int *);
183 void	 prettyprint(struct name *);
184 void	 printgroup(char []);
185 void	 printhead(int);
186 int	 puthead(struct header *, FILE *, int);
187 int	 putline(FILE *, char *, int);
188 int	 pversion(int);
189 void	 quit(void);
190 int	 quitcmd(void);
191 int	 readline(FILE *, char *, int);
192 void	 register_file(FILE *, int, int);
193 void	 regret(int);
194 void	 relsesigs(void);
195 int	 respond(int *);
196 int	 retfield(char *[]);
197 int	 rexit(int);
198 int	 rm(char *);
199 int	 run_command(char *, sigset_t *, int, int, char *, char *, char *);
200 int	 save(char []);
201 int	 save1(char [], int, const char *, struct ignoretab *);
202 void	 savedeadletter(FILE *);
203 int	 saveigfield(char *[]);
204 int	 savemail(char [], FILE *);
205 int	 saveretfield(char *[]);
206 int	 scan(char **);
207 void	 scaninit(void);
208 int	 schdir(char **);
209 int	 screensize(void);
210 int	 scroll(char []);
211 int	 sendmessage(struct message *, FILE *, struct ignoretab *, char *);
212 int	 sendmail(char *);
213 int	 set(char **);
214 int	 setfile(char *);
215 void	 setmsize(int);
216 void	 setptr(FILE *, off_t);
217 void	 setscreensize(void);
218 int	 shell(char *);
219 void	 sigchild(int);
220 void	 sort(char **);
221 int	 source(char **);
222 void	 spreserve(void);
223 void	 sreset(void);
224 int	 start_command(char *, sigset_t *, int, int, char *, char *, char *);
225 void	 statusput(struct message *, FILE *, char *);
226 void	 stop(int);
227 int	 stouch(int []);
228 int	 swrite(char []);
229 void	 tinit(void);
230 int	 top(int *);
231 void	 touch(struct message *);
232 void	 ttyint(int) __dead2;
233 void	 ttystop(int) __dead2;
234 int	 type(int *);
235 int	 type1(int *, int, int);
236 int	 undelete_messages(int *);
237 char	**unpack(struct name *);
238 int	 unread(int []);
239 void	 unregister_file(FILE *);
240 int	 unset(char **);
241 int	 unstack(void);
242 void	 vfree(char *);
243 int	 visual(int *);
244 int	 wait_child(int);
245 int	 wait_command(int);
246 
247 extern char *tmpdir;
248