changeset 841:fabf3a96132f

Move subreason_strs and subtype_strs to subscriberfuncs.c. They are needed by multiple executables, so can't go in a file with main(). It is important to remember to link in subscriberfuncs.c whenever these variables are used. Maybe write wrapper functions in future to enforce this as errors can be hard to track down when this goes wrong.
author Ben Schmidt
date Tue, 24 Jan 2012 15:43:53 +1100
parents 0f8242ffa2d0
children c6fe438f3e60
files include/mlmmj.h src/Makefile.am src/mlmmj-sub.c src/subscriberfuncs.c
diffstat 4 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/include/mlmmj.h	Tue Jan 24 03:02:00 2012 +1100
+++ b/include/mlmmj.h	Tue Jan 24 15:43:53 2012 +1100
@@ -80,7 +80,7 @@
 	SUB_NONE /* For when an address is not subscribed at all */
 };
 
-char *subtype_strs[6]; /* count matches enum above; defined in mlmmj-sub.c */
+char *subtype_strs[6]; /* count matches enum above; defined in subscriberfuncs.c */
 
 enum subreason {
 	SUB_REQUEST,
@@ -91,7 +91,7 @@
 	SUB_SWITCH
 };
 
-char * subreason_strs[6]; /* count matches enum above; defined in mlmmj-sub.c */
+char * subreason_strs[6]; /* count matches enum above; defined in subscriberfuncs.c */
 
 void print_version(const char *prg);
 
--- a/src/Makefile.am	Tue Jan 24 03:02:00 2012 +1100
+++ b/src/Makefile.am	Tue Jan 24 15:43:53 2012 +1100
@@ -58,7 +58,7 @@
  		       prepstdreply.c statctrl.c gethdrline.c unistr.c
 
 mlmmj_list_SOURCES = mlmmj-list.c strgen.c writen.c print-version.c memory.c \
-		     log_error.c random-int.c readn.c
+		     log_error.c random-int.c readn.c subscriberfuncs.c
 
 install-exec-hook:
 	ln -f -s mlmmj-receive $(DESTDIR)$(bindir)/mlmmj-recieve
--- a/src/mlmmj-sub.c	Tue Jan 24 03:02:00 2012 +1100
+++ b/src/mlmmj-sub.c	Tue Jan 24 15:43:53 2012 +1100
@@ -50,24 +50,6 @@
 #include "ctrlvalues.h"
 #include "chomp.h"
 
-char *subtype_strs[] = {
-	"normal",
-	"digest",
-	"nomail",
-	"file",
-	"all",
-	"none"
-};
-
-char * subreason_strs[] = {
-	"request",
-	"confirm",
-	"permit",
-	"admin",
-	"bouncing",
-	"switch"
-};
-
 static void moderate_sub(const char *listdir, const char *listaddr,
 		const char *listdelim, const char *subaddr,
 		const char *mlmmjsend, enum subtype typesub, enum subreason reasonsub)
--- a/src/subscriberfuncs.c	Tue Jan 24 03:02:00 2012 +1100
+++ b/src/subscriberfuncs.c	Tue Jan 24 15:43:53 2012 +1100
@@ -40,6 +40,24 @@
 #include "strgen.h"
 #include "memory.h"
 
+char *subtype_strs[] = {
+	"normal",
+	"digest",
+	"nomail",
+	"file",
+	"all",
+	"none"
+};
+
+char * subreason_strs[] = {
+	"request",
+	"confirm",
+	"permit",
+	"admin",
+	"bouncing",
+	"switch"
+};
+
 off_t find_subscriber(int fd, const char *address)
 {
 	char *start, *cur, *next;