-/*
- * mh.h -- main header file for all of nmh
+/* mh.h -- main header file for all of nmh
*/
#include <h/nmh.h>
#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 */
#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:
#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
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;
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
#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) \
#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;
/*
/*
* credentials management
*/
-struct nmh_creds {
- char *host;
- char *user;
- char *password;
-};
-
typedef struct nmh_creds *nmh_creds_t;
/*
extern void (*done) (int) NORETURN;
#include <h/prototypes.h>
-