9 date 93.02.26.21.53.29; author jromine; state Exp;
14 date 92.12.14.17.10.43; author jromine; state Exp;
19 date 92.11.24.20.24.06; author jromine; state Exp;
24 date 92.11.17.20.42.05; author jromine; state Exp;
29 date 92.11.04.00.32.42; author jromine; state Exp;
34 date 92.11.02.18.52.04; author jromine; state Exp;
39 date 92.10.27.16.57.25; author jromine; state Exp;
44 date 92.05.12.21.47.13; author jromine; state Exp;
49 date 92.02.11.00.38.12; author jromine; state Exp;
54 date 92.02.04.00.00.59; author jromine; state Exp;
59 date 92.02.03.16.34.21; author jromine; state Exp;
64 date 92.01.31.21.37.07; author jromine; state Exp;
69 date 92.01.24.00.03.50; author jromine; state Exp;
74 date 90.04.05.15.06.09; author sources; state Exp;
79 date 90.03.27.19.14.05; author sources; state Exp;
84 date 90.02.23.14.28.50; author sources; state Exp;
89 date 90.02.23.14.27.01; author sources; state Exp;
94 date 90.02.05.14.19.54; author sources; state Exp;
99 date 90.02.01.13.20.04; author sources; state Exp;
104 date 89.11.17.15.56.55; author sources; state Exp;
109 date 89.06.26.15.41.03; author sources; state Exp;
123 @/* mh.h - main header file for all of MH */
124 /* @@(#)$Id: mh.h,v 2.18 1992/12/14 17:10:43 jromine Exp jromine $ */
127 /* Well-used constants */
129 #define NOTOK (-1) /* syscall()s return this on error */
130 #define OK 0 /* ditto on success */
131 #define DONE 1 /* trinary logic */
133 #define NULLCP ((char *) 0)
134 #define NULLVP ((char **) 0)
135 #define Nbby 8 /* number of bits/byte */
137 #define MAXARGS 1000 /* max arguments to exec */
139 #define NFOLDERS 300 /* max folder arguments on command line */
142 #define MAXFOLDER 1000 /* message increment */
144 #define MAXFOLDER 1500 /* message increment */
146 #define DMAXFOLDER 4 /* typical number of digits */
148 #if (!defined(BSD42) && !defined(BSD41A) && !defined(VMUNIX) && !defined(hpux)) || defined(_AIX)
150 #endif /* not BSD */ /* how sad... */
154 /* profile structure */
157 char *n_name; /* key */
158 char *n_field; /* value */
160 char n_context; /* context, not profile */
162 struct node *n_next; /* next entry */
166 /* switches structure */
168 #define AMBIGSW (-2) /* from smatch() on ambiguous switch */
169 #define UNKWNSW (-1) /* ditto on unknown switch */
176 extern struct swit anoyes[]; /* standard yes/no switches */
179 /* messages structure */
182 int hghmsg; /* Highest msg in directory */
183 int nummsg; /* Actual Number of msgs */
184 int lowmsg; /* Lowest msg number */
185 int curmsg; /* Number of current msg if any */
187 int lowsel; /* Lowest selected msg number */
188 int hghsel; /* Highest selected msg number */
189 int numsel; /* Number of msgs selected */
191 char *foldpath; /* Pathname of folder */
193 int msgflags; /* Folder status bits */
195 char pad1[sizeof (int) - sizeof (char)];
197 #define READONLY 0x01 /* No write access to folder */
198 #define SEQMOD 0x02 /* folder's sequences modifed */
199 #define MHPATH 0x04 /* mhpath-style folder handling */
200 #define OTHERS 0x08 /* folder has other files */
201 #define MODIFIED 0x10 /* msh in-core folder modified */
202 #define FBITS "\020\01READONLY\02SEQMOD\03MHPATH\04OTHERS\05MODIFIED"
204 /* Note well: msgstats[] is a int, so we have 16 or 32 bits to work
205 with. The first 5 are for standard MH message flags,
206 this leaves us 11 (or 27) for user-defined attributes. Of
207 these, 1 is reserved for future internal use, so this leaves
209 #define NATTRS ((sizeof(int)*Nbby)-6) /* see above */
210 char *msgattrs[NATTRS + 1];/* folder attributes */
211 int attrstats; /* public=0/private=1 */
213 int lowoff; /* low element in msgstats[] */
214 int hghoff; /* hgh element in msgstats[] */
217 int msgstats[1]; /* msg status */
219 int *msgbase; /* msg base */
220 int *msgstats; /* msg status */
222 #define EXISTS 0x0001 /* exists */
223 #define DELETED 0x0002 /* deleted */
224 #define SELECTED 0x0004 /* selected for use */
225 #define SELECT_EMPTY 0x0008 /* mhpath "new" */
226 #define UNSEEN 0x0010 /* inc/show "unseen" */
227 #define FFATTRSLOT 5 /* user-defined attributes */
228 /* first free slot is */
229 /* (1 << 5) or 0x20 */
230 #define MBITS "\020\01EXISTS\02DELETED\03SELECTED\04NEW\05UNSEEN"
233 #define MHSIZE(mp,lo,hi) \
234 ((unsigned) (sizeof *mp + ((hi) + 2) * sizeof *mp -> msgstats))
236 #define MHSIZE(mp,lo,hi) ((unsigned) sizeof *mp)
237 #define MHSIZEX(mp,lo,hi) \
238 ((unsigned) (((hi) - (lo) + 1) * sizeof *mp -> msgstats))
242 #define NULLMP ((struct msgs *) 0)
246 /* m_getfld() message parsing */
248 #define NAMESZ 128 /* Limit on component name size */
250 #define LENERR (-2) /* Name too long error from getfld */
251 #define FMTERR (-3) /* Message Format error */
252 #define FLD 0 /* Field returned */
253 #define FLDPLUS 1 /* Field " with more to come */
254 #define FLDEOF 2 /* Field " ending at eom */
255 #define BODY 3 /* Body " with more to come */
256 #define BODYEOF 4 /* Body " ending at eom */
257 #define FILEEOF 5 /* Reached end of input file */
260 /* Maildrop styles */
262 #define MS_DEFAULT 0 /* default (one msg per file) */
263 #define MS_UNKNOWN 1 /* type not known yet */
264 #define MS_UUCP 2 /* Unix-style "from" lines */
265 #define MS_MMDF 3 /* string mmdlm2 */
266 #define MS_MSH 4 /* whacko msh */
268 extern int msg_count; /* m_getfld() indicators */
269 extern int msg_style; /* .. */
270 extern char *msg_delim; /* .. */
273 #define NOUSE 0 /* draft being re-used */
275 #define TFOLDER 0 /* path() given a +folder */
276 #define TFILE 1 /* path() given a file */
277 #define TSUBCWF 2 /* path() given a @@folder */
281 #endif /* not LINK */
285 #endif /* not SBACKUP */
288 #define OUTPUTLINELEN 72 /* default line length for headers */
293 * These standard strings are defined in config.c. They are the
294 * only system-dependent parameters in MH, and thus by redefining
295 * their values and reloading the various modules, MH will run
299 extern char *components;
300 extern char *context;
301 extern char *current;
303 extern char *digestcomps;
304 extern char *distcomps;
306 extern char *faceproc;
307 extern char *fileproc;
308 extern char *foldprot;
309 extern char *forwcomps;
311 extern char *incproc;
312 extern char *installproc;
314 extern char *mailproc;
315 extern char *mh_defaults;
316 extern char *mh_profile;
318 extern char *mhlformat;
319 extern char *mhlforward;
320 extern char *mhlproc;
321 extern char *moreproc;
322 extern char *msgprot;
323 extern char *mshproc;
324 extern char *nsequence;
325 extern char *packproc;
326 extern char *postproc;
327 extern char *pfolder;
328 extern char *psequence;
329 extern char *rcvdistcomps;
330 extern char *replcomps;
331 extern char *rmfproc;
332 extern char *rmmproc;
333 extern char *sendproc;
334 extern char *showproc;
335 extern char *slocalproc;
337 extern char *usequence;
338 extern char *version;
339 extern char *vmhproc;
340 extern char *whatnowproc;
341 extern char *whomproc;
345 /* global variables -sigh- */
347 extern char ctxflags;
348 #define CTXMOD 0x01 /* context information modified */
349 #define DBITS "\020\01CTXMOD"
354 #endif /* OVERHEAD */
356 extern char *invo_name; /* pgm invocation name */
357 extern char *mypath; /* user's $HOME */
358 extern char *defpath; /* pathname of user's profile */
359 extern char *ctxpath; /* pathname of user's context */
361 extern struct node *m_defs;
365 /* from the MH subroutine library */
402 char *m_getfolder ();
404 struct msgs *m_gmsg ();
410 struct msgs *m_remsg ();
431 #define pidXwait(id,cp) pidstatus (pidwait (id, NOTOK), stdout, cp)
453 #include "../h/strings.h"
455 /* should be in <stdio.h> */
457 #if !defined(SYS5) && !defined(ncr) && !defined(_AIX) && !defined(OSF1) && !defined(__convex__) && !defined(__386BSD__) && !defined(BSD44)
458 typedef struct _iobuf *FP;
467 #if !defined(BSD42) && !defined(hpux) && !defined(ncr) && !defined(_AIX) && !defined(RENAME)
468 #define rename(f1,f2) (link (f1, f2) != NOTOK ? unlink (f1) : NOTOK)
469 #endif /* not BSD42 */
471 #define setsig(s,f) if (signal (s, SIG_IGN) != SIG_IGN) \
473 #define setsigx(i,s,f) if ((i = signal (s, SIG_IGN)) != SIG_IGN) \
476 #if defined(sun) && !defined(NFS)
481 #define ruserpass _ruserpass
484 #if (defined(BSD44) || defined(SUN40) || defined(hpux) \
485 || defined(_AIX) || defined (sgi)) && !defined(UNISTD)
498 /* @@(#)$Id: mh.h,v 2.17 1992/11/24 20:24:06 jromine Exp jromine $ */
501 #if !defined(SYS5) && !defined(ncr) && !defined(_AIX) && !defined(OSF1) && !defined(__convex__)
512 /* @@(#)$Id: mh.h,v 2.16 1992/11/17 20:42:05 jromine Exp jromine $ */
515 #if !defined(SYS5) && !defined(ncr) && !defined(_AIX) && !defined(OSF1)
526 /* @@(#)$Id: mh.h,v 2.15 1992/11/04 00:32:42 jromine Exp jromine $ */
529 #if !defined(SYS5) && !defined(ncr) && !defined(_AIX)
540 /* @@(#)$Id: mh.h,v 2.14 1992/11/02 18:52:04 jromine Exp jromine $ */
546 #else /* use old V7 default */
549 #endif /* not TYPESIG */
556 use _AIX instead of AIX
561 /* @@(#)$Id: mh.h,v 2.13 1992/10/27 16:57:25 jromine Exp jromine $ */
575 /* @@(#)$Id: mh.h,v 2.12 1992/05/12 21:47:13 jromine Exp jromine $ */
578 #define NBBY 8 /* number of bits/byte */
581 #define NATTRS ((sizeof(int)*NBBY)-6) /* see above */
584 || defined(AIX) || defined (sgi)) && !defined(UNISTD)
595 /* @@(#)$Id: mh.h,v 2.11 1992/02/11 00:38:12 jromine Exp jromine $ */
600 #if !defined(BSD42) && !defined(hpux) && !defined(ncr) && !defined(_AIX)
607 @allow 32-bit for user-defined sequences
612 /* @@(#)$Id: mh.h,v 2.10 1992/02/04 00:00:59 jromine Exp $ */
656 /* @@(#)$Id: mh.h,v 2.9 1992/02/03 16:34:21 jromine Exp jromine $ */
660 char msgflags; /* Folder status bits */
663 /* Note well: msgstats[] is a short, so we have 16 bits to work
666 this leaves us 11 for user-defined attributes. Of these,
667 1 is reserved for future internal use, so this leaves
669 #define NATTRS 10 /* could be 11, see above */
672 short attrstats; /* public=0/private=1 */
674 char pad2[sizeof (int) - sizeof (short)];
678 short msgstats[1]; /* msg status */
681 short *msgbase; /* msg base */
682 short *msgstats; /* msg status */
693 /* @@(#)$Id: mh.h,v 2.8 1992/01/31 21:37:07 jromine Exp jromine $ */
705 /* @@(#)$Id: mh.h,v 2.7 1992/01/24 00:03:50 jromine Exp jromine $ */
708 #define MSIZE(mp,lo,hi) \
711 #define MSIZE(mp,lo,hi) ((unsigned) sizeof *mp)
712 #define MSIZEX(mp,lo,hi) \
719 MAXFOLDER = 1500 at UCI
724 /* @@(#)$Id: mh.h,v 2.6 1990/04/05 15:06:09 sources Exp jromine $ */
727 #if !defined(BSD42) && !defined(BSD41A) && !defined(VMUNIX) && !defined(hpux)
730 #endif not BSD /* how sad... */
733 #if !defined(SYS5) && !defined(ncr)
736 #if !defined(BSD42) && !defined(hpux) && !defined(ncr)
758 #if !defined(BSD42) && !defined(hpux)
787 @TYPESIG defaulting on SYS5/SUN40 systems
792 #if defined (SYS5) || defined (SUN40)
817 @changes for SUN40 shared libraries and NNTP under bbc
822 #define NFOLDERS 100 /* max folder arguments on command line */
833 #ifndef BSD42 || BSD41A || VMUNIX || hpux