]> diplodocus.org Git - nmh/blobdiff - h/mh.h
Remove unused NCWD and NPWD #defines.
[nmh] / h / mh.h
diff --git a/h/mh.h b/h/mh.h
index f5fd66be34d4931f47fa8880cc4ccf766cde8c64..67b71702c2f13b76379f251a131ffb23c3891375 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -1,4 +1,3 @@
-
 /*
  * mh.h -- main header file for all of nmh
  */
 #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
+#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 */
 
@@ -38,6 +43,42 @@ 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:
+ *    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
  */
@@ -79,7 +120,7 @@ struct swit {
 /*
  * Macros to use when declaring struct swit arrays.
  *
- * These macros are what known as X-Macros.  In your source code you
+ * These macros use a technique known as X-Macros.  In your source code you
  * use them like this:
  *
  * #define FOO_SWITCHES \
@@ -89,6 +130,10 @@ struct swit {
  *
  * The argument to each entry in FOO_SWITCHES are the switch name (sw),
  * the minchars field (see above) and the return value for this switch.
+ * Note that the last entry in the above definition must either omit the
+ * continuation backslash, or be followed by a blank line.  In the nmh
+ * code the style is to have every line include a backslash and follow
+ * the SWITCHES macro definition by a blank line.
  *
  * After you define FOO_SWITCHES, you instantiate it as follows:
  *
@@ -118,13 +163,11 @@ struct swit {
 
 extern struct swit anoyes[];   /* standard yes/no switches */
 
-#define ATTACHFORMATS 3                /* Number of send attach formats. */
-
 /*
  * 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  */
@@ -163,17 +206,16 @@ unsigned int bvector_at (bvector_t, size_t);
 const unsigned long *bvector_bits (bvector_t);
 size_t bvector_maxsize (bvector_t);
 
-struct svector;
 typedef struct svector *svector_t;
 
 svector_t svector_create (size_t);
 void svector_free (svector_t);
 char *svector_push_back (svector_t, char *);
 char *svector_at (svector_t, size_t);
+char **svector_find(svector_t, const char *);
 char **svector_strs (svector_t);
 size_t svector_size (svector_t);
 
-struct ivector;
 typedef struct ivector *ivector_t;
 
 ivector_t ivector_create (size_t);
@@ -342,7 +384,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 */
 
@@ -355,7 +396,11 @@ typedef struct m_getfld_state *m_getfld_state_t;
 #define LINK   "@"             /* Name of link to file to which you are */
                                /* replying. */
 
-#define NMH_ATTACH_HEADER "Nmh-Attachment"  /* Default header for -attach */
+/*
+ * credentials management
+ */
+struct nmh_creds;
+typedef struct nmh_creds *nmh_creds_t;
 
 /*
  * miscellaneous macros
@@ -405,6 +450,8 @@ extern char *catproc;
 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;
@@ -426,7 +473,6 @@ extern char *mhlproc;
 extern char *mhlreply;
 extern char *moreproc;
 extern char *msgprot;
-extern char *mshproc;
 extern char *nmhaccessftp;
 extern char *nmhaccessurl;
 extern char *nmhstorage;
@@ -446,9 +492,9 @@ 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 *vmhproc;
 extern char *whatnowproc;
 extern char *whomproc;