changeset 26402:07c851d96878

push-notification: Add accessor functions to global variables These are enough for the current plugin. Maybe others will be needed in the future.
author Timo Sirainen <timo.sirainen@open-xchange.com>
date Wed, 04 Sep 2019 13:51:26 +0300
parents f493fc8d3433
children 140ef8f2ffa1
files src/plugins/push-notification/push-notification-event-messagenew.c src/plugins/push-notification/push-notification-events.c src/plugins/push-notification/push-notification-events.h src/plugins/push-notification/push-notification-plugin.c src/plugins/push-notification/push-notification-plugin.h
diffstat 5 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/push-notification/push-notification-event-messagenew.c	Sat Mar 16 16:24:59 2019 +0100
+++ b/src/plugins/push-notification/push-notification-event-messagenew.c	Wed Sep 04 13:51:26 2019 +0300
@@ -145,8 +145,6 @@
 
 /* Event definition */
 
-extern struct push_notification_event push_notification_event_messagenew;
-
 struct push_notification_event push_notification_event_messagenew = {
     .name = EVENT_NAME,
     .init = {
--- a/src/plugins/push-notification/push-notification-events.c	Sat Mar 16 16:24:59 2019 +0100
+++ b/src/plugins/push-notification/push-notification-events.c	Wed Sep 04 13:51:26 2019 +0300
@@ -9,6 +9,10 @@
 
 ARRAY_TYPE(push_notification_event) push_notification_events;
 
+ARRAY_TYPE(push_notification_event) *push_notification_get_events(void)
+{
+	return &push_notification_events;
+}
 
 static bool
 push_notification_event_find(const char *name, unsigned int *idx_r)
--- a/src/plugins/push-notification/push-notification-events.h	Sat Mar 16 16:24:59 2019 +0100
+++ b/src/plugins/push-notification/push-notification-events.h	Wed Sep 04 13:51:26 2019 +0300
@@ -110,6 +110,8 @@
                   const struct push_notification_event *);
 extern ARRAY_TYPE(push_notification_event) push_notification_events;
 
+ARRAY_TYPE(push_notification_event) *push_notification_get_events(void);
+
 
 void
 push_notification_event_init(struct push_notification_driver_txn *dtxn,
--- a/src/plugins/push-notification/push-notification-plugin.c	Sat Mar 16 16:24:59 2019 +0100
+++ b/src/plugins/push-notification/push-notification-plugin.c	Wed Sep 04 13:51:26 2019 +0300
@@ -32,6 +32,17 @@
 	.name = "push_notification",
 };
 
+struct event_category *push_notification_get_event_category(void)
+{
+	return &event_category_push_notification;
+}
+
+struct push_notification_event *
+push_notification_get_event_messagenew(void)
+{
+	return &push_notification_event_messagenew;
+}
+
 static void
 push_notification_transaction_init(struct push_notification_txn *ptxn)
 {
--- a/src/plugins/push-notification/push-notification-plugin.h	Sat Mar 16 16:24:59 2019 +0100
+++ b/src/plugins/push-notification/push-notification-plugin.h	Wed Sep 04 13:51:26 2019 +0300
@@ -5,9 +5,13 @@
 
 extern const char *push_notification_plugin_dependencies[];
 extern struct event_category event_category_push_notification;
+extern struct push_notification_event push_notification_event_messagenew;
 
 struct module;
 
+struct event_category *push_notification_get_event_category(void);
+struct push_notification_event *push_notification_get_event_messagenew(void);
+
 void push_notification_plugin_init(struct module *module);
 void push_notification_plugin_deinit(void);