xref: /illumos-gate/usr/src/cmd/mailx/hdr/def.h (revision 7c478bd95313f5f23a4c958a745db2134aa0324)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
24*7c478bd9Sstevel@tonic-gate  * All Rights Reserved
25*7c478bd9Sstevel@tonic-gate  *
26*7c478bd9Sstevel@tonic-gate  *
27*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1985-2001 by Sun Microsystems, Inc.
28*7c478bd9Sstevel@tonic-gate  * All rights reserved.
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate /*
32*7c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
33*7c478bd9Sstevel@tonic-gate  * The Regents of the University of California
34*7c478bd9Sstevel@tonic-gate  * All Rights Reserved
35*7c478bd9Sstevel@tonic-gate  *
36*7c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
37*7c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
38*7c478bd9Sstevel@tonic-gate  * contributors.
39*7c478bd9Sstevel@tonic-gate  */
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate #ifndef _MAILX_DEF_H
42*7c478bd9Sstevel@tonic-gate #define	_MAILX_DEF_H
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
47*7c478bd9Sstevel@tonic-gate extern "C" {
48*7c478bd9Sstevel@tonic-gate #endif
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
51*7c478bd9Sstevel@tonic-gate #include <signal.h>
52*7c478bd9Sstevel@tonic-gate #include <stdio.h>
53*7c478bd9Sstevel@tonic-gate #include <fcntl.h>
54*7c478bd9Sstevel@tonic-gate #include <string.h>
55*7c478bd9Sstevel@tonic-gate #include <termio.h>
56*7c478bd9Sstevel@tonic-gate #include <setjmp.h>
57*7c478bd9Sstevel@tonic-gate #include <time.h>
58*7c478bd9Sstevel@tonic-gate #include <sys/stat.h>
59*7c478bd9Sstevel@tonic-gate #include <maillock.h>
60*7c478bd9Sstevel@tonic-gate #include <ctype.h>
61*7c478bd9Sstevel@tonic-gate #include <errno.h>
62*7c478bd9Sstevel@tonic-gate #ifndef preSVr4
63*7c478bd9Sstevel@tonic-gate # include <unistd.h>
64*7c478bd9Sstevel@tonic-gate # include <stdlib.h>
65*7c478bd9Sstevel@tonic-gate # include <ulimit.h>
66*7c478bd9Sstevel@tonic-gate # include <wait.h>
67*7c478bd9Sstevel@tonic-gate #endif
68*7c478bd9Sstevel@tonic-gate #ifdef VMUNIX
69*7c478bd9Sstevel@tonic-gate #include <sys/wait.h>
70*7c478bd9Sstevel@tonic-gate #endif
71*7c478bd9Sstevel@tonic-gate #include "local.h"
72*7c478bd9Sstevel@tonic-gate #include "uparm.h"
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate /*
75*7c478bd9Sstevel@tonic-gate  * mailx -- a modified version of a University of California at Berkeley
76*7c478bd9Sstevel@tonic-gate  *	mail program
77*7c478bd9Sstevel@tonic-gate  */
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate #define	SENDESC		'~'		/* Default escape for sending */
80*7c478bd9Sstevel@tonic-gate #define	NMLSIZE		1024		/* max names in a message list */
81*7c478bd9Sstevel@tonic-gate #define	PATHSIZE	1024		/* Size of pathnames throughout */
82*7c478bd9Sstevel@tonic-gate #define	HSHSIZE		59		/* Hash size for aliases and vars */
83*7c478bd9Sstevel@tonic-gate #define	HDRFIELDS	3		/* Number of header fields */
84*7c478bd9Sstevel@tonic-gate #define	LINESIZE	5120		/* max readable line width */
85*7c478bd9Sstevel@tonic-gate #define	STRINGSIZE	((unsigned) 128)/* Dynamic allocation units */
86*7c478bd9Sstevel@tonic-gate #define	MAXARGC		1024		/* Maximum list of raw strings */
87*7c478bd9Sstevel@tonic-gate #define	NOSTR		((char *) 0)	/* Nill string pointer */
88*7c478bd9Sstevel@tonic-gate #define	NOSTRPTR	((char **) 0)	/* Nill pointer to string pointer */
89*7c478bd9Sstevel@tonic-gate #define	NOINTPTR	((int *) 0)	/* Nill pointer */
90*7c478bd9Sstevel@tonic-gate #define	MAXEXP		25		/* Maximum expansion of aliases */
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate #define	equal(a, b)	(strcmp(a,b)==0)/* A nice function to string compare */
93*7c478bd9Sstevel@tonic-gate #define fopen(s,t)	my_fopen(s,t)	/* Keep a list of all opened files */
94*7c478bd9Sstevel@tonic-gate #define fclose(s)	my_fclose(s)	/* delete closed file from the list*/
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate struct message {
97*7c478bd9Sstevel@tonic-gate 	off_t	m_offset;		/* offset in block of message */
98*7c478bd9Sstevel@tonic-gate 	long	m_size;			/* Bytes in the message */
99*7c478bd9Sstevel@tonic-gate 	long	m_lines;		/* Lines in the message */
100*7c478bd9Sstevel@tonic-gate 	long	m_clen;			/* Content-Length of the mesg   */
101*7c478bd9Sstevel@tonic-gate 	short	m_flag;			/* flags, see below */
102*7c478bd9Sstevel@tonic-gate 	char	m_text;			/* TRUE if the contents is text */
103*7c478bd9Sstevel@tonic-gate 					/* False otherwise		*/
104*7c478bd9Sstevel@tonic-gate };
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate typedef struct fplst {
107*7c478bd9Sstevel@tonic-gate 	FILE	*fp;
108*7c478bd9Sstevel@tonic-gate 	struct	fplst	*next;
109*7c478bd9Sstevel@tonic-gate } NODE;
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate /*
112*7c478bd9Sstevel@tonic-gate  * flag bits.
113*7c478bd9Sstevel@tonic-gate  */
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate #define	MUSED		(1<<0)		/* entry is used, but this bit isn't */
116*7c478bd9Sstevel@tonic-gate #define	MDELETED	(1<<1)		/* entry has been deleted */
117*7c478bd9Sstevel@tonic-gate #define	MSAVED		(1<<2)		/* entry has been saved */
118*7c478bd9Sstevel@tonic-gate #define	MTOUCH		(1<<3)		/* entry has been noticed */
119*7c478bd9Sstevel@tonic-gate #define	MPRESERVE	(1<<4)		/* keep entry in sys mailbox */
120*7c478bd9Sstevel@tonic-gate #define	MMARK		(1<<5)		/* message is marked! */
121*7c478bd9Sstevel@tonic-gate #define	MODIFY		(1<<6)		/* message has been modified */
122*7c478bd9Sstevel@tonic-gate #define	MNEW		(1<<7)		/* message has never been seen */
123*7c478bd9Sstevel@tonic-gate #define	MREAD		(1<<8)		/* message has been read sometime. */
124*7c478bd9Sstevel@tonic-gate #define	MSTATUS		(1<<9)		/* message status has changed */
125*7c478bd9Sstevel@tonic-gate #define	MBOX		(1<<10)		/* Send this to mbox, regardless */
126*7c478bd9Sstevel@tonic-gate #define	MBOXED		(1<<11)		/* message has been sent to mbox */
127*7c478bd9Sstevel@tonic-gate 
128*7c478bd9Sstevel@tonic-gate #define	H_AFWDCNT	1		/* "Auto-Forward-Count:"  */
129*7c478bd9Sstevel@tonic-gate #define	H_AFWDFROM	2		/* "Auto-Forwarded-From:" */
130*7c478bd9Sstevel@tonic-gate #define	H_CLEN		3		/* "Content-Length:"      */
131*7c478bd9Sstevel@tonic-gate #define	H_CTYPE		4		/* "Content-Type:"        */
132*7c478bd9Sstevel@tonic-gate #define	H_DATE		5		/* "Date:" 		  */
133*7c478bd9Sstevel@tonic-gate #define	H_DEFOPTS	6		/* "Default-Options:" 	  */
134*7c478bd9Sstevel@tonic-gate #define	H_EOH		7		/* "End-of-Header:" 	  */
135*7c478bd9Sstevel@tonic-gate #define	H_FROM		8		/* "From " 		  */
136*7c478bd9Sstevel@tonic-gate #define	H_FROM1		9		/* ">From " 		  */
137*7c478bd9Sstevel@tonic-gate #define	H_FROM2		10		/* "From: " 		  */
138*7c478bd9Sstevel@tonic-gate #define	H_MTSID		11		/* "MTS-Message-ID:" 	  */
139*7c478bd9Sstevel@tonic-gate #define	H_MTYPE		12		/* "Message-Type:" 	  */
140*7c478bd9Sstevel@tonic-gate #define	H_MVERS		13		/* "Message-Version:" 	  */
141*7c478bd9Sstevel@tonic-gate #define	H_MSVC		14		/* "Message-Service:" 	  */
142*7c478bd9Sstevel@tonic-gate #define	H_RECEIVED	15		/* "Received:"	 	  */
143*7c478bd9Sstevel@tonic-gate #define	H_RVERS		16		/* "Report-Version:" 	  */
144*7c478bd9Sstevel@tonic-gate #define	H_STATUS	17		/* "Status:"		  */
145*7c478bd9Sstevel@tonic-gate #define	H_SUBJ		18		/* "Subject:" 		  */
146*7c478bd9Sstevel@tonic-gate #define	H_TO		19		/* "To:" 		  */
147*7c478bd9Sstevel@tonic-gate #define	H_TCOPY		20		/* ">To:" 		  */
148*7c478bd9Sstevel@tonic-gate #define	H_TROPTS	21		/* "Transport-Options:"   */
149*7c478bd9Sstevel@tonic-gate #define	H_UAID		22		/* "UA-Content-ID:"	  */
150*7c478bd9Sstevel@tonic-gate #define	H_DAFWDFROM	23		/* Hold A-F-F when sending Del. Notf. */
151*7c478bd9Sstevel@tonic-gate #define	H_DTCOPY	24		/* Hold ">To:" when sending Del. Notf.*/
152*7c478bd9Sstevel@tonic-gate #define	H_DRECEIVED	25		/* Hold Rcvd: when sending Del. Notf.*/
153*7c478bd9Sstevel@tonic-gate #define H_CONT		26		/* Continuation of previous line */
154*7c478bd9Sstevel@tonic-gate #define H_NAMEVALUE	27		/* unrecognized "name: value" hdr line*/
155*7c478bd9Sstevel@tonic-gate 
156*7c478bd9Sstevel@tonic-gate /*
157*7c478bd9Sstevel@tonic-gate  * Format of the command description table.
158*7c478bd9Sstevel@tonic-gate  * The actual table is declared and initialized
159*7c478bd9Sstevel@tonic-gate  * in lex.c
160*7c478bd9Sstevel@tonic-gate  */
161*7c478bd9Sstevel@tonic-gate 
162*7c478bd9Sstevel@tonic-gate struct cmd {
163*7c478bd9Sstevel@tonic-gate 	char	*c_name;		/* Name of command */
164*7c478bd9Sstevel@tonic-gate 	int	(*c_func)(void *);	/* Implementor of the command */
165*7c478bd9Sstevel@tonic-gate 	short	c_argtype;		/* Type of arglist (see below) */
166*7c478bd9Sstevel@tonic-gate 	short	c_msgflag;		/* Required flags of messages */
167*7c478bd9Sstevel@tonic-gate 	short	c_msgmask;		/* Relevant flags of messages */
168*7c478bd9Sstevel@tonic-gate };
169*7c478bd9Sstevel@tonic-gate 
170*7c478bd9Sstevel@tonic-gate /* can't initialize unions */
171*7c478bd9Sstevel@tonic-gate 
172*7c478bd9Sstevel@tonic-gate #define	c_minargs c_msgflag		/* Minimum argcount for RAWLIST */
173*7c478bd9Sstevel@tonic-gate #define	c_maxargs c_msgmask		/* Max argcount for RAWLIST */
174*7c478bd9Sstevel@tonic-gate 
175*7c478bd9Sstevel@tonic-gate /*
176*7c478bd9Sstevel@tonic-gate  * Argument types.
177*7c478bd9Sstevel@tonic-gate  */
178*7c478bd9Sstevel@tonic-gate 
179*7c478bd9Sstevel@tonic-gate #define	MSGLIST	 0		/* Message list type */
180*7c478bd9Sstevel@tonic-gate #define	STRLIST	 1		/* A pure string */
181*7c478bd9Sstevel@tonic-gate #define	RAWLIST	 2		/* Shell string list */
182*7c478bd9Sstevel@tonic-gate #define	NOLIST	 3		/* Just plain 0 */
183*7c478bd9Sstevel@tonic-gate #define	NDMLIST	 4		/* Message list, no defaults */
184*7c478bd9Sstevel@tonic-gate 
185*7c478bd9Sstevel@tonic-gate #define	P	040		/* Autoprint dot after command */
186*7c478bd9Sstevel@tonic-gate #define	I	0100		/* Interactive command bit */
187*7c478bd9Sstevel@tonic-gate #define	M	0200		/* Legal from send mode bit */
188*7c478bd9Sstevel@tonic-gate #define	W	0400		/* Illegal when read only bit */
189*7c478bd9Sstevel@tonic-gate #define	F	01000		/* Is a conditional command */
190*7c478bd9Sstevel@tonic-gate #define	T	02000		/* Is a transparent command */
191*7c478bd9Sstevel@tonic-gate #define	R	04000		/* Cannot be called from collect */
192*7c478bd9Sstevel@tonic-gate 
193*7c478bd9Sstevel@tonic-gate /*
194*7c478bd9Sstevel@tonic-gate  * Oft-used mask values
195*7c478bd9Sstevel@tonic-gate  */
196*7c478bd9Sstevel@tonic-gate 
197*7c478bd9Sstevel@tonic-gate #define	MMNORM		(MDELETED|MSAVED)/* Look at both save and delete bits */
198*7c478bd9Sstevel@tonic-gate #define	MMNDEL		MDELETED	/* Look only at deleted bit */
199*7c478bd9Sstevel@tonic-gate 
200*7c478bd9Sstevel@tonic-gate /*
201*7c478bd9Sstevel@tonic-gate  * Structure used to return a break down of a head
202*7c478bd9Sstevel@tonic-gate  * line
203*7c478bd9Sstevel@tonic-gate  */
204*7c478bd9Sstevel@tonic-gate 
205*7c478bd9Sstevel@tonic-gate struct headline {
206*7c478bd9Sstevel@tonic-gate 	char	*l_from;	/* The name of the sender */
207*7c478bd9Sstevel@tonic-gate 	char	*l_tty;		/* His tty string (if any) */
208*7c478bd9Sstevel@tonic-gate 	char	*l_date;	/* The entire date string */
209*7c478bd9Sstevel@tonic-gate };
210*7c478bd9Sstevel@tonic-gate 
211*7c478bd9Sstevel@tonic-gate #define	GTO	1		/* Grab To: line */
212*7c478bd9Sstevel@tonic-gate #define	GSUBJECT 2		/* Likewise, Subject: line */
213*7c478bd9Sstevel@tonic-gate #define	GCC	4		/* And the Cc: line */
214*7c478bd9Sstevel@tonic-gate #define	GBCC	8		/* And also the Bcc: line */
215*7c478bd9Sstevel@tonic-gate #define	GDEFOPT	16		/* And the Default-Options: lines */
216*7c478bd9Sstevel@tonic-gate #define	GNL	32		/* Print blank line after */
217*7c478bd9Sstevel@tonic-gate #define GOTHER	64		/* Other header lines */
218*7c478bd9Sstevel@tonic-gate #define	GMASK	(GTO|GSUBJECT|GCC|GBCC|GDEFOPT|GNL|GOTHER)
219*7c478bd9Sstevel@tonic-gate 				/* Mask of all header lines */
220*7c478bd9Sstevel@tonic-gate #define	GDEL	128		/* Entity removed from list */
221*7c478bd9Sstevel@tonic-gate #define	GCLEN	256		/* Include Content-Length header */
222*7c478bd9Sstevel@tonic-gate 
223*7c478bd9Sstevel@tonic-gate /*
224*7c478bd9Sstevel@tonic-gate  * Structure used to pass about the current
225*7c478bd9Sstevel@tonic-gate  * state of the user-typed message header.
226*7c478bd9Sstevel@tonic-gate  */
227*7c478bd9Sstevel@tonic-gate 
228*7c478bd9Sstevel@tonic-gate struct header {
229*7c478bd9Sstevel@tonic-gate 	char	*h_to;			/* Dynamic "To:" string */
230*7c478bd9Sstevel@tonic-gate 	char	*h_subject;		/* Subject string */
231*7c478bd9Sstevel@tonic-gate 	char	*h_cc;			/* Carbon copies string */
232*7c478bd9Sstevel@tonic-gate 	char	*h_bcc;			/* Blind carbon copies */
233*7c478bd9Sstevel@tonic-gate 	char	*h_defopt;		/* Default options */
234*7c478bd9Sstevel@tonic-gate 	char	**h_others;		/* Other header lines */
235*7c478bd9Sstevel@tonic-gate 	int	h_seq;			/* Sequence for optimization */
236*7c478bd9Sstevel@tonic-gate };
237*7c478bd9Sstevel@tonic-gate 
238*7c478bd9Sstevel@tonic-gate /*
239*7c478bd9Sstevel@tonic-gate  * Structure of namelist nodes used in processing
240*7c478bd9Sstevel@tonic-gate  * the recipients of mail and aliases and all that
241*7c478bd9Sstevel@tonic-gate  * kind of stuff.
242*7c478bd9Sstevel@tonic-gate  */
243*7c478bd9Sstevel@tonic-gate 
244*7c478bd9Sstevel@tonic-gate struct name {
245*7c478bd9Sstevel@tonic-gate 	struct	name *n_flink;		/* Forward link in list. */
246*7c478bd9Sstevel@tonic-gate 	struct	name *n_blink;		/* Backward list link */
247*7c478bd9Sstevel@tonic-gate 	short	n_type;			/* From which list it came */
248*7c478bd9Sstevel@tonic-gate 	char	*n_name;		/* This fella's name */
249*7c478bd9Sstevel@tonic-gate 	char	*n_full;		/* Full name */
250*7c478bd9Sstevel@tonic-gate };
251*7c478bd9Sstevel@tonic-gate 
252*7c478bd9Sstevel@tonic-gate /*
253*7c478bd9Sstevel@tonic-gate  * Structure of a variable node.  All variables are
254*7c478bd9Sstevel@tonic-gate  * kept on a singly-linked list of these, rooted by
255*7c478bd9Sstevel@tonic-gate  * "variables"
256*7c478bd9Sstevel@tonic-gate  */
257*7c478bd9Sstevel@tonic-gate 
258*7c478bd9Sstevel@tonic-gate struct var {
259*7c478bd9Sstevel@tonic-gate 	struct	var *v_link;		/* Forward link to next variable */
260*7c478bd9Sstevel@tonic-gate 	char	*v_name;		/* The variable's name */
261*7c478bd9Sstevel@tonic-gate 	char	*v_value;		/* And it's current value */
262*7c478bd9Sstevel@tonic-gate };
263*7c478bd9Sstevel@tonic-gate 
264*7c478bd9Sstevel@tonic-gate struct mgroup {
265*7c478bd9Sstevel@tonic-gate 	struct	mgroup *ge_link;	/* Next person in this group */
266*7c478bd9Sstevel@tonic-gate 	char	*ge_name;		/* This person's user name */
267*7c478bd9Sstevel@tonic-gate };
268*7c478bd9Sstevel@tonic-gate 
269*7c478bd9Sstevel@tonic-gate struct grouphead {
270*7c478bd9Sstevel@tonic-gate 	struct	grouphead *g_link;	/* Next grouphead in list */
271*7c478bd9Sstevel@tonic-gate 	char	*g_name;		/* Name of this group */
272*7c478bd9Sstevel@tonic-gate 	struct	mgroup *g_list;		/* Users in group. */
273*7c478bd9Sstevel@tonic-gate };
274*7c478bd9Sstevel@tonic-gate 
275*7c478bd9Sstevel@tonic-gate #define	NIL	((struct name *) 0)	/* The nil pointer for namelists */
276*7c478bd9Sstevel@tonic-gate #define	NONE	((struct cmd *) 0)	/* The nil pointer to command tab */
277*7c478bd9Sstevel@tonic-gate #define	NOVAR	((struct var *) 0)	/* The nil pointer to variables */
278*7c478bd9Sstevel@tonic-gate #define	NOGRP	((struct grouphead *) 0)/* The nil grouphead pointer */
279*7c478bd9Sstevel@tonic-gate #define	NOGE	((struct mgroup *) 0)	/* The nil group pointer */
280*7c478bd9Sstevel@tonic-gate #define	NOFP	((struct fplst *) 0)	/* The nil file pointer */
281*7c478bd9Sstevel@tonic-gate 
282*7c478bd9Sstevel@tonic-gate #define TRUE	1
283*7c478bd9Sstevel@tonic-gate #define FALSE	0
284*7c478bd9Sstevel@tonic-gate 
285*7c478bd9Sstevel@tonic-gate #define DEADPERM	0600		/* permissions of dead.letter */
286*7c478bd9Sstevel@tonic-gate #define TEMPPERM	0600		/* permissions of temp files */
287*7c478bd9Sstevel@tonic-gate #define MBOXPERM	0600		/* permissions of ~/mbox */
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate #ifndef	MFMODE
290*7c478bd9Sstevel@tonic-gate # define MFMODE		0600		/* create mode for `/var/mail' files */
291*7c478bd9Sstevel@tonic-gate #endif
292*7c478bd9Sstevel@tonic-gate 
293*7c478bd9Sstevel@tonic-gate /*
294*7c478bd9Sstevel@tonic-gate  * Structure of the hash table of ignored header fields
295*7c478bd9Sstevel@tonic-gate  */
296*7c478bd9Sstevel@tonic-gate struct ignore {
297*7c478bd9Sstevel@tonic-gate 	struct ignore	*i_link;	/* Next ignored field in bucket */
298*7c478bd9Sstevel@tonic-gate 	char		*i_field;	/* This ignored field */
299*7c478bd9Sstevel@tonic-gate };
300*7c478bd9Sstevel@tonic-gate 
301*7c478bd9Sstevel@tonic-gate #ifdef preSVr4
302*7c478bd9Sstevel@tonic-gate struct utimbuf {
303*7c478bd9Sstevel@tonic-gate 	time_t	actime;
304*7c478bd9Sstevel@tonic-gate 	time_t	modtime;
305*7c478bd9Sstevel@tonic-gate };
306*7c478bd9Sstevel@tonic-gate #else
307*7c478bd9Sstevel@tonic-gate #  include	<utime.h>
308*7c478bd9Sstevel@tonic-gate #endif
309*7c478bd9Sstevel@tonic-gate 
310*7c478bd9Sstevel@tonic-gate /*
311*7c478bd9Sstevel@tonic-gate  * Token values returned by the scanner used for argument lists.
312*7c478bd9Sstevel@tonic-gate  * Also, sizes of scanner-related things.
313*7c478bd9Sstevel@tonic-gate  */
314*7c478bd9Sstevel@tonic-gate 
315*7c478bd9Sstevel@tonic-gate #define	TEOL		0		/* End of the command line */
316*7c478bd9Sstevel@tonic-gate #define	TNUMBER		1		/* A message number */
317*7c478bd9Sstevel@tonic-gate #define	TDASH		2		/* A simple dash */
318*7c478bd9Sstevel@tonic-gate #define	TSTRING		3		/* A string (possibly containing -) */
319*7c478bd9Sstevel@tonic-gate #define	TDOT		4		/* A "." */
320*7c478bd9Sstevel@tonic-gate #define	TUP		5		/* An "^" */
321*7c478bd9Sstevel@tonic-gate #define	TDOLLAR		6		/* A "$" */
322*7c478bd9Sstevel@tonic-gate #define	TSTAR		7		/* A "*" */
323*7c478bd9Sstevel@tonic-gate #define	TOPEN		8		/* An '(' */
324*7c478bd9Sstevel@tonic-gate #define	TCLOSE		9		/* A ')' */
325*7c478bd9Sstevel@tonic-gate #define TPLUS		10		/* A '+' */
326*7c478bd9Sstevel@tonic-gate 
327*7c478bd9Sstevel@tonic-gate #define	REGDEP		2		/* Maximum regret depth. */
328*7c478bd9Sstevel@tonic-gate #define	STRINGLEN	1024		/* Maximum length of string token */
329*7c478bd9Sstevel@tonic-gate 
330*7c478bd9Sstevel@tonic-gate /*
331*7c478bd9Sstevel@tonic-gate  * Constants for conditional commands.  These describe whether
332*7c478bd9Sstevel@tonic-gate  * we should be executing stuff or not.
333*7c478bd9Sstevel@tonic-gate  */
334*7c478bd9Sstevel@tonic-gate 
335*7c478bd9Sstevel@tonic-gate #define	CANY		0		/* Execute in send or receive mode */
336*7c478bd9Sstevel@tonic-gate #define	CRCV		1		/* Execute in receive mode only */
337*7c478bd9Sstevel@tonic-gate #define	CSEND		2		/* Execute in send mode only */
338*7c478bd9Sstevel@tonic-gate #define	CTTY		3		/* Execute if attached to a tty only */
339*7c478bd9Sstevel@tonic-gate #define	CNOTTY		4		/* Execute if not attached to a tty */
340*7c478bd9Sstevel@tonic-gate 
341*7c478bd9Sstevel@tonic-gate /*
342*7c478bd9Sstevel@tonic-gate  * Flags for msend().
343*7c478bd9Sstevel@tonic-gate  */
344*7c478bd9Sstevel@tonic-gate 
345*7c478bd9Sstevel@tonic-gate #define	M_IGNORE	1		/* Do "ignore/retain" processing */
346*7c478bd9Sstevel@tonic-gate #define	M_SAVING	2		/* Saving to a file/folder */
347*7c478bd9Sstevel@tonic-gate 
348*7c478bd9Sstevel@tonic-gate /*
349*7c478bd9Sstevel@tonic-gate  * VM/UNIX has a vfork system call which is faster than forking.  If we
350*7c478bd9Sstevel@tonic-gate  * don't have it, fork(2) will do . . .
351*7c478bd9Sstevel@tonic-gate  */
352*7c478bd9Sstevel@tonic-gate 
353*7c478bd9Sstevel@tonic-gate #if !defined(VMUNIX) && defined(preSVr4)
354*7c478bd9Sstevel@tonic-gate #define	vfork()	fork()
355*7c478bd9Sstevel@tonic-gate #endif
356*7c478bd9Sstevel@tonic-gate #ifndef	SIGRETRO
357*7c478bd9Sstevel@tonic-gate #define	sigchild()
358*7c478bd9Sstevel@tonic-gate #endif
359*7c478bd9Sstevel@tonic-gate 
360*7c478bd9Sstevel@tonic-gate 
361*7c478bd9Sstevel@tonic-gate /*
362*7c478bd9Sstevel@tonic-gate  * 4.2bsd signal interface help...
363*7c478bd9Sstevel@tonic-gate  */
364*7c478bd9Sstevel@tonic-gate #ifdef VMUNIX
365*7c478bd9Sstevel@tonic-gate #define	sigset(s, a)	signal(s, a)
366*7c478bd9Sstevel@tonic-gate #define	sigsys(s, a)	signal(s, a)
367*7c478bd9Sstevel@tonic-gate #else
368*7c478bd9Sstevel@tonic-gate #ifndef preSVr4
369*7c478bd9Sstevel@tonic-gate /* SVr4 version of sigset() in fio.c */
370*7c478bd9Sstevel@tonic-gate #define	sigsys(s, a)	signal(s, a)
371*7c478bd9Sstevel@tonic-gate #define	setjmp(x)	sigsetjmp((x), 1)
372*7c478bd9Sstevel@tonic-gate #define	longjmp		siglongjmp
373*7c478bd9Sstevel@tonic-gate #define	jmp_buf		sigjmp_buf
374*7c478bd9Sstevel@tonic-gate #else
375*7c478bd9Sstevel@tonic-gate #define	OLD_BSD_SIGS
376*7c478bd9Sstevel@tonic-gate #endif
377*7c478bd9Sstevel@tonic-gate #endif
378*7c478bd9Sstevel@tonic-gate 
379*7c478bd9Sstevel@tonic-gate /*
380*7c478bd9Sstevel@tonic-gate  * Truncate a file to the last character written. This is
381*7c478bd9Sstevel@tonic-gate  * useful just before closing an old file that was opened
382*7c478bd9Sstevel@tonic-gate  * for read/write.
383*7c478bd9Sstevel@tonic-gate  */
384*7c478bd9Sstevel@tonic-gate #define trunc(stream)	ftruncate(fileno(stream), (long) ftell(stream))
385*7c478bd9Sstevel@tonic-gate 
386*7c478bd9Sstevel@tonic-gate /*
387*7c478bd9Sstevel@tonic-gate  * The pointers for the string allocation routines,
388*7c478bd9Sstevel@tonic-gate  * there are NSPACE independent areas.
389*7c478bd9Sstevel@tonic-gate  * The first holds STRINGSIZE bytes, the next
390*7c478bd9Sstevel@tonic-gate  * twice as much, and so on.
391*7c478bd9Sstevel@tonic-gate  */
392*7c478bd9Sstevel@tonic-gate 
393*7c478bd9Sstevel@tonic-gate #define	NSPACE	25			/* Total number of string spaces */
394*7c478bd9Sstevel@tonic-gate struct strings {
395*7c478bd9Sstevel@tonic-gate 	char	*s_topFree;		/* Beginning of this area */
396*7c478bd9Sstevel@tonic-gate 	char	*s_nextFree;		/* Next alloctable place here */
397*7c478bd9Sstevel@tonic-gate 	unsigned s_nleft;		/* Number of bytes left here */
398*7c478bd9Sstevel@tonic-gate };
399*7c478bd9Sstevel@tonic-gate 
400*7c478bd9Sstevel@tonic-gate /* The following typedefs must be used in SVR4 */
401*7c478bd9Sstevel@tonic-gate #ifdef preSVr4
402*7c478bd9Sstevel@tonic-gate #ifndef sun
403*7c478bd9Sstevel@tonic-gate typedef int gid_t;
404*7c478bd9Sstevel@tonic-gate typedef int uid_t;
405*7c478bd9Sstevel@tonic-gate typedef int mode_t;
406*7c478bd9Sstevel@tonic-gate typedef int pid_t;
407*7c478bd9Sstevel@tonic-gate #endif
408*7c478bd9Sstevel@tonic-gate #endif
409*7c478bd9Sstevel@tonic-gate 
410*7c478bd9Sstevel@tonic-gate #define	STSIZ	40
411*7c478bd9Sstevel@tonic-gate #define	TMPSIZ	14
412*7c478bd9Sstevel@tonic-gate /*
413*7c478bd9Sstevel@tonic-gate  * Forward declarations of routine types to keep lint and cc happy.
414*7c478bd9Sstevel@tonic-gate  */
415*7c478bd9Sstevel@tonic-gate 
416*7c478bd9Sstevel@tonic-gate extern int		Copy(int *msgvec);
417*7c478bd9Sstevel@tonic-gate extern FILE		*Fdopen(int fildes, char *mode);
418*7c478bd9Sstevel@tonic-gate extern int		Followup(int *msgvec);
419*7c478bd9Sstevel@tonic-gate extern char		*Getf(register char *s);
420*7c478bd9Sstevel@tonic-gate extern int		More(int *msgvec);
421*7c478bd9Sstevel@tonic-gate extern int		Respond(int *msgvec);
422*7c478bd9Sstevel@tonic-gate extern int		Save(int *msgvec);
423*7c478bd9Sstevel@tonic-gate extern int		Sendm(char *str);
424*7c478bd9Sstevel@tonic-gate extern int		Sput(char str[]);
425*7c478bd9Sstevel@tonic-gate extern int		Type(int *msgvec);
426*7c478bd9Sstevel@tonic-gate extern void		Verhogen(void);
427*7c478bd9Sstevel@tonic-gate extern char		*addone(char hf[], char news[]);
428*7c478bd9Sstevel@tonic-gate extern char		*addto(char hf[], char news[]);
429*7c478bd9Sstevel@tonic-gate extern void		alter(char name[]);
430*7c478bd9Sstevel@tonic-gate extern int		alternates(char **namelist);
431*7c478bd9Sstevel@tonic-gate extern void		announce(void);
432*7c478bd9Sstevel@tonic-gate extern int		any(int ch, char *str);
433*7c478bd9Sstevel@tonic-gate extern int		anyof(register char *s1, register char *s2);
434*7c478bd9Sstevel@tonic-gate extern int		argcount(char **argv);
435*7c478bd9Sstevel@tonic-gate extern void		assign(char name[], char value[]);
436*7c478bd9Sstevel@tonic-gate extern int		blankline(const char linebuf[]);
437*7c478bd9Sstevel@tonic-gate extern struct name	*cat(struct name *n1, struct name *n2);
438*7c478bd9Sstevel@tonic-gate extern FILE		*collect(struct header *hp);
439*7c478bd9Sstevel@tonic-gate extern void		commands(void);
440*7c478bd9Sstevel@tonic-gate extern char		*copy(char *str1, char *str2);
441*7c478bd9Sstevel@tonic-gate extern int		copycmd(char str[]);
442*7c478bd9Sstevel@tonic-gate extern int		deassign(register char *s);
443*7c478bd9Sstevel@tonic-gate extern int		delm(int *msgvec);
444*7c478bd9Sstevel@tonic-gate extern struct name	*delname(register struct name *np, char name[]);
445*7c478bd9Sstevel@tonic-gate extern int		deltype(int msgvec[]);
446*7c478bd9Sstevel@tonic-gate extern char		*detract(register struct name *np, int ntype);
447*7c478bd9Sstevel@tonic-gate extern int		docomma(char *s);
448*7c478bd9Sstevel@tonic-gate extern int		dopipe(char str[]);
449*7c478bd9Sstevel@tonic-gate extern int		dosh(char *str);
450*7c478bd9Sstevel@tonic-gate extern int		echo(register char **argv);
451*7c478bd9Sstevel@tonic-gate extern int		editor(int *msgvec);
452*7c478bd9Sstevel@tonic-gate extern int		edstop(int noremove);
453*7c478bd9Sstevel@tonic-gate extern struct name	*elide(struct name *names);
454*7c478bd9Sstevel@tonic-gate extern int		elsecmd(void);
455*7c478bd9Sstevel@tonic-gate extern int		endifcmd(void);
456*7c478bd9Sstevel@tonic-gate extern int		execute(char linebuf[], int contxt);
457*7c478bd9Sstevel@tonic-gate extern char		*expand(char *name);
458*7c478bd9Sstevel@tonic-gate extern struct name	*extract(char line[], int arg_ntype);
459*7c478bd9Sstevel@tonic-gate extern int		fferror(FILE *iob);
460*7c478bd9Sstevel@tonic-gate extern int		field(char str[]);
461*7c478bd9Sstevel@tonic-gate extern int		file(char **argv);
462*7c478bd9Sstevel@tonic-gate extern struct grouphead	*findgroup(char name[]);
463*7c478bd9Sstevel@tonic-gate extern void		findmail(char *name);
464*7c478bd9Sstevel@tonic-gate extern int		first(int f, int m);
465*7c478bd9Sstevel@tonic-gate extern void		flush(void);
466*7c478bd9Sstevel@tonic-gate extern int		folders(char **arglist);
467*7c478bd9Sstevel@tonic-gate extern int		followup(int *msgvec);
468*7c478bd9Sstevel@tonic-gate extern int		from(int *msgvec);
469*7c478bd9Sstevel@tonic-gate extern off_t		fsize(FILE *iob);
470*7c478bd9Sstevel@tonic-gate extern int		getfold(char *name);
471*7c478bd9Sstevel@tonic-gate extern int		gethfield(register FILE *f, char linebuf[], register long rem);
472*7c478bd9Sstevel@tonic-gate extern int		getline(char *line, int size, FILE *f, int *hasnulls);
473*7c478bd9Sstevel@tonic-gate extern int		getmsglist(char *buf, int *vector, int flags);
474*7c478bd9Sstevel@tonic-gate extern int		getname(uid_t uid, char namebuf[]);
475*7c478bd9Sstevel@tonic-gate extern int		getrawlist(char line[], char **argv, int argc);
476*7c478bd9Sstevel@tonic-gate extern void		getrecf(char *buf, char *recfile, int useauthor, int sz_recfile);
477*7c478bd9Sstevel@tonic-gate extern uid_t		getuserid(char name[]);
478*7c478bd9Sstevel@tonic-gate extern int		grabh(register struct header *hp, int gflags, int subjtop);
479*7c478bd9Sstevel@tonic-gate extern int		group(char **argv);
480*7c478bd9Sstevel@tonic-gate extern void		hangup(int);
481*7c478bd9Sstevel@tonic-gate extern int		hash(char name[]);
482*7c478bd9Sstevel@tonic-gate extern char		*hcontents(char hfield[]);
483*7c478bd9Sstevel@tonic-gate extern int		headerp(register char *line);
484*7c478bd9Sstevel@tonic-gate extern int		headers(int *msgvec);
485*7c478bd9Sstevel@tonic-gate extern int		help(void);
486*7c478bd9Sstevel@tonic-gate extern char		*helppath(char *file);
487*7c478bd9Sstevel@tonic-gate extern char		*hfield(char field[], struct message *mp, char *(*add)(char *, char *));
488*7c478bd9Sstevel@tonic-gate extern void		holdsigs(void);
489*7c478bd9Sstevel@tonic-gate extern int		icequal(register char *s1, register char *s2);
490*7c478bd9Sstevel@tonic-gate extern int		ifcmd(char **argv);
491*7c478bd9Sstevel@tonic-gate extern int		igfield(char *list[]);
492*7c478bd9Sstevel@tonic-gate extern int		inc(void);
493*7c478bd9Sstevel@tonic-gate extern void		inithost(void);
494*7c478bd9Sstevel@tonic-gate extern int		isdir(char name[]);
495*7c478bd9Sstevel@tonic-gate extern int		ishead(char linebuf[]);
496*7c478bd9Sstevel@tonic-gate extern int		ishfield(char linebuf[], char field[]);
497*7c478bd9Sstevel@tonic-gate extern int		ishost(char *sys, char *rest);
498*7c478bd9Sstevel@tonic-gate extern int		isign(char *field, int saving);
499*7c478bd9Sstevel@tonic-gate extern void		istrcpy(char *dest, int dstsize, char *src);
500*7c478bd9Sstevel@tonic-gate extern void		lcwrite(char *fn, FILE *fi, FILE *fo, int addnl);
501*7c478bd9Sstevel@tonic-gate extern void		load(char *name);
502*7c478bd9Sstevel@tonic-gate extern int		loadmsg(char str[]);
503*7c478bd9Sstevel@tonic-gate extern int		lock(FILE *fp, char *mode, int blk);
504*7c478bd9Sstevel@tonic-gate extern void		lockmail(void);
505*7c478bd9Sstevel@tonic-gate extern int		mail(char **people);
506*7c478bd9Sstevel@tonic-gate extern void		mail1(struct header *hp, int use_to, char *orig_to);
507*7c478bd9Sstevel@tonic-gate extern void		mapf(register struct name *np, char *from);
508*7c478bd9Sstevel@tonic-gate extern int		mboxit(int msgvec[]);
509*7c478bd9Sstevel@tonic-gate extern void		mechk(struct name *names);
510*7c478bd9Sstevel@tonic-gate extern int		member(register char *realfield, register struct ignore **table);
511*7c478bd9Sstevel@tonic-gate extern int		messize(int *msgvec);
512*7c478bd9Sstevel@tonic-gate extern void		minit(void);
513*7c478bd9Sstevel@tonic-gate extern int		more(int *msgvec);
514*7c478bd9Sstevel@tonic-gate extern long		msend(struct message *mailp, FILE *obuf, int flag, int (*fp)(const char *, FILE *));
515*7c478bd9Sstevel@tonic-gate extern int		my_fclose(register FILE *iop);
516*7c478bd9Sstevel@tonic-gate extern FILE		*my_fopen(char *file, char *mode);
517*7c478bd9Sstevel@tonic-gate extern char		*nameof(register struct message *mp);
518*7c478bd9Sstevel@tonic-gate extern char		*netmap(char name[], char from[]);
519*7c478bd9Sstevel@tonic-gate extern int		newfileinfo(int start);
520*7c478bd9Sstevel@tonic-gate extern int		next(int *msgvec);
521*7c478bd9Sstevel@tonic-gate extern int		npclose(FILE *ptr);
522*7c478bd9Sstevel@tonic-gate extern FILE		*npopen(char *cmd, char *mode);
523*7c478bd9Sstevel@tonic-gate extern char		*nstrcpy(char *dst, int dstsize, char *src);
524*7c478bd9Sstevel@tonic-gate extern char		*nstrcat(char *dst, int dstsize, char *src);
525*7c478bd9Sstevel@tonic-gate extern int		null(char *e);
526*7c478bd9Sstevel@tonic-gate extern int		outof(struct name *names, FILE *fo);
527*7c478bd9Sstevel@tonic-gate extern struct name	*outpre(struct name *to);
528*7c478bd9Sstevel@tonic-gate extern void		panic(char *str);
529*7c478bd9Sstevel@tonic-gate extern void		parse(char line[], struct headline *hl, char pbuf[]);
530*7c478bd9Sstevel@tonic-gate extern int		pcmdlist(void);
531*7c478bd9Sstevel@tonic-gate extern int		pdot(void);
532*7c478bd9Sstevel@tonic-gate extern int		preserve(int *msgvec);
533*7c478bd9Sstevel@tonic-gate extern void		printgroup(char name[]);
534*7c478bd9Sstevel@tonic-gate extern void		printhead(int mesg);
535*7c478bd9Sstevel@tonic-gate extern int		puthead(struct header *hp, FILE *fo, int w, long clen);
536*7c478bd9Sstevel@tonic-gate extern int		pversion(char *e);
537*7c478bd9Sstevel@tonic-gate extern void		quit(int noremove);
538*7c478bd9Sstevel@tonic-gate extern int		readline(FILE *ibuf, char *linebuf);
539*7c478bd9Sstevel@tonic-gate extern void		receipt(struct message *mp);
540*7c478bd9Sstevel@tonic-gate extern void		relsesigs(void);
541*7c478bd9Sstevel@tonic-gate extern int		removefile(char name[]);
542*7c478bd9Sstevel@tonic-gate extern int		replyall(int *msgvec);
543*7c478bd9Sstevel@tonic-gate extern int		replysender(int *msgvec);
544*7c478bd9Sstevel@tonic-gate extern int		respond(int *msgvec);
545*7c478bd9Sstevel@tonic-gate extern int		retfield(char *list[]);
546*7c478bd9Sstevel@tonic-gate extern int		rexit(int e);
547*7c478bd9Sstevel@tonic-gate extern char		*safeexpand(char name[]);
548*7c478bd9Sstevel@tonic-gate extern void		*salloc(unsigned size);
549*7c478bd9Sstevel@tonic-gate extern void		*srealloc(void *optr, unsigned size);
550*7c478bd9Sstevel@tonic-gate extern int		samebody(register char *user, register char *addr,
551*7c478bd9Sstevel@tonic-gate 			    int fuzzy);
552*7c478bd9Sstevel@tonic-gate extern int		save(char str[]);
553*7c478bd9Sstevel@tonic-gate extern void		savedead(int s);
554*7c478bd9Sstevel@tonic-gate extern char		*savestr(char *str);
555*7c478bd9Sstevel@tonic-gate extern int		schdir(char *str);
556*7c478bd9Sstevel@tonic-gate extern int		screensize(void);
557*7c478bd9Sstevel@tonic-gate extern int		scroll(char arg[]);
558*7c478bd9Sstevel@tonic-gate extern int		sendm(char *str);
559*7c478bd9Sstevel@tonic-gate extern int		set(char **arglist);
560*7c478bd9Sstevel@tonic-gate extern void		setclen(register struct message *mp);
561*7c478bd9Sstevel@tonic-gate extern int		setfile(char *name, int isedit);
562*7c478bd9Sstevel@tonic-gate extern FILE		*setinput(register struct message *mp);
563*7c478bd9Sstevel@tonic-gate extern void		setptr(register FILE *ibuf);
564*7c478bd9Sstevel@tonic-gate extern int		shell(char *str);
565*7c478bd9Sstevel@tonic-gate #ifndef sigchild
566*7c478bd9Sstevel@tonic-gate extern void		sigchild(void);
567*7c478bd9Sstevel@tonic-gate #endif
568*7c478bd9Sstevel@tonic-gate #ifndef sigset
569*7c478bd9Sstevel@tonic-gate extern void		(*sigset())();
570*7c478bd9Sstevel@tonic-gate #endif
571*7c478bd9Sstevel@tonic-gate extern char		*skin(char *name);
572*7c478bd9Sstevel@tonic-gate extern char		*snarf(char linebuf[], int *flag, int erf);
573*7c478bd9Sstevel@tonic-gate extern int		source(char name[]);
574*7c478bd9Sstevel@tonic-gate extern char		*splice(char *addr, char *hdr);
575*7c478bd9Sstevel@tonic-gate extern int		sput(char str[]);
576*7c478bd9Sstevel@tonic-gate extern void		sreset(void);
577*7c478bd9Sstevel@tonic-gate extern void		stop(int s);
578*7c478bd9Sstevel@tonic-gate extern int		stouch(int msgvec[]);
579*7c478bd9Sstevel@tonic-gate extern int		substr(char *string1, char *string2);
580*7c478bd9Sstevel@tonic-gate extern int		swrite(char str[]);
581*7c478bd9Sstevel@tonic-gate extern struct name	*tailof(struct name *name);
582*7c478bd9Sstevel@tonic-gate extern void		tinit(void);
583*7c478bd9Sstevel@tonic-gate extern int		tmail(void);
584*7c478bd9Sstevel@tonic-gate extern int		top(int *msgvec);
585*7c478bd9Sstevel@tonic-gate extern void		touch(int mesg);
586*7c478bd9Sstevel@tonic-gate extern struct name	*translate(struct name *np);
587*7c478bd9Sstevel@tonic-gate extern int		type(int *msgvec);
588*7c478bd9Sstevel@tonic-gate extern int		undelete(int *msgvec);
589*7c478bd9Sstevel@tonic-gate extern int		ungroup(char **argv);
590*7c478bd9Sstevel@tonic-gate extern int		unigfield(char *list[]);
591*7c478bd9Sstevel@tonic-gate extern void		unlockmail(void);
592*7c478bd9Sstevel@tonic-gate extern char		**unpack(struct name *np);
593*7c478bd9Sstevel@tonic-gate extern int		unread(int msgvec[]);
594*7c478bd9Sstevel@tonic-gate extern int		unretfield(char *list[]);
595*7c478bd9Sstevel@tonic-gate extern int		unset(char **arglist);
596*7c478bd9Sstevel@tonic-gate extern int		unstack(void);
597*7c478bd9Sstevel@tonic-gate extern char		*unuucp(char *name);
598*7c478bd9Sstevel@tonic-gate extern struct name	*usermap(struct name *names);
599*7c478bd9Sstevel@tonic-gate extern char		*value(char name[]);
600*7c478bd9Sstevel@tonic-gate extern char		*vcopy(char str[]);
601*7c478bd9Sstevel@tonic-gate extern void		vfree(register char *cp);
602*7c478bd9Sstevel@tonic-gate extern int		visual(int *msgvec);
603*7c478bd9Sstevel@tonic-gate extern char		*yankword(char *name, char *word, int sz, int comma);
604*7c478bd9Sstevel@tonic-gate 
605*7c478bd9Sstevel@tonic-gate /*
606*7c478bd9Sstevel@tonic-gate  * These functions are defined in libmail.a
607*7c478bd9Sstevel@tonic-gate  */
608*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
609*7c478bd9Sstevel@tonic-gate extern "C" {
610*7c478bd9Sstevel@tonic-gate #endif
611*7c478bd9Sstevel@tonic-gate extern int		delempty(mode_t, char *);
612*7c478bd9Sstevel@tonic-gate extern char		*maildomain(void);
613*7c478bd9Sstevel@tonic-gate extern void		touchlock(void);
614*7c478bd9Sstevel@tonic-gate extern char		*xgetenv(char *);
615*7c478bd9Sstevel@tonic-gate extern int		xsetenv(char *);
616*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
617*7c478bd9Sstevel@tonic-gate }
618*7c478bd9Sstevel@tonic-gate #endif
619*7c478bd9Sstevel@tonic-gate 
620*7c478bd9Sstevel@tonic-gate /*
621*7c478bd9Sstevel@tonic-gate  * Standard functions from the C library.
622*7c478bd9Sstevel@tonic-gate  * These are all defined in <stdlib.h> and <wait.h> in SVr4.
623*7c478bd9Sstevel@tonic-gate  */
624*7c478bd9Sstevel@tonic-gate #ifdef preSVr4
625*7c478bd9Sstevel@tonic-gate extern long		atol();
626*7c478bd9Sstevel@tonic-gate extern char		*getcwd();
627*7c478bd9Sstevel@tonic-gate extern char		*calloc();
628*7c478bd9Sstevel@tonic-gate extern char		*getenv();
629*7c478bd9Sstevel@tonic-gate extern void		exit();
630*7c478bd9Sstevel@tonic-gate extern void		free();
631*7c478bd9Sstevel@tonic-gate extern char		*malloc();
632*7c478bd9Sstevel@tonic-gate extern time_t		time();
633*7c478bd9Sstevel@tonic-gate extern long		ulimit();
634*7c478bd9Sstevel@tonic-gate extern int		utime();
635*7c478bd9Sstevel@tonic-gate extern int		wait();
636*7c478bd9Sstevel@tonic-gate extern int		fputs();
637*7c478bd9Sstevel@tonic-gate #endif
638*7c478bd9Sstevel@tonic-gate 
639*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
640*7c478bd9Sstevel@tonic-gate }
641*7c478bd9Sstevel@tonic-gate #endif
642*7c478bd9Sstevel@tonic-gate 
643*7c478bd9Sstevel@tonic-gate #endif	/* _MAILX_DEF_H */
644