]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Move subreason_strs and subtype_strs to subscriberfuncs.c.
authorBen Schmidt <none@none>
Tue, 24 Jan 2012 04:43:53 +0000 (15:43 +1100)
committerBen Schmidt <none@none>
Tue, 24 Jan 2012 04:43:53 +0000 (15:43 +1100)
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.

include/mlmmj.h
src/Makefile.am
src/mlmmj-sub.c
src/subscriberfuncs.c

index 6f76b5714316786b8055d7db4a4314767200183b..c98ccc3f7b13bc95bd74653568100d57d2218e90 100644 (file)
@@ -80,7 +80,7 @@ enum subtype {
        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 @@ enum subreason {
        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);
 
index 6fa931401cefca5ce21d2b384365a82830d406c7..a6e8a6abc9417db68c6260350b2efb8d716cb3e0 100644 (file)
@@ -58,7 +58,7 @@ mlmmj_maintd_SOURCES = mlmmj-maintd.c print-version.c log_error.c mygetline.c \
                       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
index ae194be9fc561383e0f41d6db76ca90d1e6f558f..70965f9ca35a7fa4996f7604c0b2b96773f290ff 100644 (file)
 #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)
index 33c77cda63c48d9afb3e5ab428101e6621055caf..8e9841d42baf4e0db4bcf215afee91afbf479228 100644 (file)
 #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;