/***********************************************************************1* *2* This software is part of the BSD package *3*Copyright (c) 1978-2005 The Regents of the University of California an*4* *5* Redistribution and use in source and binary forms, with or *6* without modification, are permitted provided that the following *7* conditions are met: *8* *9* 1. Redistributions of source code must retain the above *10* copyright notice, this list of conditions and the *11* following disclaimer. *12* *13* 2. Redistributions in binary form must reproduce the above *14* copyright notice, this list of conditions and the *15* following disclaimer in the documentation and/or other *16* materials provided with the distribution. *17* *18* 3. Neither the name of The Regents of the University of California*19* names of its contributors may be used to endorse or *20* promote products derived from this software without *21* specific prior written permission. *22* *23* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *24* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *25* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *26* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *27* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS *28* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *29* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED *30* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *31* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON *32* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *33* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *34* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *35* POSSIBILITY OF SUCH DAMAGE. *36* *37* Redistribution and use in source and binary forms, with or without *38* modification, are permitted provided that the following conditions *39* are met: *40* 1. Redistributions of source code must retain the above copyright *41* notice, this list of conditions and the following disclaimer. *42* 2. Redistributions in binary form must reproduce the above copyright *43* notice, this list of conditions and the following disclaimer in *44* the documentation and/or other materials provided with the *45* distribution. *46* 3. Neither the name of the University nor the names of its *47* contributors may be used to endorse or promote products derived *48* from this software without specific prior written permission. *49* *50* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" *51* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *52* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *53* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS *54* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *55* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *56* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF *57* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *58* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *59* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT *60* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF *61* SUCH DAMAGE. *62* *63* Kurt Shoens (UCB) *64* gsf *65* *66***********************************************************************/67/*68* Mail -- a mail program69*70* Local conventions and workarounds.71*/7273#if _PACKAGE_ast74#include "FEATURE/lcl"75#endif7677#if _hdr_paths78#include <paths.h>79#endif8081#ifndef _PATH_ED82#define _PATH_ED "/usr/bin/ed"83#endif84#ifndef _PATH_MASTER_RC85#define _PATH_MASTER_RC "/etc/mailx.rc"86#endif87#ifndef _PATH_MAILDIR88#define _PATH_MAILDIR "/usr/mail/"89#endif90#ifndef _PATH_MORE91#define _PATH_MORE "/usr/bin/more"92#endif93#ifndef _PATH_RESCONF94#define _PATH_RESCONF "/usr/etc/resolv.conf"95#endif96#ifndef _PATH_SENDMAIL97#define _PATH_SENDMAIL "/usr/lib/sendmail"98#endif99#ifndef _PATH_SHELL100#define _PATH_SHELL "/bin/sh"101#endif102#ifndef _PATH_TMP103#define _PATH_TMP "/tmp/"104#endif105#ifndef _PATH_VI106#define _PATH_VI "/usr/bin/vi"107#endif108109#ifndef EFTYPE110#define EFTYPE EINVAL111#endif112113#ifndef FILENAME_MAX114#define FILENAME_MAX PATH_MAX115#endif116117#ifndef L_tmpnam118#define L_tmpnam 25119#endif120121#ifndef MAXPATHLEN122#define MAXPATHLEN PATH_MAX123#endif124125#ifndef NOFILE126#define NOFILE OPEN_MAX127#endif128129#define blankline allblanks130131#if !_PACKAGE_ast132133#define SIG_REG_PENDING (-1)134#define SIG_REG_POP 0135#define SIG_REG_EXEC 00001136#define SIG_REG_PROC 00002137#define SIG_REG_TERM 00004138#define SIG_REG_ALL 00777139#define SIG_REG_SET 01000140141#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)142#define NiL 0143#else144#define NiL ((char*)0)145#endif146147#define elementsof(x) (sizeof(x)/sizeof(x[0]))148#define newof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)calloc(1,sizeof(t)*(n)+(x)))149#ifndef offsetof150#define offsetof(type,member) ((size_t)&(((type*)0)->member))151#endif152#define stracmp strcmp153#define streq(a,b) (*(a)==*(b)&&!strcmp(a,b))154#define strneq(a,b,n) (*(a)==*(b)&&!strncmp(a,b,n))155156typedef void (*Sig_handler_t)(int);157158extern int chresc(const char*, char**);159extern char* fmtesc(const char*);160extern char* fmtident(const char*);161extern char* pathshell(void);162extern int sigcritical(int);163extern int sigunblock(int);164extern int spawnvp(const char*, char* const*);165extern char* strcopy(char*, const char*);166extern int stresc(char*);167extern void* strpsearch(const void*, size_t, size_t, const char*, char**);168extern void* strsearch(const void*, size_t, size_t, int(*)(const char*, const char*), const char*, void*);169extern int touch(const char*, time_t, time_t, int);170171#endif172173174