1 /* $OpenBSD: extern.h,v 1.21 2003/06/03 02:56:11 millert Exp $ */ 2 /* $NetBSD: extern.h,v 1.7 1997/07/09 05:22:00 mikel Exp $ */ 3 4 /*- 5 * Copyright (c) 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. Neither the name of the University nor the names of its contributors 17 * may be used to endorse or promote products derived from this software 18 * without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)extern.h 8.2 (Berkeley) 4/20/95 33 * $OpenBSD: extern.h,v 1.21 2003/06/03 02:56:11 millert Exp $ 34 */ 35 36 struct name; 37 struct name *cat(struct name *, struct name *); 38 struct name *delname(struct name *, char *); 39 struct name *elide(struct name *); 40 struct name *extract(char *, int); 41 struct grouphead; 42 struct name *gexpand(struct name *, struct grouphead *, int, int); 43 struct name *nalloc(char *, int); 44 struct header; 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, char *); 50 FILE *Fopen(char *, char *); 51 FILE *Popen(char *, char *); 52 FILE *collect(struct header *, int); 53 char *copy(char *, char *); 54 char *copyin(char *, char **); 55 char *detract(struct name *, int); 56 char *expand(char *); 57 char *getdeadletter(void); 58 char *getname(uid_t); 59 struct message; 60 char *hfield(char *, struct message *); 61 FILE *infix(struct header *, FILE *); 62 char *ishfield(char *, char *, char *); 63 char *name1(struct message *, int); 64 char *nameof(struct message *, int); 65 char *nextword(char *, char *); 66 char *readtty(char *, char *); 67 char *reedit(char *); 68 FILE *run_editor(FILE *, off_t, int, int); 69 char *salloc(int); 70 char *savestr(char *); 71 FILE *setinput(struct message *); 72 char *skin(char *); 73 char *skip_comment(char *); 74 char *snarf(char *, int *); 75 char *username(void); 76 char *value(char *); 77 char *vcopy(char *); 78 char *yankword(char *, char *); 79 int Fclose(FILE *); 80 int More(void *); 81 int Pclose(FILE *); 82 int Respond(void *); 83 int Type(void *); 84 int _Respond(int *); 85 int _respond(int *); 86 void alter(char *); 87 int alternates(void *); 88 void announce(void); 89 int append(struct message *, FILE *); 90 int argcount(char **); 91 void assign(char *, char *); 92 int bangexp(char *, size_t); 93 int blankline(char *); 94 int charcount(char *, int); 95 int check(int, int); 96 void clearnew(void); 97 void clob1(int); 98 int clobber(void *); 99 void close_all_files(void); 100 int cmatch(char *, char *); 101 int collabort(void); 102 void commands(void); 103 int copycmd(void *); 104 int core(void *); 105 int count(struct name *); 106 int delete(void *); 107 int delm(int *); 108 int deltype(void *); 109 void demail(void); 110 void dointr(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 int edstop(void); 118 int elsecmd(void *); 119 int endifcmd(void *); 120 int evalcol(int); 121 int execute(char *, int); 122 int exwrite(char *, FILE *, int); 123 void fail(char *, char *); 124 int file(void *); 125 struct grouphead * 126 findgroup(char *); 127 void findmail(char *, char *, int); 128 void fioint(int); 129 int first(int, int); 130 void fixhead(struct header *, struct name *); 131 void fmt(char *, struct name *, FILE *, int); 132 int folders(void *); 133 int forward(char *, FILE *, char *, int); 134 void free_child(pid_t); 135 int from(void *); 136 off_t fsize(FILE *); 137 int getfold(char *, int); 138 int gethfield(FILE *, char *, int, char **); 139 int gethfromtty(struct header *, int); 140 int getmsglist(char *, int *, int); 141 int getrawlist(char *, char **, int); 142 uid_t getuserid(char *); 143 int grabh(struct header *, int); 144 int group(void *); 145 int hash(char *); 146 void hdrint(int); 147 int headers(void *); 148 int help(void *); 149 void holdsigs(void); 150 int ifcmd(void *); 151 int igfield(void *); 152 struct ignoretab; 153 int ignore1(char **, struct ignoretab *, char *); 154 int ignoresig(int, struct sigaction *, sigset_t *); 155 int igshow(struct ignoretab *, char *); 156 void intr(int); 157 int inc(void *); 158 int incfile(void); 159 int isdate(char *); 160 int isdir(char *); 161 int isfileaddr(char *); 162 int ishead(char *); 163 int isign(char *, struct ignoretab *); 164 int isprefix(char *, char *); 165 size_t istrlcpy(char *, const char *, size_t); 166 const struct cmd * 167 lex(char *); 168 void load(char *); 169 struct var * 170 lookup(char *); 171 int mail (struct name *, struct name *, struct name *, struct name *, 172 char *); 173 void mail1(struct header *, int); 174 void makemessage(FILE *, int); 175 void mark(int); 176 int markall(char *, int); 177 int marknew(void *); 178 int matchsender(char *, int); 179 int matchsubj(char *, int); 180 int mboxit(void *); 181 int member(char *, struct ignoretab *); 182 void mesedit(FILE *, int); 183 void mespipe(FILE *, char *); 184 int messize(void *); 185 int metamess(int, int); 186 int more(void *); 187 int newfileinfo(int); 188 int next(void *); 189 int null(void *); 190 struct headline; 191 void parse(char *, struct headline *, char *); 192 int pcmdlist(void *); 193 int pdot(void *); 194 int pipeit(void *, void *); 195 void prepare_child(sigset_t *, int, int); 196 int preserve(void *); 197 void prettyprint(struct name *); 198 void printgroup(char *); 199 void printhead(int); 200 int puthead(struct header *, FILE *, int); 201 int putline(FILE *, char *, int); 202 int pversion(void *); 203 int quit(void); 204 int quitcmd(void *); 205 int raise(int); 206 int readline(FILE *, char *, int, int *); 207 void register_file(FILE *, int, pid_t); 208 void regret(int); 209 void relsesigs(void); 210 int respond(void *); 211 int retfield(void *); 212 int rexit(void *); 213 int rm(char *); 214 int run_command(char *cmd, sigset_t *nset, int infd, int outfd, ...); 215 int save(void *); 216 int save1(char *, int, char *, struct ignoretab *); 217 void savedeadletter(FILE *); 218 int saveigfield(void *); 219 int savemail(char *, FILE *); 220 int saveretfield(void *); 221 int scan(char **); 222 void scaninit(void); 223 int schdir(void *); 224 int screensize(void); 225 int scroll(void *); 226 void sendint(int); 227 int sendmessage(struct message *, FILE *, struct ignoretab *, char *); 228 int sendmail(void *); 229 int set(void *); 230 int setfile(char *); 231 void setmsize(int); 232 void setptr(FILE *, off_t); 233 void setscreensize(void); 234 int shell(void *); 235 void sigchild(int); 236 void sort(char **); 237 int source(void *); 238 int spool_lock(void); 239 int spool_unlock(void); 240 void spreserve(void); 241 void sreset(void); 242 pid_t start_command(char *cmd, sigset_t *nset, int infd, int outfd, ...); 243 pid_t start_commandv(char *, sigset_t *, int, int, _BSD_VA_LIST_); 244 int statusput(struct message *, FILE *, char *); 245 void stop(int); 246 int stouch(void *); 247 int swrite(void *); 248 void tinit(void); 249 int top(void *); 250 void touch(struct message *); 251 void ttyint(int); 252 void ttystop(int); 253 int type(void *); 254 int type1(int *, char *, int, int); 255 int undeletecmd(void *); 256 void unmark(int); 257 char **unpack(struct name *, struct name *); 258 int unread(void *); 259 void unregister_file(FILE *); 260 int unset(void *); 261 int unstack(void); 262 void vfree(char *); 263 int visual(void *); 264 int wait_child(pid_t); 265 int wait_command(int); 266 int writeback(FILE *); 267 268 extern char *__progname; 269 extern char *tmpdir; 270 extern const struct cmd *com; /* command we are running */ 271