Home | History | Annotate | Line # | Download | only in mail
extern.h revision 1.27
      1  1.25  christos /*	$NetBSD: extern.h,v 1.27 2006/11/28 18:45:32 christos Exp $	*/
      2   1.4  christos 
      3   1.1   deraadt /*-
      4   1.1   deraadt  * Copyright (c) 1992, 1993
      5   1.1   deraadt  *	The Regents of the University of California.  All rights reserved.
      6   1.1   deraadt  *
      7   1.1   deraadt  * Redistribution and use in source and binary forms, with or without
      8   1.1   deraadt  * modification, are permitted provided that the following conditions
      9   1.1   deraadt  * are met:
     10   1.1   deraadt  * 1. Redistributions of source code must retain the above copyright
     11   1.1   deraadt  *    notice, this list of conditions and the following disclaimer.
     12   1.1   deraadt  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1   deraadt  *    notice, this list of conditions and the following disclaimer in the
     14   1.1   deraadt  *    documentation and/or other materials provided with the distribution.
     15  1.18       agc  * 3. Neither the name of the University nor the names of its contributors
     16   1.1   deraadt  *    may be used to endorse or promote products derived from this software
     17   1.1   deraadt  *    without specific prior written permission.
     18   1.1   deraadt  *
     19   1.1   deraadt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     20   1.1   deraadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21   1.1   deraadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22   1.1   deraadt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     23   1.1   deraadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24   1.1   deraadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25   1.1   deraadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26   1.1   deraadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27   1.1   deraadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28   1.1   deraadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29   1.1   deraadt  * SUCH DAMAGE.
     30   1.1   deraadt  *
     31   1.5       tls  *	@(#)extern.h	8.2 (Berkeley) 4/20/95
     32  1.25  christos  *	$NetBSD: extern.h,v 1.27 2006/11/28 18:45:32 christos Exp $
     33   1.1   deraadt  */
     34   1.1   deraadt 
     35  1.26  christos #ifndef __EXTERN_H__
     36  1.26  christos #define __EXTERN_H__
     37  1.26  christos 
     38  1.27  christos /*
     39  1.27  christos  * from cmd1.c
     40  1.27  christos  */
     41  1.13       wiz int	 More(void *);
     42  1.13       wiz int	 Type(void *);
     43  1.27  christos int	 folders(void *);
     44  1.27  christos int	 from(void *);
     45  1.27  christos int	 headers(void *);
     46  1.27  christos int	 inc(void *);
     47  1.27  christos int	 mboxit(void *);
     48  1.27  christos int	 more(void *);
     49  1.27  christos int	 pcmdlist(void *);
     50  1.27  christos int	 pdot(void *);
     51  1.27  christos int	 pipecmd(void *);
     52  1.27  christos int	 scroll(void *);
     53  1.27  christos int	 stouch(void *);
     54  1.27  christos int	 top(void *);
     55  1.27  christos int	 type(void *);
     56  1.27  christos #ifdef MIME_SUPPORT
     57  1.27  christos int	 page(void *);
     58  1.27  christos int	 Page(void *);
     59  1.27  christos int	 print(void *);
     60  1.27  christos int	 Print(void *);
     61  1.27  christos int	 view(void *);
     62  1.27  christos int	 View(void *);
     63  1.27  christos #endif
     64  1.27  christos /* XXX - should these be elsewhere? */
     65  1.27  christos void	 printhead(int);
     66  1.27  christos char	*sget_msgnum(struct message *, struct message *);
     67  1.27  christos void	 show_msgnum(FILE *, struct message *, struct message *);
     68  1.27  christos 
     69  1.27  christos /*
     70  1.27  christos  * from cmd2.c
     71  1.27  christos  */
     72  1.27  christos int	 Detach(void *);
     73  1.27  christos int	 Save(void *);
     74  1.13       wiz int	 clobber(void *);
     75  1.13       wiz int	 copycmd(void *);
     76  1.13       wiz int	 core(void *);
     77  1.13       wiz int	 delete(void *);
     78  1.13       wiz int	 deltype(void *);
     79  1.27  christos int	 detach(void *);
     80  1.27  christos int	 igfield(void *);
     81  1.27  christos int	 next(void *);
     82  1.27  christos int	 retfield(void *);
     83  1.27  christos int	 save(void *);
     84  1.27  christos int	 saveigfield(void *);
     85  1.27  christos int	 saveretfield(void *);
     86  1.27  christos int	 swrite(void *);
     87  1.27  christos int	 undeletecmd(void *);
     88  1.27  christos 
     89  1.27  christos /*
     90  1.27  christos  * from cmd3.c
     91  1.27  christos  */
     92  1.27  christos int	 Respond(void *);
     93  1.27  christos int	 alternates(void *);
     94  1.13       wiz int	 dosh(void *);
     95  1.13       wiz int	 echo(void *);
     96  1.13       wiz int	 elsecmd(void *);
     97  1.13       wiz int	 endifcmd(void *);
     98  1.13       wiz int	 file(void *);
     99  1.13       wiz int	 group(void *);
    100  1.13       wiz int	 help(void *);
    101  1.13       wiz int	 ifcmd(void *);
    102  1.27  christos int	 ifdefcmd(void *v);
    103  1.27  christos int	 ifndefcmd(void *v);
    104  1.27  christos int	 markread(void *);
    105  1.13       wiz int	 messize(void *);
    106  1.13       wiz int	 null(void *);
    107  1.13       wiz int	 preserve(void *);
    108  1.13       wiz int	 respond(void *);
    109  1.13       wiz int	 rexit(void *);
    110  1.13       wiz int	 schdir(void *);
    111  1.13       wiz int	 set(void *);
    112  1.13       wiz int	 shell(void *);
    113  1.24  christos int	 show(void *);
    114  1.27  christos int	 unalias(void *);
    115  1.13       wiz int	 unread(void *);
    116  1.13       wiz int	 unset(void *);
    117  1.27  christos /* XXX - Should this be elsewhere? */
    118  1.27  christos void	 sort(const char **);
    119  1.27  christos 
    120  1.27  christos /*
    121  1.27  christos  * from cmd4.c
    122  1.27  christos  */
    123  1.27  christos struct smopts_s *findsmopts(const char *, int);
    124  1.27  christos int	smoptscmd(void *);
    125  1.27  christos int	unsmoptscmd(void *);
    126  1.27  christos 
    127  1.27  christos /*
    128  1.27  christos  * from cmdtab.c
    129  1.27  christos  */
    130  1.27  christos extern const struct cmd cmdtab[];
    131  1.27  christos 
    132  1.27  christos /*
    133  1.27  christos  * from collect.c
    134  1.27  christos  */
    135  1.27  christos FILE	*collect(struct header *, int);
    136  1.27  christos void	 savedeadletter(FILE *);
    137  1.27  christos 
    138  1.27  christos /*
    139  1.27  christos  * from dotlock.c
    140  1.27  christos  */
    141  1.27  christos int	 dot_lock(const char *, int, FILE *, const char *);
    142  1.27  christos void	 dot_unlock(const char *);
    143  1.27  christos 
    144  1.27  christos /*
    145  1.27  christos  * from edit.c
    146  1.27  christos  */
    147  1.27  christos int	 editor(void *);
    148  1.13       wiz int	 visual(void *);
    149  1.27  christos FILE	*run_editor(FILE *, off_t, int, int);
    150  1.27  christos 
    151  1.27  christos /*
    152  1.27  christos  * from fio.c
    153  1.27  christos  */
    154  1.27  christos const char *expand(const char *);
    155  1.27  christos off_t	 fsize(FILE *);
    156  1.27  christos const char *getdeadletter(void);
    157  1.27  christos int	 getfold(char *, size_t);
    158  1.27  christos void	 holdsigs(void);
    159  1.27  christos int	 mail_readline(FILE *, char *, int);
    160  1.27  christos int	 putline(FILE *, const char *, int);
    161  1.27  christos void	 relsesigs(void);
    162  1.27  christos int	 rm(char *);
    163  1.27  christos FILE	*setinput(const struct message *);
    164  1.27  christos void	 setptr(FILE *, off_t);
    165  1.27  christos 
    166  1.27  christos /*
    167  1.27  christos  * from getname.c
    168  1.27  christos  */
    169  1.27  christos const char *getname(uid_t);
    170  1.27  christos int	 getuserid(char []);
    171  1.27  christos 
    172  1.27  christos /*
    173  1.27  christos  * from head.c
    174  1.27  christos  */
    175  1.27  christos int	 ishead(const char []);
    176  1.27  christos void	 parse(const char [], struct headline *, char []);
    177  1.27  christos 
    178  1.27  christos /*
    179  1.27  christos  * from lex.c
    180  1.27  christos  */
    181  1.27  christos void	 announce(void);
    182  1.27  christos void	 commands(void);
    183  1.27  christos int	 execute(char [], int);
    184  1.27  christos int	 incfile(void);
    185  1.27  christos const struct cmd *lex(char []);
    186  1.27  christos void	 load(const char *);
    187  1.27  christos int	 newfileinfo(int);
    188  1.27  christos int	 pversion(void *);
    189  1.27  christos int	 setfile(const char *);
    190  1.27  christos char	*shellpr(char *);
    191  1.27  christos char	*get_cmdname(char *);
    192  1.27  christos 
    193  1.27  christos /*
    194  1.27  christos  * from list.c
    195  1.27  christos  */
    196  1.27  christos int	 first(int, int);
    197  1.27  christos int	 get_Hflag(char **);
    198  1.27  christos int	 getmsglist(char *, int *, int);
    199  1.27  christos int	 getrawlist(const char [], char **, int);
    200  1.27  christos int	 show_headers_and_exit(int) __attribute__((__noreturn__));
    201  1.27  christos 
    202  1.27  christos /*
    203  1.27  christos  * from main.c
    204  1.27  christos  */
    205  1.27  christos struct name *lexpand(char *, int);
    206  1.27  christos void	 setscreensize(void);
    207  1.27  christos int	 main(int, char **);
    208  1.27  christos 
    209  1.27  christos /*
    210  1.27  christos  * from names.c
    211  1.27  christos  */
    212  1.27  christos struct name *cat(struct name *, struct name *);
    213  1.27  christos int	 count(struct name *);
    214  1.27  christos struct name *delname(struct name *, char []);
    215  1.27  christos char	*detract(struct name *, int);
    216  1.27  christos struct name *elide(struct name *);
    217  1.27  christos struct name *extract(char [], int);
    218  1.27  christos struct name *gexpand(struct name *, struct grouphead *, int, int);
    219  1.27  christos struct name *nalloc(char [], int);
    220  1.27  christos struct name *outof(struct name *, FILE *, struct header *);
    221  1.27  christos const char **unpack(struct name *);
    222  1.27  christos struct name *usermap(struct name *);
    223  1.27  christos #if 0
    224  1.27  christos void	 prettyprint(struct name *);	/* commented out? */
    225  1.27  christos #endif
    226  1.27  christos 
    227  1.27  christos /*
    228  1.27  christos  * from popen.c
    229  1.27  christos  */
    230  1.27  christos int	 Fclose(FILE *);
    231  1.27  christos FILE	*Fdopen(int, const char *);
    232  1.27  christos FILE	*Fopen(const char *, const char *);
    233  1.27  christos int	 Pclose(FILE *);
    234  1.27  christos FILE	*Popen(const char *, const char *);
    235  1.27  christos void	 close_all_files(void);
    236  1.27  christos void	 close_top_files(FILE *);
    237  1.27  christos void	 free_child(int);
    238  1.27  christos void	 prepare_child(sigset_t *, int, int);
    239  1.27  christos FILE	*last_registered_file(int);
    240  1.27  christos void	 register_file(FILE *, int, int);
    241  1.27  christos int	 run_command(const char *, sigset_t *, int, int, ...);
    242  1.27  christos void	 sigchild(int);
    243  1.27  christos int	 start_command(const char *, sigset_t *, int, int, ...);
    244  1.13       wiz int	 wait_child(int);
    245  1.25  christos #ifdef MIME_SUPPORT
    246  1.27  christos void	 flush_files(FILE *, int);
    247  1.25  christos #endif
    248  1.25  christos 
    249  1.27  christos /*
    250  1.27  christos  * from quit.c
    251  1.27  christos  */
    252  1.27  christos void	 quit(void);
    253  1.27  christos int	 quitcmd(void *);
    254  1.27  christos 
    255  1.27  christos /*
    256  1.27  christos  * from send.c
    257  1.27  christos  */
    258  1.27  christos #ifndef MIME_SUPPORT
    259  1.27  christos # define sendmessage(a,b,c,d,e)	legacy_sendmessage(a,b,c,d)
    260  1.27  christos # define mail(a,b,c,d,e,f)	legacy_mail(a,b,c,d,e)
    261  1.26  christos #endif
    262  1.27  christos int	 sendmessage(struct message *, FILE *, struct ignoretab *, const char *, struct mime_info *);
    263  1.27  christos int	 mail(struct name *, struct name *, struct name *, struct name *, char *, struct attachment *);
    264  1.27  christos void	 mail1(struct header *, int);
    265  1.27  christos int	 puthead(struct header *, FILE *, int);
    266  1.27  christos int	 sendmail(void *);
    267  1.27  christos 
    268  1.27  christos /*
    269  1.27  christos  * from strings.c
    270  1.27  christos  */
    271  1.27  christos void	*csalloc(size_t, size_t);
    272  1.27  christos void	*salloc(size_t);
    273  1.27  christos void	 sreset(void);
    274  1.27  christos void	 spreserve(void);
    275  1.26  christos 
    276  1.27  christos /*
    277  1.27  christos  * from support.c
    278  1.27  christos  */
    279  1.27  christos void	 alter(char *);
    280  1.27  christos int	 argcount(char **);
    281  1.27  christos int	 blankline(char []);
    282  1.27  christos char	*copy(char *, char *);
    283  1.27  christos char	*hfield(const char [], const struct message *);
    284  1.27  christos int	 isdir(const char []);
    285  1.27  christos int	 isign(const char *, struct ignoretab []);
    286  1.27  christos void	 istrcpy(char *, const char *);
    287  1.27  christos int	 member(char *, struct ignoretab *);
    288  1.27  christos char	*nameof(struct message *, int);
    289  1.27  christos int	 sasprintf(char **ret, const char *format, ...);
    290  1.27  christos char	*savestr(const char *);
    291  1.27  christos struct message *set_m_flag(int, int, int);
    292  1.27  christos char	*skin(char *);
    293  1.27  christos int	 source(void *);
    294  1.27  christos void	 touch(struct message *);
    295  1.27  christos int	 unstack(void);
    296  1.27  christos int	 upcase(int);
    297  1.26  christos 
    298  1.27  christos /*
    299  1.27  christos  * from temp.c
    300  1.27  christos  */
    301  1.27  christos void	 tinit(void);
    302  1.27  christos 
    303  1.27  christos /*
    304  1.27  christos  * from tty.c
    305  1.27  christos  */
    306  1.27  christos int	 grabh(struct header *, int);
    307  1.27  christos 
    308  1.27  christos /*
    309  1.27  christos  * from vars.c
    310  1.27  christos  */
    311  1.27  christos void	 assign(const char [], const char []);
    312  1.27  christos struct grouphead *findgroup(const char []);
    313  1.27  christos int	 hash(const char *);
    314  1.27  christos struct var *lookup(const char []);
    315  1.27  christos void	 printgroup(const char []);
    316  1.27  christos void	 v_free(char *);
    317  1.27  christos char	*value(const char []);
    318  1.27  christos char	*vcopy(const char []);
    319  1.27  christos 
    320  1.27  christos /*
    321  1.27  christos  * from v7.local.c
    322  1.27  christos  */
    323  1.27  christos void	 demail(void);
    324  1.27  christos void	 findmail(const char *, char *, size_t);
    325  1.27  christos const char *username(void);
    326  1.27  christos 
    327  1.27  christos /*
    328  1.27  christos  * from version.c
    329  1.27  christos  */
    330  1.21  christos extern const char *version;
    331  1.27  christos 
    332  1.27  christos 
    333  1.27  christos #ifndef	THREAD_SUPPORT
    334  1.27  christos /*
    335  1.27  christos  * Specials from fio.c (if THREAD_SUPPORT is not defined).
    336  1.27  christos  * With THREAD_SUPPORT, they live in thread.c.
    337  1.27  christos  */
    338  1.27  christos struct message *next_message(struct message *);
    339  1.27  christos struct message *prev_message(struct message *);
    340  1.27  christos struct message *get_message(int);
    341  1.27  christos int	 get_msgnum(struct message *);
    342  1.27  christos int	 get_msgCount(void);
    343  1.27  christos 
    344  1.27  christos /* we remap these commands */
    345  1.27  christos # define get_abs_msgCount	get_msgCount
    346  1.27  christos # define get_abs_message(a)	get_message(a)
    347  1.27  christos # define next_abs_message(a)	next_message(a)
    348  1.27  christos 
    349  1.27  christos /* we trash these commands */
    350  1.27  christos # define do_recursion()			0
    351  1.27  christos # define thread_recursion(mp,fn,args)	fn(mp,args)
    352  1.27  christos # define thread_fix_old_links(nmessage,message,omsgCount)
    353  1.27  christos # define thread_fix_new_links(message,omsgCount,msgCount)
    354  1.27  christos #endif /* THREAD_SUPPORT */
    355  1.26  christos 
    356  1.26  christos #endif /* __EXTERN_H__ */
    357