X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e6917522a770cf2dba9997ca047977bc55fac061..303e8387acecca26329e939f228f78ca805b7a15:/h/mh.h diff --git a/h/mh.h b/h/mh.h index 5e75c0ba..d88df07f 100644 --- a/h/mh.h +++ b/h/mh.h @@ -1,4 +1,3 @@ - /* * mh.h -- main header file for all of nmh */ @@ -19,6 +18,12 @@ #define DMAXFOLDER 4 /* typical number of digits */ #define MAXFOLDER 1000 /* message increment */ +/* + * This macro is for use by scan, for example, so that platforms with + * a small BUFSIZ can easily allocate larger buffers. + */ +#define NMH_BUFSIZ (BUFSIZ>=8192 ? BUFSIZ : 8192) + #ifndef FALSE #define FALSE 0 #endif @@ -38,6 +43,35 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ #define NMH_UNUSED(i) i #endif +/* + * char array that keeps track of size in both bytes and characters + * Usage note: + * Don't store return value of charstring_buffer() and use later + * after intervening push_back's; use charstring_buffer_copy() + * instead. + */ +typedef struct charstring *charstring_t; + +charstring_t charstring_create (size_t); +charstring_t charstring_copy (const charstring_t); +void charstring_free (charstring_t); +/* Append a single-byte character: */ +void charstring_push_back (charstring_t, const char); +/* Append possibly multi-byte character(s): */ +void charstring_push_back_chars (charstring_t, const char [], size_t, size_t); +void charstring_append (charstring_t, const charstring_t); +void charstring_append_cstring (charstring_t, const char []); +void charstring_clear (charstring_t); +/* Don't store return value of charstring_buffer() and use later after + intervening push_back's; use charstring_buffer_copy() instead. */ +const char *charstring_buffer (const charstring_t); +/* User is responsible for free'ing result of buffer copy. */ +char *charstring_buffer_copy (const charstring_t); +size_t charstring_bytes (const charstring_t); +size_t charstring_chars (const charstring_t); +/* Length of the last character in the charstring. */ +int charstring_last_char_len (const charstring_t); + /* * user context/profile structure */ @@ -126,7 +160,7 @@ 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 */ @@ -343,7 +377,6 @@ typedef struct m_getfld_state *m_getfld_state_t; #define MS_UNKNOWN 1 /* type not known yet */ #define MS_MBOX 2 /* Unix-style "from" lines */ #define MS_MMDF 3 /* string mmdlm2 */ -#define MS_MSH 4 /* whacko msh */ #define NOUSE 0 /* draft being re-used */ @@ -416,6 +449,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; @@ -456,6 +490,7 @@ extern char *sendproc; extern char *showmimeproc; extern char *showproc; extern char *usequence; +extern char *user_agent; extern char *version_num; extern char *version_str; extern char *whatnowproc;