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