From: Ralph Corderoy Date: Thu, 2 Nov 2017 00:34:18 +0000 (+0000) Subject: repl.c, replsbr.c: Move shared data into header file. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/4fb142af4ad2ca73d141cc04af24e7c1b62f8a77?hp=06efa573c7894caa4e5aa1ac7c64bd10ea25928b repl.c, replsbr.c: Move shared data into header file. repl.c declared global variables, and replsbr.c had extern statements that hopefully matched them. But they're really inputs into replsbr.c's code, so move the declarations into a new header file that both then include, and define them in replsbr.c. --- diff --git a/Makefile.am b/Makefile.am index 3b0f4e78..cfc5c94f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -380,6 +380,7 @@ noinst_HEADERS = \ uip/mhmisc.h \ uip/mhoutsbr.h \ uip/mhshowsbr.h \ + uip/replsbr.h \ # ## diff --git a/h/prototypes.h b/h/prototypes.h index ec11915a..4b6cb98d 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -316,8 +316,6 @@ void m_pclose(void); int mhl(int, char **); int mhlsbr(int, char **, FILE *(*)(char *)); int distout (char *, char *, char *); -void replout (FILE *, char *, char *, struct msgs *, int, - int, char *, char *, char *, int); int build_form (char *, char *, int *, char *, char *, char *, char *, char *, char *); int sendsbr (char **, int, char *, char *, struct stat *, int, const char *); diff --git a/uip/repl.c b/uip/repl.c index 6101641b..ef76eb01 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -10,6 +10,7 @@ #include "h/done.h" #include #include "sbr/m_maildir.h" +#include "replsbr.h" #define REPL_SWITCHES \ X("group", 0, GROUPSW) \ @@ -92,11 +93,6 @@ static struct swit aqrl[] = { { NULL, 0, 0 } }; -short ccto = -1; /* global for replsbr */ -short cccc = -1; -short ccme = -1; -short querysw = 0; - static short outputlinelen = OUTPUTLINELEN; static bool groupreply; /* Is this a group reply? */ diff --git a/uip/replsbr.c b/uip/replsbr.c index 2fadb1d1..4a453925 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -11,11 +11,12 @@ #include "h/done.h" #include #include /* L_SET */ +#include "replsbr.h" -extern short ccto; /* from repl.c */ -extern short cccc; -extern short ccme; -extern short querysw; +short ccto = -1; +short cccc = -1; +short ccme = -1; +short querysw = 0; static int dftype=0; diff --git a/uip/replsbr.h b/uip/replsbr.h new file mode 100644 index 00000000..942688b3 --- /dev/null +++ b/uip/replsbr.h @@ -0,0 +1,15 @@ +/* replsbr.h -- routines to help repl along... + * + * This code is Copyright (c) 2017, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. + */ + +void replout(FILE *inb, char *msg, char *drft, struct msgs *mp, + int outputlinelen, int mime, char *form, char *filter, char *fcc, + int fmtproc); + +extern short ccto; +extern short cccc; +extern short ccme; +extern short querysw;