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