# HG changeset patch # User Ben Schmidt # Date 1327380233 -39600 # Node ID fabf3a96132ffc985e63fa47690f46aa7ae48637 # Parent 0f8242ffa2d02cdcd932067e28ee824b7b7abc7a 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. diff -r 0f8242ffa2d0 -r fabf3a96132f include/mlmmj.h --- 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); diff -r 0f8242ffa2d0 -r fabf3a96132f src/Makefile.am --- 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 diff -r 0f8242ffa2d0 -r fabf3a96132f src/mlmmj-sub.c --- 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) diff -r 0f8242ffa2d0 -r fabf3a96132f src/subscriberfuncs.c --- 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;