X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/012d05c2b62332eb400d66b806e48216d39358c6..c687e5bdd1da1a27b72cc9a4e94a1a2641fcf0d5:/h/mh.h diff --git a/h/mh.h b/h/mh.h index 8dcad654..1edf4822 100644 --- a/h/mh.h +++ b/h/mh.h @@ -1,5 +1,4 @@ -/* - * mh.h -- main header file for all of nmh +/* mh.h -- main header file for all of nmh */ #include @@ -11,7 +10,6 @@ #define OK 0 /* ditto on success */ #define DONE 1 /* trinary logic */ #define ALL "" -#define Nbby 8 /* number of bits/byte */ #define MAXARGS 1000 /* max arguments to exec */ #define NFOLDERS 1000 /* max folder arguments on command line */ @@ -25,10 +23,10 @@ #define NMH_BUFSIZ (BUFSIZ>=8192 ? BUFSIZ : 8192) #ifndef FALSE -#define FALSE 0 +#define FALSE false #endif #ifndef TRUE -#define TRUE 1 +#define TRUE true #endif typedef unsigned char boolean; /* not int so we can pack in a structure */ @@ -43,6 +41,13 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ #define NMH_UNUSED(i) i #endif +/* DIM gives the number of elements in the one-dimensional array a. */ +#define DIM(a) (sizeof (a) / sizeof (*(a))) + +/* LEN gives the strlen() of string constant s, excluding the + * terminating NUL. */ +#define LEN(s) (sizeof (s) - 1) + /* * char array that keeps track of size in both bytes and characters * Usage note: @@ -160,29 +165,27 @@ extern struct swit anoyes[]; /* standard yes/no switches */ * general folder attributes */ #define READONLY (1<<0) /* No write access to folder */ -#define SEQMOD (1<<1) /* folder's sequences modifed */ +#define SEQMOD (1<<1) /* folder's sequences modified */ #define ALLOW_NEW (1<<2) /* allow the "new" sequence */ #define OTHERS (1<<3) /* folder has other files */ -#define MODIFIED (1<<4) /* msh in-core folder modified */ -#define FBITS "\020\01READONLY\02SEQMOD\03ALLOW_NEW\04OTHERS\05MODIFIED" +#define FBITS "\020\01READONLY\02SEQMOD\03ALLOW_NEW\04OTHERS" /* * first free slot for user defined sequences * and attributes */ -#define FFATTRSLOT 5 +#define FFATTRSLOT 4 /* * internal messages attributes (sequences) */ #define EXISTS (0) /* exists */ -#define DELETED (1) /* deleted */ -#define SELECTED (2) /* selected for use */ -#define SELECT_EMPTY (3) /* "new" message */ -#define SELECT_UNSEEN (4) /* inc/show "unseen" */ +#define SELECTED (1) /* selected for use */ +#define SELECT_EMPTY (2) /* "new" message */ +#define SELECT_UNSEEN (3) /* inc/show "unseen" */ -#define MBITS "\020\01EXISTS\02DELETED\03SELECTED\04NEW\05UNSEEN" +#define MBITS "\020\01EXISTS\02SELECTED\03NEW\04UNSEEN" /* * type for holding the sequence set of a message @@ -196,8 +199,7 @@ void bvector_clear (bvector_t, size_t); void bvector_clear_all (bvector_t); void bvector_set (bvector_t, size_t); unsigned int bvector_at (bvector_t, size_t); -const unsigned long *bvector_bits (bvector_t); -size_t bvector_maxsize (bvector_t); +unsigned long bvector_first_bits (bvector_t); typedef struct svector *svector_t; @@ -216,7 +218,6 @@ void ivector_free (ivector_t); int ivector_push_back (ivector_t, int); int ivector_at (ivector_t, size_t); int *ivector_atp (ivector_t, size_t); -size_t ivector_size (ivector_t); /* * Primary structure of folder/message information @@ -314,9 +315,6 @@ struct msgs { #define set_unseen(mp,msgnum) \ bvector_set (msgstat(mp, msgnum), SELECT_UNSEEN) -/* for msh only */ -#define set_deleted(mp,msgnum) bvector_set (msgstat(mp, msgnum), DELETED) - #define in_sequence(mp,seqnum,msgnum) \ bvector_at (msgstat(mp, msgnum), FFATTRSLOT + seqnum) #define clear_sequence(mp,seqnum,msgnum) \ @@ -367,7 +365,6 @@ struct msgs { #define BODY 3 /* Body returned with more to come */ #define FILEEOF 5 /* Reached end of input file */ -struct m_getfld_state; typedef struct m_getfld_state *m_getfld_state_t; /* @@ -392,12 +389,6 @@ typedef struct m_getfld_state *m_getfld_state_t; /* * credentials management */ -struct nmh_creds { - char *host; - char *user; - char *password; -}; - typedef struct nmh_creds *nmh_creds_t; /* @@ -449,6 +440,7 @@ extern char *components; extern char *context; extern char *current; extern char *credentials_file; +extern int credentials_no_perm_check; extern char *defaultfolder; extern char *digestcomps; extern char *distcomps; @@ -498,4 +490,3 @@ extern char *whomproc; extern void (*done) (int) NORETURN; #include -