From 2ccb312b8b56db9585a4801184c064bfd3e3ff90 Mon Sep 17 00:00:00 2001 From: Will Storey Date: Sat, 11 Aug 2018 10:49:26 -0700 Subject: [PATCH] Expose functions for testing --- src/irc/core/Makefile.am | 1 + src/irc/core/channel-events.c | 7 ++++--- src/irc/core/channel-events.h | 12 ++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/irc/core/channel-events.h diff --git a/src/irc/core/Makefile.am b/src/irc/core/Makefile.am index 20caaeb1..c668faea 100644 --- a/src/irc/core/Makefile.am +++ b/src/irc/core/Makefile.am @@ -40,6 +40,7 @@ pkginc_irc_coredir=$(pkgincludedir)/src/irc/core pkginc_irc_core_HEADERS = \ bans.h \ ctcp.h \ + channel-events.h \ channel-rejoin.h \ irc.h \ irc-channels.h \ diff --git a/src/irc/core/channel-events.c b/src/irc/core/channel-events.c index e533a6f0..0cdb47fd 100644 --- a/src/irc/core/channel-events.c +++ b/src/irc/core/channel-events.c @@ -21,6 +21,7 @@ #include "module.h" #include "signals.h" #include "misc.h" +#include "channel-events.h" #include "channels-setup.h" #include "settings.h" #include "recode.h" @@ -176,7 +177,7 @@ static void set_topic_info(CHANNEL_REC *const chanrec, char const *const setby, } } -static void event_topic_get(IRC_SERVER_REC *server, const char *data) +void event_topic_get(IRC_SERVER_REC *server, const char *data) { char *params, *channel, *topic; @@ -187,7 +188,7 @@ static void event_topic_get(IRC_SERVER_REC *server, const char *data) g_free(params); } -static void event_topic(IRC_SERVER_REC *server, const char *data, +void event_topic(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr) { char *params, *channel, *topic, *mask; @@ -202,7 +203,7 @@ static void event_topic(IRC_SERVER_REC *server, const char *data, g_free(params); } -static void event_topic_info(IRC_SERVER_REC *server, const char *data) +void event_topic_info(IRC_SERVER_REC *server, const char *data) { char *params, *channel, *topicby, *topictime; time_t t; diff --git a/src/irc/core/channel-events.h b/src/irc/core/channel-events.h new file mode 100644 index 00000000..f0dea8b4 --- /dev/null +++ b/src/irc/core/channel-events.h @@ -0,0 +1,12 @@ +#ifndef __CHANNEL_EVENTS_H +#define __CHANNEL_EVENTS_H + +#include "irc.h" + +/* Not private for tests. */ +void event_topic_get(IRC_SERVER_REC *, const char *); +void event_topic(IRC_SERVER_REC *, const char *, + const char *, const char *); +void event_topic_info(IRC_SERVER_REC *, const char *); + +#endif