17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*eb2b0a61Sas145665 * Common Development and Distribution License (the "License"). 6*eb2b0a61Sas145665 * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21*eb2b0a61Sas145665 227c478bd9Sstevel@tonic-gate /* 23*eb2b0a61Sas145665 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*eb2b0a61Sas145665 * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 27*eb2b0a61Sas145665 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28*eb2b0a61Sas145665 /* All Rights Reserved */ 29*eb2b0a61Sas145665 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 327c478bd9Sstevel@tonic-gate * The Regents of the University of California 337c478bd9Sstevel@tonic-gate * All Rights Reserved 347c478bd9Sstevel@tonic-gate * 357c478bd9Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 367c478bd9Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 377c478bd9Sstevel@tonic-gate * contributors. 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #ifndef _MAILX_DEF_H 417c478bd9Sstevel@tonic-gate #define _MAILX_DEF_H 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate #ifdef __cplusplus 467c478bd9Sstevel@tonic-gate extern "C" { 477c478bd9Sstevel@tonic-gate #endif 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #include <sys/types.h> 507c478bd9Sstevel@tonic-gate #include <signal.h> 517c478bd9Sstevel@tonic-gate #include <stdio.h> 527c478bd9Sstevel@tonic-gate #include <fcntl.h> 537c478bd9Sstevel@tonic-gate #include <string.h> 547c478bd9Sstevel@tonic-gate #include <termio.h> 557c478bd9Sstevel@tonic-gate #include <setjmp.h> 567c478bd9Sstevel@tonic-gate #include <time.h> 577c478bd9Sstevel@tonic-gate #include <sys/stat.h> 587c478bd9Sstevel@tonic-gate #include <maillock.h> 597c478bd9Sstevel@tonic-gate #include <ctype.h> 607c478bd9Sstevel@tonic-gate #include <errno.h> 617c478bd9Sstevel@tonic-gate #ifndef preSVr4 627c478bd9Sstevel@tonic-gate #include <unistd.h> 637c478bd9Sstevel@tonic-gate #include <stdlib.h> 647c478bd9Sstevel@tonic-gate #include <ulimit.h> 657c478bd9Sstevel@tonic-gate #include <wait.h> 667c478bd9Sstevel@tonic-gate #endif 677c478bd9Sstevel@tonic-gate #ifdef VMUNIX 687c478bd9Sstevel@tonic-gate #include <sys/wait.h> 697c478bd9Sstevel@tonic-gate #endif 707c478bd9Sstevel@tonic-gate #include "local.h" 717c478bd9Sstevel@tonic-gate #include "uparm.h" 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate /* 747c478bd9Sstevel@tonic-gate * mailx -- a modified version of a University of California at Berkeley 757c478bd9Sstevel@tonic-gate * mail program 767c478bd9Sstevel@tonic-gate */ 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate #define SENDESC '~' /* Default escape for sending */ 797c478bd9Sstevel@tonic-gate #define NMLSIZE 1024 /* max names in a message list */ 807c478bd9Sstevel@tonic-gate #define PATHSIZE 1024 /* Size of pathnames throughout */ 817c478bd9Sstevel@tonic-gate #define HSHSIZE 59 /* Hash size for aliases and vars */ 827c478bd9Sstevel@tonic-gate #define HDRFIELDS 3 /* Number of header fields */ 837c478bd9Sstevel@tonic-gate #define LINESIZE 5120 /* max readable line width */ 847c478bd9Sstevel@tonic-gate #define STRINGSIZE ((unsigned)128) /* Dynamic allocation units */ 857c478bd9Sstevel@tonic-gate #define MAXARGC 1024 /* Maximum list of raw strings */ 867c478bd9Sstevel@tonic-gate #define NOSTR ((char *)0) /* Nill string pointer */ 877c478bd9Sstevel@tonic-gate #define NOSTRPTR ((char **)0) /* Nill pointer to string pointer */ 887c478bd9Sstevel@tonic-gate #define NOINTPTR ((int *)0) /* Nill pointer */ 897c478bd9Sstevel@tonic-gate #define MAXEXP 25 /* Maximum expansion of aliases */ 907c478bd9Sstevel@tonic-gate 91*eb2b0a61Sas145665 /* A nice function to string compare */ 92*eb2b0a61Sas145665 #define equal(a, b) (strcmp(a, b) == 0) 93*eb2b0a61Sas145665 94*eb2b0a61Sas145665 /* Keep a list of all opened files */ 95*eb2b0a61Sas145665 #define fopen(s, t) my_fopen(s, t) 96*eb2b0a61Sas145665 97*eb2b0a61Sas145665 /* Delete closed file from the list */ 98*eb2b0a61Sas145665 #define fclose(s) my_fclose(s) 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate struct message { 1017c478bd9Sstevel@tonic-gate off_t m_offset; /* offset in block of message */ 1027c478bd9Sstevel@tonic-gate long m_size; /* Bytes in the message */ 1037c478bd9Sstevel@tonic-gate long m_lines; /* Lines in the message */ 1047c478bd9Sstevel@tonic-gate long m_clen; /* Content-Length of the mesg */ 1057c478bd9Sstevel@tonic-gate short m_flag; /* flags, see below */ 1067c478bd9Sstevel@tonic-gate char m_text; /* TRUE if the contents is text */ 1077c478bd9Sstevel@tonic-gate /* False otherwise */ 1087c478bd9Sstevel@tonic-gate }; 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gate typedef struct fplst { 1117c478bd9Sstevel@tonic-gate FILE *fp; 1127c478bd9Sstevel@tonic-gate struct fplst *next; 1137c478bd9Sstevel@tonic-gate } NODE; 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate /* 1167c478bd9Sstevel@tonic-gate * flag bits. 1177c478bd9Sstevel@tonic-gate */ 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate #define MUSED (1<<0) /* entry is used, but this bit isn't */ 1207c478bd9Sstevel@tonic-gate #define MDELETED (1<<1) /* entry has been deleted */ 1217c478bd9Sstevel@tonic-gate #define MSAVED (1<<2) /* entry has been saved */ 1227c478bd9Sstevel@tonic-gate #define MTOUCH (1<<3) /* entry has been noticed */ 1237c478bd9Sstevel@tonic-gate #define MPRESERVE (1<<4) /* keep entry in sys mailbox */ 1247c478bd9Sstevel@tonic-gate #define MMARK (1<<5) /* message is marked! */ 1257c478bd9Sstevel@tonic-gate #define MODIFY (1<<6) /* message has been modified */ 1267c478bd9Sstevel@tonic-gate #define MNEW (1<<7) /* message has never been seen */ 1277c478bd9Sstevel@tonic-gate #define MREAD (1<<8) /* message has been read sometime. */ 1287c478bd9Sstevel@tonic-gate #define MSTATUS (1<<9) /* message status has changed */ 1297c478bd9Sstevel@tonic-gate #define MBOX (1<<10) /* Send this to mbox, regardless */ 1307c478bd9Sstevel@tonic-gate #define MBOXED (1<<11) /* message has been sent to mbox */ 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate #define H_AFWDCNT 1 /* "Auto-Forward-Count:" */ 1337c478bd9Sstevel@tonic-gate #define H_AFWDFROM 2 /* "Auto-Forwarded-From:" */ 1347c478bd9Sstevel@tonic-gate #define H_CLEN 3 /* "Content-Length:" */ 1357c478bd9Sstevel@tonic-gate #define H_CTYPE 4 /* "Content-Type:" */ 1367c478bd9Sstevel@tonic-gate #define H_DATE 5 /* "Date:" */ 1377c478bd9Sstevel@tonic-gate #define H_DEFOPTS 6 /* "Default-Options:" */ 1387c478bd9Sstevel@tonic-gate #define H_EOH 7 /* "End-of-Header:" */ 1397c478bd9Sstevel@tonic-gate #define H_FROM 8 /* "From " */ 1407c478bd9Sstevel@tonic-gate #define H_FROM1 9 /* ">From " */ 1417c478bd9Sstevel@tonic-gate #define H_FROM2 10 /* "From: " */ 1427c478bd9Sstevel@tonic-gate #define H_MTSID 11 /* "MTS-Message-ID:" */ 1437c478bd9Sstevel@tonic-gate #define H_MTYPE 12 /* "Message-Type:" */ 1447c478bd9Sstevel@tonic-gate #define H_MVERS 13 /* "Message-Version:" */ 1457c478bd9Sstevel@tonic-gate #define H_MSVC 14 /* "Message-Service:" */ 1467c478bd9Sstevel@tonic-gate #define H_RECEIVED 15 /* "Received:" */ 1477c478bd9Sstevel@tonic-gate #define H_RVERS 16 /* "Report-Version:" */ 1487c478bd9Sstevel@tonic-gate #define H_STATUS 17 /* "Status:" */ 1497c478bd9Sstevel@tonic-gate #define H_SUBJ 18 /* "Subject:" */ 1507c478bd9Sstevel@tonic-gate #define H_TO 19 /* "To:" */ 1517c478bd9Sstevel@tonic-gate #define H_TCOPY 20 /* ">To:" */ 1527c478bd9Sstevel@tonic-gate #define H_TROPTS 21 /* "Transport-Options:" */ 1537c478bd9Sstevel@tonic-gate #define H_UAID 22 /* "UA-Content-ID:" */ 154*eb2b0a61Sas145665 1557c478bd9Sstevel@tonic-gate #define H_DAFWDFROM 23 /* Hold A-F-F when sending Del. Notf. */ 1567c478bd9Sstevel@tonic-gate #define H_DTCOPY 24 /* Hold ">To:" when sending Del. Notf. */ 1577c478bd9Sstevel@tonic-gate #define H_DRECEIVED 25 /* Hold Rcvd: when sending Del. Notf. */ 1587c478bd9Sstevel@tonic-gate #define H_CONT 26 /* Continuation of previous line */ 1597c478bd9Sstevel@tonic-gate #define H_NAMEVALUE 27 /* unrecognized "name: value" hdr line */ 1607c478bd9Sstevel@tonic-gate 1617c478bd9Sstevel@tonic-gate /* 1627c478bd9Sstevel@tonic-gate * Format of the command description table. 1637c478bd9Sstevel@tonic-gate * The actual table is declared and initialized 1647c478bd9Sstevel@tonic-gate * in lex.c 1657c478bd9Sstevel@tonic-gate */ 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate struct cmd { 1687c478bd9Sstevel@tonic-gate char *c_name; /* Name of command */ 1697c478bd9Sstevel@tonic-gate int (*c_func)(void *); /* Implementor of the command */ 1707c478bd9Sstevel@tonic-gate short c_argtype; /* Type of arglist (see below) */ 1717c478bd9Sstevel@tonic-gate short c_msgflag; /* Required flags of messages */ 1727c478bd9Sstevel@tonic-gate short c_msgmask; /* Relevant flags of messages */ 1737c478bd9Sstevel@tonic-gate }; 1747c478bd9Sstevel@tonic-gate 1757c478bd9Sstevel@tonic-gate /* can't initialize unions */ 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate #define c_minargs c_msgflag /* Minimum argcount for RAWLIST */ 1787c478bd9Sstevel@tonic-gate #define c_maxargs c_msgmask /* Max argcount for RAWLIST */ 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate /* 1817c478bd9Sstevel@tonic-gate * Argument types. 1827c478bd9Sstevel@tonic-gate */ 1837c478bd9Sstevel@tonic-gate 1847c478bd9Sstevel@tonic-gate #define MSGLIST 0 /* Message list type */ 1857c478bd9Sstevel@tonic-gate #define STRLIST 1 /* A pure string */ 1867c478bd9Sstevel@tonic-gate #define RAWLIST 2 /* Shell string list */ 1877c478bd9Sstevel@tonic-gate #define NOLIST 3 /* Just plain 0 */ 1887c478bd9Sstevel@tonic-gate #define NDMLIST 4 /* Message list, no defaults */ 1897c478bd9Sstevel@tonic-gate 1907c478bd9Sstevel@tonic-gate #define P 040 /* Autoprint dot after command */ 1917c478bd9Sstevel@tonic-gate #define I 0100 /* Interactive command bit */ 1927c478bd9Sstevel@tonic-gate #define M 0200 /* Legal from send mode bit */ 1937c478bd9Sstevel@tonic-gate #define W 0400 /* Illegal when read only bit */ 1947c478bd9Sstevel@tonic-gate #define F 01000 /* Is a conditional command */ 1957c478bd9Sstevel@tonic-gate #define T 02000 /* Is a transparent command */ 1967c478bd9Sstevel@tonic-gate #define R 04000 /* Cannot be called from collect */ 1977c478bd9Sstevel@tonic-gate 1987c478bd9Sstevel@tonic-gate /* 1997c478bd9Sstevel@tonic-gate * Oft-used mask values 2007c478bd9Sstevel@tonic-gate */ 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate #define MMNORM (MDELETED|MSAVED) /* Look at both save and delete bits */ 2037c478bd9Sstevel@tonic-gate #define MMNDEL MDELETED /* Look only at deleted bit */ 2047c478bd9Sstevel@tonic-gate 2057c478bd9Sstevel@tonic-gate /* 2067c478bd9Sstevel@tonic-gate * Structure used to return a break down of a head 2077c478bd9Sstevel@tonic-gate * line 2087c478bd9Sstevel@tonic-gate */ 2097c478bd9Sstevel@tonic-gate 2107c478bd9Sstevel@tonic-gate struct headline { 2117c478bd9Sstevel@tonic-gate char *l_from; /* The name of the sender */ 2127c478bd9Sstevel@tonic-gate char *l_tty; /* His tty string (if any) */ 2137c478bd9Sstevel@tonic-gate char *l_date; /* The entire date string */ 2147c478bd9Sstevel@tonic-gate }; 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate #define GTO 1 /* Grab To: line */ 2177c478bd9Sstevel@tonic-gate #define GSUBJECT 2 /* Likewise, Subject: line */ 2187c478bd9Sstevel@tonic-gate #define GCC 4 /* And the Cc: line */ 2197c478bd9Sstevel@tonic-gate #define GBCC 8 /* And also the Bcc: line */ 2207c478bd9Sstevel@tonic-gate #define GDEFOPT 16 /* And the Default-Options: lines */ 2217c478bd9Sstevel@tonic-gate #define GNL 32 /* Print blank line after */ 2227c478bd9Sstevel@tonic-gate #define GOTHER 64 /* Other header lines */ 2237c478bd9Sstevel@tonic-gate #define GMASK (GTO|GSUBJECT|GCC|GBCC|GDEFOPT|GNL|GOTHER) 2247c478bd9Sstevel@tonic-gate /* Mask of all header lines */ 2257c478bd9Sstevel@tonic-gate #define GDEL 128 /* Entity removed from list */ 2267c478bd9Sstevel@tonic-gate #define GCLEN 256 /* Include Content-Length header */ 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate /* 2297c478bd9Sstevel@tonic-gate * Structure used to pass about the current 2307c478bd9Sstevel@tonic-gate * state of the user-typed message header. 2317c478bd9Sstevel@tonic-gate */ 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate struct header { 2347c478bd9Sstevel@tonic-gate char *h_to; /* Dynamic "To:" string */ 2357c478bd9Sstevel@tonic-gate char *h_subject; /* Subject string */ 2367c478bd9Sstevel@tonic-gate char *h_cc; /* Carbon copies string */ 2377c478bd9Sstevel@tonic-gate char *h_bcc; /* Blind carbon copies */ 2387c478bd9Sstevel@tonic-gate char *h_defopt; /* Default options */ 2397c478bd9Sstevel@tonic-gate char **h_others; /* Other header lines */ 2407c478bd9Sstevel@tonic-gate int h_seq; /* Sequence for optimization */ 2417c478bd9Sstevel@tonic-gate }; 2427c478bd9Sstevel@tonic-gate 2437c478bd9Sstevel@tonic-gate /* 2447c478bd9Sstevel@tonic-gate * Structure of namelist nodes used in processing 2457c478bd9Sstevel@tonic-gate * the recipients of mail and aliases and all that 2467c478bd9Sstevel@tonic-gate * kind of stuff. 2477c478bd9Sstevel@tonic-gate */ 2487c478bd9Sstevel@tonic-gate 2497c478bd9Sstevel@tonic-gate struct name { 2507c478bd9Sstevel@tonic-gate struct name *n_flink; /* Forward link in list. */ 2517c478bd9Sstevel@tonic-gate struct name *n_blink; /* Backward list link */ 2527c478bd9Sstevel@tonic-gate short n_type; /* From which list it came */ 2537c478bd9Sstevel@tonic-gate char *n_name; /* This fella's name */ 2547c478bd9Sstevel@tonic-gate char *n_full; /* Full name */ 2557c478bd9Sstevel@tonic-gate }; 2567c478bd9Sstevel@tonic-gate 2577c478bd9Sstevel@tonic-gate /* 2587c478bd9Sstevel@tonic-gate * Structure of a variable node. All variables are 2597c478bd9Sstevel@tonic-gate * kept on a singly-linked list of these, rooted by 2607c478bd9Sstevel@tonic-gate * "variables" 2617c478bd9Sstevel@tonic-gate */ 2627c478bd9Sstevel@tonic-gate 2637c478bd9Sstevel@tonic-gate struct var { 2647c478bd9Sstevel@tonic-gate struct var *v_link; /* Forward link to next variable */ 2657c478bd9Sstevel@tonic-gate char *v_name; /* The variable's name */ 2667c478bd9Sstevel@tonic-gate char *v_value; /* And it's current value */ 2677c478bd9Sstevel@tonic-gate }; 2687c478bd9Sstevel@tonic-gate 2697c478bd9Sstevel@tonic-gate struct mgroup { 2707c478bd9Sstevel@tonic-gate struct mgroup *ge_link; /* Next person in this group */ 2717c478bd9Sstevel@tonic-gate char *ge_name; /* This person's user name */ 2727c478bd9Sstevel@tonic-gate }; 2737c478bd9Sstevel@tonic-gate 2747c478bd9Sstevel@tonic-gate struct grouphead { 2757c478bd9Sstevel@tonic-gate struct grouphead *g_link; /* Next grouphead in list */ 2767c478bd9Sstevel@tonic-gate char *g_name; /* Name of this group */ 2777c478bd9Sstevel@tonic-gate struct mgroup *g_list; /* Users in group. */ 2787c478bd9Sstevel@tonic-gate }; 2797c478bd9Sstevel@tonic-gate 2807c478bd9Sstevel@tonic-gate #define NIL ((struct name *)0) /* The nil pointer for namelists */ 2817c478bd9Sstevel@tonic-gate #define NONE ((struct cmd *)0) /* The nil pointer to command tab */ 2827c478bd9Sstevel@tonic-gate #define NOVAR ((struct var *)0) /* The nil pointer to variables */ 2837c478bd9Sstevel@tonic-gate #define NOGRP ((struct grouphead *)0) /* The nil grouphead pointer */ 2847c478bd9Sstevel@tonic-gate #define NOGE ((struct mgroup *)0) /* The nil group pointer */ 2857c478bd9Sstevel@tonic-gate #define NOFP ((struct fplst *)0) /* The nil file pointer */ 2867c478bd9Sstevel@tonic-gate 2877c478bd9Sstevel@tonic-gate #define TRUE 1 2887c478bd9Sstevel@tonic-gate #define FALSE 0 2897c478bd9Sstevel@tonic-gate 2907c478bd9Sstevel@tonic-gate #define DEADPERM 0600 /* permissions of dead.letter */ 2917c478bd9Sstevel@tonic-gate #define TEMPPERM 0600 /* permissions of temp files */ 2927c478bd9Sstevel@tonic-gate #define MBOXPERM 0600 /* permissions of ~/mbox */ 2937c478bd9Sstevel@tonic-gate 2947c478bd9Sstevel@tonic-gate #ifndef MFMODE 2957c478bd9Sstevel@tonic-gate #define MFMODE 0600 /* create mode for `/var/mail' files */ 2967c478bd9Sstevel@tonic-gate #endif 2977c478bd9Sstevel@tonic-gate 2987c478bd9Sstevel@tonic-gate /* 2997c478bd9Sstevel@tonic-gate * Structure of the hash table of ignored header fields 3007c478bd9Sstevel@tonic-gate */ 3017c478bd9Sstevel@tonic-gate struct ignore { 3027c478bd9Sstevel@tonic-gate struct ignore *i_link; /* Next ignored field in bucket */ 3037c478bd9Sstevel@tonic-gate char *i_field; /* This ignored field */ 3047c478bd9Sstevel@tonic-gate }; 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate #ifdef preSVr4 3077c478bd9Sstevel@tonic-gate struct utimbuf { 3087c478bd9Sstevel@tonic-gate time_t actime; 3097c478bd9Sstevel@tonic-gate time_t modtime; 3107c478bd9Sstevel@tonic-gate }; 3117c478bd9Sstevel@tonic-gate #else 3127c478bd9Sstevel@tonic-gate #include <utime.h> 3137c478bd9Sstevel@tonic-gate #endif 3147c478bd9Sstevel@tonic-gate 3157c478bd9Sstevel@tonic-gate /* 3167c478bd9Sstevel@tonic-gate * Token values returned by the scanner used for argument lists. 3177c478bd9Sstevel@tonic-gate * Also, sizes of scanner-related things. 3187c478bd9Sstevel@tonic-gate */ 3197c478bd9Sstevel@tonic-gate 3207c478bd9Sstevel@tonic-gate #define TEOL 0 /* End of the command line */ 3217c478bd9Sstevel@tonic-gate #define TNUMBER 1 /* A message number */ 3227c478bd9Sstevel@tonic-gate #define TDASH 2 /* A simple dash */ 3237c478bd9Sstevel@tonic-gate #define TSTRING 3 /* A string (possibly containing -) */ 3247c478bd9Sstevel@tonic-gate #define TDOT 4 /* A "." */ 3257c478bd9Sstevel@tonic-gate #define TUP 5 /* An "^" */ 3267c478bd9Sstevel@tonic-gate #define TDOLLAR 6 /* A "$" */ 3277c478bd9Sstevel@tonic-gate #define TSTAR 7 /* A "*" */ 3287c478bd9Sstevel@tonic-gate #define TOPEN 8 /* An '(' */ 3297c478bd9Sstevel@tonic-gate #define TCLOSE 9 /* A ')' */ 3307c478bd9Sstevel@tonic-gate #define TPLUS 10 /* A '+' */ 3317c478bd9Sstevel@tonic-gate 3327c478bd9Sstevel@tonic-gate #define REGDEP 2 /* Maximum regret depth. */ 3337c478bd9Sstevel@tonic-gate #define STRINGLEN 1024 /* Maximum length of string token */ 3347c478bd9Sstevel@tonic-gate 3357c478bd9Sstevel@tonic-gate /* 3367c478bd9Sstevel@tonic-gate * Constants for conditional commands. These describe whether 3377c478bd9Sstevel@tonic-gate * we should be executing stuff or not. 3387c478bd9Sstevel@tonic-gate */ 3397c478bd9Sstevel@tonic-gate 3407c478bd9Sstevel@tonic-gate #define CANY 0 /* Execute in send or receive mode */ 3417c478bd9Sstevel@tonic-gate #define CRCV 1 /* Execute in receive mode only */ 3427c478bd9Sstevel@tonic-gate #define CSEND 2 /* Execute in send mode only */ 3437c478bd9Sstevel@tonic-gate #define CTTY 3 /* Execute if attached to a tty only */ 3447c478bd9Sstevel@tonic-gate #define CNOTTY 4 /* Execute if not attached to a tty */ 3457c478bd9Sstevel@tonic-gate 3467c478bd9Sstevel@tonic-gate /* 3477c478bd9Sstevel@tonic-gate * Flags for msend(). 3487c478bd9Sstevel@tonic-gate */ 3497c478bd9Sstevel@tonic-gate 3507c478bd9Sstevel@tonic-gate #define M_IGNORE 1 /* Do "ignore/retain" processing */ 3517c478bd9Sstevel@tonic-gate #define M_SAVING 2 /* Saving to a file/folder */ 3527c478bd9Sstevel@tonic-gate 3537c478bd9Sstevel@tonic-gate /* 3547c478bd9Sstevel@tonic-gate * VM/UNIX has a vfork system call which is faster than forking. If we 3557c478bd9Sstevel@tonic-gate * don't have it, fork(2) will do . . . 3567c478bd9Sstevel@tonic-gate */ 3577c478bd9Sstevel@tonic-gate 3587c478bd9Sstevel@tonic-gate #if !defined(VMUNIX) && defined(preSVr4) 3597c478bd9Sstevel@tonic-gate #define vfork() fork() 3607c478bd9Sstevel@tonic-gate #endif 3617c478bd9Sstevel@tonic-gate #ifndef SIGRETRO 3627c478bd9Sstevel@tonic-gate #define sigchild() 3637c478bd9Sstevel@tonic-gate #endif 3647c478bd9Sstevel@tonic-gate 3657c478bd9Sstevel@tonic-gate 3667c478bd9Sstevel@tonic-gate /* 3677c478bd9Sstevel@tonic-gate * 4.2bsd signal interface help... 3687c478bd9Sstevel@tonic-gate */ 3697c478bd9Sstevel@tonic-gate #ifdef VMUNIX 3707c478bd9Sstevel@tonic-gate #define sigset(s, a) signal(s, a) 3717c478bd9Sstevel@tonic-gate #define sigsys(s, a) signal(s, a) 3727c478bd9Sstevel@tonic-gate #else 3737c478bd9Sstevel@tonic-gate #ifndef preSVr4 3747c478bd9Sstevel@tonic-gate /* SVr4 version of sigset() in fio.c */ 3757c478bd9Sstevel@tonic-gate #define sigsys(s, a) signal(s, a) 3767c478bd9Sstevel@tonic-gate #define setjmp(x) sigsetjmp((x), 1) 3777c478bd9Sstevel@tonic-gate #define longjmp siglongjmp 3787c478bd9Sstevel@tonic-gate #define jmp_buf sigjmp_buf 3797c478bd9Sstevel@tonic-gate #else 3807c478bd9Sstevel@tonic-gate #define OLD_BSD_SIGS 3817c478bd9Sstevel@tonic-gate #endif 3827c478bd9Sstevel@tonic-gate #endif 3837c478bd9Sstevel@tonic-gate 3847c478bd9Sstevel@tonic-gate /* 3857c478bd9Sstevel@tonic-gate * Truncate a file to the last character written. This is 3867c478bd9Sstevel@tonic-gate * useful just before closing an old file that was opened 3877c478bd9Sstevel@tonic-gate * for read/write. 3887c478bd9Sstevel@tonic-gate */ 3897c478bd9Sstevel@tonic-gate #define trunc(stream) ftruncate(fileno(stream), (long)ftell(stream)) 3907c478bd9Sstevel@tonic-gate 3917c478bd9Sstevel@tonic-gate /* 3927c478bd9Sstevel@tonic-gate * The pointers for the string allocation routines, 3937c478bd9Sstevel@tonic-gate * there are NSPACE independent areas. 3947c478bd9Sstevel@tonic-gate * The first holds STRINGSIZE bytes, the next 3957c478bd9Sstevel@tonic-gate * twice as much, and so on. 3967c478bd9Sstevel@tonic-gate */ 3977c478bd9Sstevel@tonic-gate 3987c478bd9Sstevel@tonic-gate #define NSPACE 25 /* Total number of string spaces */ 3997c478bd9Sstevel@tonic-gate struct strings { 4007c478bd9Sstevel@tonic-gate char *s_topFree; /* Beginning of this area */ 4017c478bd9Sstevel@tonic-gate char *s_nextFree; /* Next alloctable place here */ 4027c478bd9Sstevel@tonic-gate unsigned s_nleft; /* Number of bytes left here */ 4037c478bd9Sstevel@tonic-gate }; 4047c478bd9Sstevel@tonic-gate 4057c478bd9Sstevel@tonic-gate /* The following typedefs must be used in SVR4 */ 4067c478bd9Sstevel@tonic-gate #ifdef preSVr4 4077c478bd9Sstevel@tonic-gate #ifndef sun 4087c478bd9Sstevel@tonic-gate typedef int gid_t; 4097c478bd9Sstevel@tonic-gate typedef int uid_t; 4107c478bd9Sstevel@tonic-gate typedef int mode_t; 4117c478bd9Sstevel@tonic-gate typedef int pid_t; 4127c478bd9Sstevel@tonic-gate #endif 4137c478bd9Sstevel@tonic-gate #endif 4147c478bd9Sstevel@tonic-gate 4157c478bd9Sstevel@tonic-gate #define STSIZ 40 4167c478bd9Sstevel@tonic-gate #define TMPSIZ 14 4177c478bd9Sstevel@tonic-gate /* 4187c478bd9Sstevel@tonic-gate * Forward declarations of routine types to keep lint and cc happy. 4197c478bd9Sstevel@tonic-gate */ 4207c478bd9Sstevel@tonic-gate 4217c478bd9Sstevel@tonic-gate extern int Copy(int *msgvec); 4227c478bd9Sstevel@tonic-gate extern FILE *Fdopen(int fildes, char *mode); 4237c478bd9Sstevel@tonic-gate extern int Followup(int *msgvec); 4247c478bd9Sstevel@tonic-gate extern char *Getf(register char *s); 4257c478bd9Sstevel@tonic-gate extern int More(int *msgvec); 4267c478bd9Sstevel@tonic-gate extern int Respond(int *msgvec); 4277c478bd9Sstevel@tonic-gate extern int Save(int *msgvec); 4287c478bd9Sstevel@tonic-gate extern int Sendm(char *str); 4297c478bd9Sstevel@tonic-gate extern int Sput(char str[]); 4307c478bd9Sstevel@tonic-gate extern int Type(int *msgvec); 4317c478bd9Sstevel@tonic-gate extern void Verhogen(void); 4327c478bd9Sstevel@tonic-gate extern char *addone(char hf[], char news[]); 4337c478bd9Sstevel@tonic-gate extern char *addto(char hf[], char news[]); 4347c478bd9Sstevel@tonic-gate extern void alter(char name[]); 4357c478bd9Sstevel@tonic-gate extern int alternates(char **namelist); 4367c478bd9Sstevel@tonic-gate extern void announce(void); 4377c478bd9Sstevel@tonic-gate extern int any(int ch, char *str); 4387c478bd9Sstevel@tonic-gate extern int anyof(register char *s1, register char *s2); 4397c478bd9Sstevel@tonic-gate extern int argcount(char **argv); 4407c478bd9Sstevel@tonic-gate extern void assign(char name[], char value[]); 4417c478bd9Sstevel@tonic-gate extern int blankline(const char linebuf[]); 4427c478bd9Sstevel@tonic-gate extern struct name *cat(struct name *n1, struct name *n2); 4437c478bd9Sstevel@tonic-gate extern FILE *collect(struct header *hp); 4447c478bd9Sstevel@tonic-gate extern void commands(void); 4457c478bd9Sstevel@tonic-gate extern char *copy(char *str1, char *str2); 4467c478bd9Sstevel@tonic-gate extern int copycmd(char str[]); 4477c478bd9Sstevel@tonic-gate extern int deassign(register char *s); 4487c478bd9Sstevel@tonic-gate extern int delm(int *msgvec); 4497c478bd9Sstevel@tonic-gate extern struct name *delname(register struct name *np, char name[]); 4507c478bd9Sstevel@tonic-gate extern int deltype(int msgvec[]); 4517c478bd9Sstevel@tonic-gate extern char *detract(register struct name *np, int ntype); 4527c478bd9Sstevel@tonic-gate extern int docomma(char *s); 4537c478bd9Sstevel@tonic-gate extern int dopipe(char str[]); 4547c478bd9Sstevel@tonic-gate extern int dosh(char *str); 4557c478bd9Sstevel@tonic-gate extern int echo(register char **argv); 4567c478bd9Sstevel@tonic-gate extern int editor(int *msgvec); 4577c478bd9Sstevel@tonic-gate extern int edstop(int noremove); 4587c478bd9Sstevel@tonic-gate extern struct name *elide(struct name *names); 4597c478bd9Sstevel@tonic-gate extern int elsecmd(void); 4607c478bd9Sstevel@tonic-gate extern int endifcmd(void); 4617c478bd9Sstevel@tonic-gate extern int execute(char linebuf[], int contxt); 4627c478bd9Sstevel@tonic-gate extern char *expand(char *name); 4637c478bd9Sstevel@tonic-gate extern struct name *extract(char line[], int arg_ntype); 4647c478bd9Sstevel@tonic-gate extern int fferror(FILE *iob); 4657c478bd9Sstevel@tonic-gate extern int field(char str[]); 4667c478bd9Sstevel@tonic-gate extern int file(char **argv); 4677c478bd9Sstevel@tonic-gate extern struct grouphead *findgroup(char name[]); 4687c478bd9Sstevel@tonic-gate extern void findmail(char *name); 4697c478bd9Sstevel@tonic-gate extern int first(int f, int m); 4707c478bd9Sstevel@tonic-gate extern void flush(void); 4717c478bd9Sstevel@tonic-gate extern int folders(char **arglist); 4727c478bd9Sstevel@tonic-gate extern int followup(int *msgvec); 4737c478bd9Sstevel@tonic-gate extern int from(int *msgvec); 4747c478bd9Sstevel@tonic-gate extern off_t fsize(FILE *iob); 4757c478bd9Sstevel@tonic-gate extern int getfold(char *name); 4767c478bd9Sstevel@tonic-gate extern int gethfield(register FILE *f, char linebuf[], register long rem); 4777c478bd9Sstevel@tonic-gate extern int getline(char *line, int size, FILE *f, int *hasnulls); 478*eb2b0a61Sas145665 extern int getmessage(char *buf, int *vector, int flags); 4797c478bd9Sstevel@tonic-gate extern int getmsglist(char *buf, int *vector, int flags); 4807c478bd9Sstevel@tonic-gate extern int getname(uid_t uid, char namebuf[]); 4817c478bd9Sstevel@tonic-gate extern int getrawlist(char line[], char **argv, int argc); 482*eb2b0a61Sas145665 extern void getrecf(char *buf, char *recfile, 483*eb2b0a61Sas145665 int useauthor, int sz_recfile); 4847c478bd9Sstevel@tonic-gate extern uid_t getuserid(char name[]); 4857c478bd9Sstevel@tonic-gate extern int grabh(register struct header *hp, int gflags, int subjtop); 4867c478bd9Sstevel@tonic-gate extern int group(char **argv); 4877c478bd9Sstevel@tonic-gate extern void hangup(int); 4887c478bd9Sstevel@tonic-gate extern int hash(char name[]); 4897c478bd9Sstevel@tonic-gate extern char *hcontents(char hfield[]); 4907c478bd9Sstevel@tonic-gate extern int headerp(register char *line); 4917c478bd9Sstevel@tonic-gate extern int headers(int *msgvec); 4927c478bd9Sstevel@tonic-gate extern int help(void); 4937c478bd9Sstevel@tonic-gate extern char *helppath(char *file); 494*eb2b0a61Sas145665 extern char *hfield(char field[], struct message *mp, 495*eb2b0a61Sas145665 char *(*add)(char *, char *)); 4967c478bd9Sstevel@tonic-gate extern void holdsigs(void); 4977c478bd9Sstevel@tonic-gate extern int icequal(register char *s1, register char *s2); 4987c478bd9Sstevel@tonic-gate extern int ifcmd(char **argv); 4997c478bd9Sstevel@tonic-gate extern int igfield(char *list[]); 5007c478bd9Sstevel@tonic-gate extern int inc(void); 5017c478bd9Sstevel@tonic-gate extern void inithost(void); 5027c478bd9Sstevel@tonic-gate extern int isdir(char name[]); 5037c478bd9Sstevel@tonic-gate extern int ishead(char linebuf[]); 5047c478bd9Sstevel@tonic-gate extern int ishfield(char linebuf[], char field[]); 5057c478bd9Sstevel@tonic-gate extern int ishost(char *sys, char *rest); 5067c478bd9Sstevel@tonic-gate extern int isign(char *field, int saving); 5077c478bd9Sstevel@tonic-gate extern void istrcpy(char *dest, int dstsize, char *src); 5087c478bd9Sstevel@tonic-gate extern void lcwrite(char *fn, FILE *fi, FILE *fo, int addnl); 5097c478bd9Sstevel@tonic-gate extern void load(char *name); 5107c478bd9Sstevel@tonic-gate extern int loadmsg(char str[]); 5117c478bd9Sstevel@tonic-gate extern int lock(FILE *fp, char *mode, int blk); 5127c478bd9Sstevel@tonic-gate extern void lockmail(void); 5137c478bd9Sstevel@tonic-gate extern int mail(char **people); 5147c478bd9Sstevel@tonic-gate extern void mail1(struct header *hp, int use_to, char *orig_to); 5157c478bd9Sstevel@tonic-gate extern void mapf(register struct name *np, char *from); 5167c478bd9Sstevel@tonic-gate extern int mboxit(int msgvec[]); 5177c478bd9Sstevel@tonic-gate extern void mechk(struct name *names); 518*eb2b0a61Sas145665 extern int member(register char *realfield, 519*eb2b0a61Sas145665 register struct ignore **table); 5207c478bd9Sstevel@tonic-gate extern int messize(int *msgvec); 5217c478bd9Sstevel@tonic-gate extern void minit(void); 5227c478bd9Sstevel@tonic-gate extern int more(int *msgvec); 523*eb2b0a61Sas145665 extern long msend(struct message *mailp, FILE *obuf, 524*eb2b0a61Sas145665 int flag, int (*fp)(const char *, FILE *)); 5257c478bd9Sstevel@tonic-gate extern int my_fclose(register FILE *iop); 5267c478bd9Sstevel@tonic-gate extern FILE *my_fopen(char *file, char *mode); 5277c478bd9Sstevel@tonic-gate extern char *nameof(register struct message *mp); 5287c478bd9Sstevel@tonic-gate extern char *netmap(char name[], char from[]); 5297c478bd9Sstevel@tonic-gate extern int newfileinfo(int start); 5307c478bd9Sstevel@tonic-gate extern int next(int *msgvec); 5317c478bd9Sstevel@tonic-gate extern int npclose(FILE *ptr); 5327c478bd9Sstevel@tonic-gate extern FILE *npopen(char *cmd, char *mode); 5337c478bd9Sstevel@tonic-gate extern char *nstrcpy(char *dst, int dstsize, char *src); 5347c478bd9Sstevel@tonic-gate extern char *nstrcat(char *dst, int dstsize, char *src); 5357c478bd9Sstevel@tonic-gate extern int null(char *e); 5367c478bd9Sstevel@tonic-gate extern int outof(struct name *names, FILE *fo); 5377c478bd9Sstevel@tonic-gate extern struct name *outpre(struct name *to); 5387c478bd9Sstevel@tonic-gate extern void panic(char *str); 5397c478bd9Sstevel@tonic-gate extern void parse(char line[], struct headline *hl, char pbuf[]); 5407c478bd9Sstevel@tonic-gate extern int pcmdlist(void); 5417c478bd9Sstevel@tonic-gate extern int pdot(void); 5427c478bd9Sstevel@tonic-gate extern int preserve(int *msgvec); 5437c478bd9Sstevel@tonic-gate extern void printgroup(char name[]); 5447c478bd9Sstevel@tonic-gate extern void printhead(int mesg); 5457c478bd9Sstevel@tonic-gate extern int puthead(struct header *hp, FILE *fo, int w, long clen); 5467c478bd9Sstevel@tonic-gate extern int pversion(char *e); 5477c478bd9Sstevel@tonic-gate extern void quit(int noremove); 5487c478bd9Sstevel@tonic-gate extern int readline(FILE *ibuf, char *linebuf); 5497c478bd9Sstevel@tonic-gate extern void receipt(struct message *mp); 5507c478bd9Sstevel@tonic-gate extern void relsesigs(void); 5517c478bd9Sstevel@tonic-gate extern int removefile(char name[]); 5527c478bd9Sstevel@tonic-gate extern int replyall(int *msgvec); 5537c478bd9Sstevel@tonic-gate extern int replysender(int *msgvec); 5547c478bd9Sstevel@tonic-gate extern int respond(int *msgvec); 5557c478bd9Sstevel@tonic-gate extern int retfield(char *list[]); 5567c478bd9Sstevel@tonic-gate extern int rexit(int e); 5577c478bd9Sstevel@tonic-gate extern char *safeexpand(char name[]); 5587c478bd9Sstevel@tonic-gate extern void *salloc(unsigned size); 5597c478bd9Sstevel@tonic-gate extern void *srealloc(void *optr, unsigned size); 5607c478bd9Sstevel@tonic-gate extern int samebody(register char *user, register char *addr, 5617c478bd9Sstevel@tonic-gate int fuzzy); 5627c478bd9Sstevel@tonic-gate extern int save(char str[]); 5637c478bd9Sstevel@tonic-gate extern void savedead(int s); 5647c478bd9Sstevel@tonic-gate extern char *savestr(char *str); 5657c478bd9Sstevel@tonic-gate extern int schdir(char *str); 5667c478bd9Sstevel@tonic-gate extern int screensize(void); 5677c478bd9Sstevel@tonic-gate extern int scroll(char arg[]); 5687c478bd9Sstevel@tonic-gate extern int sendm(char *str); 5697c478bd9Sstevel@tonic-gate extern int set(char **arglist); 5707c478bd9Sstevel@tonic-gate extern void setclen(register struct message *mp); 5717c478bd9Sstevel@tonic-gate extern int setfile(char *name, int isedit); 5727c478bd9Sstevel@tonic-gate extern FILE *setinput(register struct message *mp); 5737c478bd9Sstevel@tonic-gate extern void setptr(register FILE *ibuf); 5747c478bd9Sstevel@tonic-gate extern int shell(char *str); 5757c478bd9Sstevel@tonic-gate #ifndef sigchild 5767c478bd9Sstevel@tonic-gate extern void sigchild(void); 5777c478bd9Sstevel@tonic-gate #endif 5787c478bd9Sstevel@tonic-gate #ifndef sigset 5797c478bd9Sstevel@tonic-gate extern void (*sigset())(); 5807c478bd9Sstevel@tonic-gate #endif 5817c478bd9Sstevel@tonic-gate extern char *skin(char *name); 5827c478bd9Sstevel@tonic-gate extern char *snarf(char linebuf[], int *flag, int erf); 5837c478bd9Sstevel@tonic-gate extern int source(char name[]); 5847c478bd9Sstevel@tonic-gate extern char *splice(char *addr, char *hdr); 5857c478bd9Sstevel@tonic-gate extern int sput(char str[]); 5867c478bd9Sstevel@tonic-gate extern void sreset(void); 5877c478bd9Sstevel@tonic-gate extern void stop(int s); 5887c478bd9Sstevel@tonic-gate extern int stouch(int msgvec[]); 5897c478bd9Sstevel@tonic-gate extern int substr(char *string1, char *string2); 5907c478bd9Sstevel@tonic-gate extern int swrite(char str[]); 5917c478bd9Sstevel@tonic-gate extern struct name *tailof(struct name *name); 5927c478bd9Sstevel@tonic-gate extern void tinit(void); 5937c478bd9Sstevel@tonic-gate extern int tmail(void); 5947c478bd9Sstevel@tonic-gate extern int top(int *msgvec); 5957c478bd9Sstevel@tonic-gate extern void touch(int mesg); 5967c478bd9Sstevel@tonic-gate extern struct name *translate(struct name *np); 5977c478bd9Sstevel@tonic-gate extern int type(int *msgvec); 5987c478bd9Sstevel@tonic-gate extern int undelete(int *msgvec); 5997c478bd9Sstevel@tonic-gate extern int ungroup(char **argv); 6007c478bd9Sstevel@tonic-gate extern int unigfield(char *list[]); 6017c478bd9Sstevel@tonic-gate extern void unlockmail(void); 6027c478bd9Sstevel@tonic-gate extern char **unpack(struct name *np); 6037c478bd9Sstevel@tonic-gate extern int unread(int msgvec[]); 6047c478bd9Sstevel@tonic-gate extern int unretfield(char *list[]); 6057c478bd9Sstevel@tonic-gate extern int unset(char **arglist); 6067c478bd9Sstevel@tonic-gate extern int unstack(void); 6077c478bd9Sstevel@tonic-gate extern char *unuucp(char *name); 6087c478bd9Sstevel@tonic-gate extern struct name *usermap(struct name *names); 6097c478bd9Sstevel@tonic-gate extern char *value(char name[]); 6107c478bd9Sstevel@tonic-gate extern char *vcopy(char str[]); 6117c478bd9Sstevel@tonic-gate extern void vfree(register char *cp); 6127c478bd9Sstevel@tonic-gate extern int visual(int *msgvec); 6137c478bd9Sstevel@tonic-gate extern char *yankword(char *name, char *word, int sz, int comma); 6147c478bd9Sstevel@tonic-gate 6157c478bd9Sstevel@tonic-gate /* 6167c478bd9Sstevel@tonic-gate * These functions are defined in libmail.a 6177c478bd9Sstevel@tonic-gate */ 6187c478bd9Sstevel@tonic-gate #ifdef __cplusplus 6197c478bd9Sstevel@tonic-gate extern "C" { 6207c478bd9Sstevel@tonic-gate #endif 6217c478bd9Sstevel@tonic-gate extern int delempty(mode_t, char *); 6227c478bd9Sstevel@tonic-gate extern char *maildomain(void); 6237c478bd9Sstevel@tonic-gate extern void touchlock(void); 6247c478bd9Sstevel@tonic-gate extern char *xgetenv(char *); 6257c478bd9Sstevel@tonic-gate extern int xsetenv(char *); 6267c478bd9Sstevel@tonic-gate #ifdef __cplusplus 6277c478bd9Sstevel@tonic-gate } 6287c478bd9Sstevel@tonic-gate #endif 6297c478bd9Sstevel@tonic-gate 6307c478bd9Sstevel@tonic-gate /* 6317c478bd9Sstevel@tonic-gate * Standard functions from the C library. 6327c478bd9Sstevel@tonic-gate * These are all defined in <stdlib.h> and <wait.h> in SVr4. 6337c478bd9Sstevel@tonic-gate */ 6347c478bd9Sstevel@tonic-gate #ifdef preSVr4 6357c478bd9Sstevel@tonic-gate extern long atol(); 6367c478bd9Sstevel@tonic-gate extern char *getcwd(); 6377c478bd9Sstevel@tonic-gate extern char *calloc(); 6387c478bd9Sstevel@tonic-gate extern char *getenv(); 6397c478bd9Sstevel@tonic-gate extern void exit(); 6407c478bd9Sstevel@tonic-gate extern void free(); 6417c478bd9Sstevel@tonic-gate extern char *malloc(); 6427c478bd9Sstevel@tonic-gate extern time_t time(); 6437c478bd9Sstevel@tonic-gate extern long ulimit(); 6447c478bd9Sstevel@tonic-gate extern int utime(); 6457c478bd9Sstevel@tonic-gate extern int wait(); 6467c478bd9Sstevel@tonic-gate extern int fputs(); 6477c478bd9Sstevel@tonic-gate #endif 6487c478bd9Sstevel@tonic-gate 6497c478bd9Sstevel@tonic-gate #ifdef __cplusplus 6507c478bd9Sstevel@tonic-gate } 6517c478bd9Sstevel@tonic-gate #endif 6527c478bd9Sstevel@tonic-gate 6537c478bd9Sstevel@tonic-gate #endif /* _MAILX_DEF_H */ 654