]> diplodocus.org Git - nmh/commitdiff
repl.c, replsbr.c: Move shared data into header file.
authorRalph Corderoy <ralph@inputplus.co.uk>
Thu, 2 Nov 2017 00:34:18 +0000 (00:34 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 2 Nov 2017 00:34:18 +0000 (00:34 +0000)
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.

Makefile.am
h/prototypes.h
uip/repl.c
uip/replsbr.c
uip/replsbr.h [new file with mode: 0644]

index 3b0f4e789df5845f4753b3b790798a6c009d0d5e..cfc5c94f11805aae71ccff0e8cbd4aa048d18ede 100644 (file)
@@ -380,6 +380,7 @@ noinst_HEADERS = \
     uip/mhmisc.h \
     uip/mhoutsbr.h \
     uip/mhshowsbr.h \
+    uip/replsbr.h \
     #
 
 ##
index ec11915adcbb214e5a50b9b5c77fb3d7ec4ec50f..4b6cb98d8f7938393a14eeea70c2c6bbba0561ed 100644 (file)
@@ -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 *);
index 6101641bf3208fa5310909bbf7ddd26260de7378..ef76eb01ba2e8c026702d89a93c62210dbb6d31b 100644 (file)
@@ -10,6 +10,7 @@
 #include "h/done.h"
 #include <h/utils.h>
 #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?        */
 
index 2fadb1d10548a5a31b42a7bacd3dd34486db61d9..4a45392567db63167960ed2120a296d0ab130c1a 100644 (file)
 #include "h/done.h"
 #include <h/utils.h>
 #include <sys/file.h>          /* 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 (file)
index 0000000..942688b
--- /dev/null
@@ -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;