comparison config/config.c @ 0:bce86c4163a3

Initial revision
author kono
date Mon, 18 Apr 2005 23:46:02 +0900
parents
children f89a9a79e124
comparison
equal deleted inserted replaced
-1:000000000000 0:bce86c4163a3
1 /* config.c - master MH configuration file */
2 #ifndef lint
3 static char ident[] = "@(#)$Id$";
4 #endif /* lint */
5
6 /* This file is automatically generated. Do not edit! */
7
8 /* LINTLIBRARY */
9
10 #include "../h/mh.h"
11 #ifdef MHRC
12 #include <pwd.h>
13 #endif /* MHRC */
14 #include <stdio.h>
15
16
17 #if defined(__STDC__)
18 #define binpath(file) "/usr/local/mh/bin/"#file
19 #define etcpath(file) "/usr/local/mh/lib/"#file
20 #else
21 #define binpath(file) "/usr/local/mh/bin/file"
22 #define etcpath(file) "/usr/local/mh/lib/file"
23 #endif
24
25 static char Config[] = "@(#)Config: MH";
26
27 char *options[] = {"APOP", "ATHENA", "BIND", "BSD42", "BSD43", "BSD44", "DBMPWD", "DUMB", "FOLDPROT='\"0700\"'", "GCOS_HACK", "ISI", "JAPAN", "MAILGROUP", "MHE", "MHRC", "MH_PLUS", "MIME", "MIME_HEADERS", "MORE='\"/usr/local/bin/jless\"'", "MSGPROT='\"0600\"'", "NNTP", "NORUSERPASS", "OVERHEAD", "POP", "POPSERVICE='\"pop\"'", "POSIX", "RPATHS", "SBACKUP='\"\043\"'", "SENDMTS", "SETMG", "SMTP", "SPRINTFTYPE=int", "SYS5DIR", "TYPESIG=void", "UNISTD", "VSPRINTF", "WAITINT", "WHATNOW", "ZONEINFO", NULL};
28
29
30 #ifndef __STDC__
31 #ifdef MHRC
32 #ifdef SYS5
33 struct passwd *getpwnam ();
34 #endif /* SYS5 */
35 #endif /* MHRC */
36 #endif
37
38 /* */
39
40 static char lpath[BUFSIZ];
41
42 char *libpath (file)
43 char *file;
44 {
45 char *cp;
46 #ifdef MHRC
47 char *pp;
48 struct passwd *pw;
49 #endif /* MHRC */
50
51 #ifdef MHRC
52 m_getdefs ();
53 #endif /* MHRC */
54
55 switch (*file) {
56 case '/':
57 return file;
58
59 #ifdef MHRC
60 case '~':
61 if (cp = index (pp = file + 1, '/'))
62 *cp++ = '\0';
63 if (*pp == '\0')
64 pp = mypath;
65 else
66 if (pw = getpwnam (pp))
67 pp = pw -> pw_dir;
68 else {
69 if (cp)
70 *--cp = '/';
71 goto try_it;
72 }
73
74 (void) sprintf (lpath, "%s/%s", pp, cp ? cp : "");
75 if (cp)
76 *--cp = '/';
77
78 if (access (lpath, 04) != NOTOK)
79 return lpath; /* else fall */
80 try_it: ;
81 #endif /* MHRC */
82
83 default:
84 if (access ((cp = m_mailpath (file)), 04) != NOTOK)
85 return cp;
86 }
87
88 (void) sprintf (lpath, etcpath (%s), file);
89 return (access (lpath, 04) != NOTOK ? lpath : file);
90 }
91
92 /* */
93
94 /*
95 * Standard yes/no switches structure
96 */
97
98 struct swit anoyes[] = {
99 "no", 0,
100 "yes", 0,
101 NULL, 0
102 };
103
104 /* */
105
106 /*
107 * MH constants
108 */
109
110 char *components = "components";
111 char *current = "cur";
112 char *defalt = "inbox";
113 char *digestcomps = "digestcomps";
114 char *distcomps = "distcomps";
115 char *draft = "draft";
116 char *forwcomps = "forwcomps";
117 char *inbox = "inbox";
118 char *mh_defaults = etcpath (mh.profile);
119 char *mh_profile = ".mh_profile";
120 char *mhlformat = "mhl.format";
121 char *mhlforward = "mhl.forward";
122 char *nsequence = "Sequence-Negation";
123 char *pfolder = "Current-Folder";
124 char *psequence = "Previous-Sequence";
125 char *rcvdistcomps = "rcvdistcomps";
126 char *replcomps = "replcomps";
127 char *usequence = "Unseen-Sequence";
128 char *mhlibdir = "/usr/local/mh/lib"; /* NB: this will change */
129
130
131 /*
132 * MH not-so constants
133 */
134
135 char *context = "context";
136 #ifndef NOMHSEQ
137 char *mh_seq = ".mh_sequences";
138 #else /* NOMHSEQ */
139 char *mh_seq = NULL;
140 #endif /* NOMHSEQ */
141
142
143 /*
144 * MH globals
145 */
146
147 char ctxflags; /* status of user's context */
148
149 char *invo_name; /* pgm invocation name */
150 char *mypath; /* user's $HOME */
151 char *defpath; /* pathname of user's profile */
152 char *ctxpath; /* pathname of user's context */
153
154 struct node *m_defs; /* profile/context structure */
155
156 /* */
157
158 /*
159 * MH processes
160 */
161
162
163 /*
164 * mhl runs this program as a visual-end.
165 */
166
167 char *faceproc = NULL;
168
169
170 /*
171 * This program is usually called directly by users, but it is
172 * also invoked by the post program to process an "fcc".
173 */
174
175 char *fileproc = binpath (refile);
176
177
178 /*
179 * This program is called to incorporate messages into a folder.
180 */
181
182 char *incproc = binpath (inc);
183
184
185 /*
186 * When a user runs an MH program for the first time, this program
187 * is called to create his MH profile, and mail directory.
188 */
189
190 char *installproc = etcpath (install-mh);
191
192
193 /*
194 * This is the program invoked by a "list" response to "What now?"
195 * whereas, showproc is the program invoked by show, next, prev.
196 */
197
198 #ifndef MORE
199 char *lproc = "/usr/ucb/more";
200 #else /* MORE */
201 char *lproc = MORE;
202 #endif /* MORE */
203
204
205 /*
206 * This is the path for the Bell equivalent mail program.
207 */
208
209 char *mailproc = binpath (mhmail);
210
211
212 /*
213 * mhl runs this program as a front-end.
214 */
215
216 #ifndef MORE
217 char *moreproc = "/usr/ucb/more";
218 #else /* MORE */
219 char *moreproc = MORE;
220 #endif /* MORE */
221
222
223 /*
224 * This program is mhl - the nifty message lister
225 */
226
227 char *mhlproc = etcpath (mhl);
228
229
230 /*
231 * This is the super handy BBoard reading program, which is really just the MH
232 * shell program
233 */
234
235 char *mshproc = binpath (msh);
236
237
238 /*
239 * This program is called to pack a folder.
240 */
241
242 char *packproc = binpath (packf);
243
244
245 /*
246 * This is the delivery program called through send to
247 * actually deliver mail to users. This is the interface to
248 * the MTS.
249 */
250
251 #if BERK && SENDMTS && !SMTP
252 char *postproc = etcpath (spost);
253 #else
254 char *postproc = etcpath (post);
255 #endif /* BERK */
256
257
258 /*
259 * This program is called to remove a folder.
260 */
261
262 char *rmfproc = binpath (rmf);
263
264
265 /*
266 * This program is called to remove a message by rmm or refile -nolink.
267 * It's usually empty, which means to rename the file to a backup name.
268 */
269
270 char *rmmproc = NULL;
271
272
273 /*
274 * This program is usually called by the user's whatnowproc, but it
275 * may also be called directly to send a message previously composed.
276 */
277
278 char *sendproc = binpath (send);
279
280
281 /*
282 * This program is called to list messages by the show program.
283 * By setting showproc to mhl, the user can run mhl instead.
284 */
285
286 #ifndef MORE
287 char *showproc = "/usr/ucb/more";
288 #else /* MORE */
289 char *showproc = MORE;
290 #endif /* MORE */
291
292
293 /*
294 * This program is called under stand-alone MH to deliver a message to
295 * a local user. Under other MTS's it can be used to emulate a
296 * MMDF-II .maildelivery mechanism.
297 */
298
299 char *slocalproc = etcpath (slocal);
300
301
302 /*
303 * This program is called by vmh as the back-end to the window management
304 * protocol
305 */
306
307 char *vmhproc = binpath (msh);
308
309
310 /*
311 * This program is called after comp, et. al., have built a draft
312 */
313
314 char *whatnowproc = binpath (whatnow);
315
316
317 /*
318 * This program is called to list/validate the addresses in a message.
319 */
320
321 char *whomproc = binpath (whom);
322
323 /* */
324
325 /*
326 * This is the editor invoked by the various message composition
327 * programs. It SHOULD be a 2-D scope editor, such as Rand's ned
328 * or Berkeley's ex, but any editor will work. We use prompter as
329 * the default, since with -prepend it works just fine with forw.
330 */
331
332 char *sysed = "prompter";
333
334
335 /*
336 * This is the MH alias file.
337 */
338
339 char *AliasFile = etcpath (MailAliases);
340
341 /* */
342
343 /*
344 * File protections
345 */
346
347
348 /*
349 * Folders (directories) are created with this protection (mode)
350 */
351
352 #ifndef FOLDPROT
353 #define FOLDPROT "0711"
354 #endif /* not FOLDPROT */
355
356 char *foldprot = FOLDPROT;
357
358
359 /*
360 * Every NEW message will be created with this protection. When a
361 * message is filed it retains its protection, so this only applies
362 * to messages coming in through inc.
363 */
364
365 #ifndef MSGPROT
366 #define MSGPROT "0644"
367 #endif /* not MSGPROT */
368
369 char *msgprot = MSGPROT;