#define MS_MSH 4 /* whacko msh */
extern int msg_count; /* m_getfld() indicators */
-extern int msg_style; /* .. */
-extern char *msg_delim; /* .. */
#define NOUSE 0 /* draft being re-used */
Along the way, I thought of these possible interface changes that we
might want to consider before rototilling the internals:
-1) To remove globals that don't need to be:
- Change msg_style and msg_delim to be file static.
-
-2) To remove a global:
+1) To remove a global:
Change bufsz to be in-out instead of in, and therefore int * instead of
int, and use that instead of global msg_count. There are only 3 call
sites that use msg_count so it wouldn't take much effort to remove use of
it. Of course, all call sites would have to change to provide an int *
instead of an int. Some now pass constants.
-3) To remove the state argument from the signature:
+2) To remove the state argument from the signature:
Given the Current usage and Restriction above, the state variable could
be removed from the signature and just retained internally.
-4) To remove the Restriction above:
+3) To remove the Restriction above:
One approach would be for m_getfld() to retain multiple copies of that
state, one per iob that it sees. Another approach would be for the
caller to store it in an opaque struct, the address of which is passed
*/
extern int msg_count;
-/*
- * defined in sbr/m_msgdef.c = MS_DEFAULT
- */
-extern int msg_style;
+static int msg_style = MS_DEFAULT;
/*
* The "full" delimiter string for a packed maildrop consists
* is used in m_Eom because the first character of the string
* has been read and matched before m_Eom is called.
*/
-extern char *msg_delim; /* defined in sbr/m_msgdef.c = "" */
+static char *msg_delim = "";
static unsigned char *fdelim;
static unsigned char *delimend;
static int fdelimlen;
* in uip/scansbr.c)
*/
int msg_count = 0;
-
-int msg_style = MS_DEFAULT;
-
-/*
- * The "full" delimiter string for a packed maildrop consists
- * of a newline followed by the actual delimiter. E.g., the
- * full string for a Unix maildrop would be: "\n\nFrom ".
- * "Fdelim" points to the start of the full string and is used
- * in the BODY case of the main routine to search the buffer for
- * a possible eom. Msg_delim points to the first character of
- * the actual delim. string (i.e., fdelim+1). Edelim
- * points to the 2nd character of actual delimiter string. It
- * is used in m_Eom because the first character of the string
- * has been read and matched before m_Eom is called.
- */
-char *msg_delim = "";