Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/mailx/local.h
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the BSD package *
4
*Copyright (c) 1978-2005 The Regents of the University of California an*
5
* *
6
* Redistribution and use in source and binary forms, with or *
7
* without modification, are permitted provided that the following *
8
* conditions are met: *
9
* *
10
* 1. Redistributions of source code must retain the above *
11
* copyright notice, this list of conditions and the *
12
* following disclaimer. *
13
* *
14
* 2. Redistributions in binary form must reproduce the above *
15
* copyright notice, this list of conditions and the *
16
* following disclaimer in the documentation and/or other *
17
* materials provided with the distribution. *
18
* *
19
* 3. Neither the name of The Regents of the University of California*
20
* names of its contributors may be used to endorse or *
21
* promote products derived from this software without *
22
* specific prior written permission. *
23
* *
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
25
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
26
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
27
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
28
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS *
29
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
30
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED *
31
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
32
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON *
33
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
34
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *
35
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
36
* POSSIBILITY OF SUCH DAMAGE. *
37
* *
38
* Redistribution and use in source and binary forms, with or without *
39
* modification, are permitted provided that the following conditions *
40
* are met: *
41
* 1. Redistributions of source code must retain the above copyright *
42
* notice, this list of conditions and the following disclaimer. *
43
* 2. Redistributions in binary form must reproduce the above copyright *
44
* notice, this list of conditions and the following disclaimer in *
45
* the documentation and/or other materials provided with the *
46
* distribution. *
47
* 3. Neither the name of the University nor the names of its *
48
* contributors may be used to endorse or promote products derived *
49
* from this software without specific prior written permission. *
50
* *
51
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" *
52
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
53
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
54
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS *
55
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
56
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
57
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF *
58
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
59
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
60
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT *
61
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF *
62
* SUCH DAMAGE. *
63
* *
64
* Kurt Shoens (UCB) *
65
* gsf *
66
* *
67
***********************************************************************/
68
/*
69
* Mail -- a mail program
70
*
71
* Local conventions and workarounds.
72
*/
73
74
#if _PACKAGE_ast
75
#include "FEATURE/lcl"
76
#endif
77
78
#if _hdr_paths
79
#include <paths.h>
80
#endif
81
82
#ifndef _PATH_ED
83
#define _PATH_ED "/usr/bin/ed"
84
#endif
85
#ifndef _PATH_MASTER_RC
86
#define _PATH_MASTER_RC "/etc/mailx.rc"
87
#endif
88
#ifndef _PATH_MAILDIR
89
#define _PATH_MAILDIR "/usr/mail/"
90
#endif
91
#ifndef _PATH_MORE
92
#define _PATH_MORE "/usr/bin/more"
93
#endif
94
#ifndef _PATH_RESCONF
95
#define _PATH_RESCONF "/usr/etc/resolv.conf"
96
#endif
97
#ifndef _PATH_SENDMAIL
98
#define _PATH_SENDMAIL "/usr/lib/sendmail"
99
#endif
100
#ifndef _PATH_SHELL
101
#define _PATH_SHELL "/bin/sh"
102
#endif
103
#ifndef _PATH_TMP
104
#define _PATH_TMP "/tmp/"
105
#endif
106
#ifndef _PATH_VI
107
#define _PATH_VI "/usr/bin/vi"
108
#endif
109
110
#ifndef EFTYPE
111
#define EFTYPE EINVAL
112
#endif
113
114
#ifndef FILENAME_MAX
115
#define FILENAME_MAX PATH_MAX
116
#endif
117
118
#ifndef L_tmpnam
119
#define L_tmpnam 25
120
#endif
121
122
#ifndef MAXPATHLEN
123
#define MAXPATHLEN PATH_MAX
124
#endif
125
126
#ifndef NOFILE
127
#define NOFILE OPEN_MAX
128
#endif
129
130
#define blankline allblanks
131
132
#if !_PACKAGE_ast
133
134
#define SIG_REG_PENDING (-1)
135
#define SIG_REG_POP 0
136
#define SIG_REG_EXEC 00001
137
#define SIG_REG_PROC 00002
138
#define SIG_REG_TERM 00004
139
#define SIG_REG_ALL 00777
140
#define SIG_REG_SET 01000
141
142
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
143
#define NiL 0
144
#else
145
#define NiL ((char*)0)
146
#endif
147
148
#define elementsof(x) (sizeof(x)/sizeof(x[0]))
149
#define newof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)calloc(1,sizeof(t)*(n)+(x)))
150
#ifndef offsetof
151
#define offsetof(type,member) ((size_t)&(((type*)0)->member))
152
#endif
153
#define stracmp strcmp
154
#define streq(a,b) (*(a)==*(b)&&!strcmp(a,b))
155
#define strneq(a,b,n) (*(a)==*(b)&&!strncmp(a,b,n))
156
157
typedef void (*Sig_handler_t)(int);
158
159
extern int chresc(const char*, char**);
160
extern char* fmtesc(const char*);
161
extern char* fmtident(const char*);
162
extern char* pathshell(void);
163
extern int sigcritical(int);
164
extern int sigunblock(int);
165
extern int spawnvp(const char*, char* const*);
166
extern char* strcopy(char*, const char*);
167
extern int stresc(char*);
168
extern void* strpsearch(const void*, size_t, size_t, const char*, char**);
169
extern void* strsearch(const void*, size_t, size_t, int(*)(const char*, const char*), const char*, void*);
170
extern int touch(const char*, time_t, time_t, int);
171
172
#endif
173
174