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