]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification: Add accessor functions to global variables
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 4 Sep 2019 10:51:26 +0000 (13:51 +0300)
committerMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Wed, 25 Sep 2019 08:25:20 +0000 (11:25 +0300)
These are enough for the current plugin. Maybe others will be needed in the
future.

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

index 3f1c4f3f6ce1d968c0d0357ba89227206729290c..40ab8ee76bfddf1abcfd9c14f19ca562291338dd 100644 (file)
@@ -145,8 +145,6 @@ push_notification_event_messagenew_event(struct push_notification_txn *ptxn,
 
 /* Event definition */
 
-extern struct push_notification_event push_notification_event_messagenew;
-
 struct push_notification_event push_notification_event_messagenew = {
     .name = EVENT_NAME,
     .init = {
index ea2e59babf6f8758d301c4dcc1e5ebee353f3ab4..10c6ed9a23cbe701122a0034bfc4df2be0cd3549 100644 (file)
@@ -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)
index 1552a80df278e5a9f5c448216aa85c9d6c9d45b3..7dfafb8e7d39b1334d8ebb82bc5f879f8681fc4f 100644 (file)
@@ -110,6 +110,8 @@ ARRAY_DEFINE_TYPE(push_notification_event,
                   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,
index b907b1dbc06af977fa571fed3cff2f3b7b6d3c3f..ca0771dff3f814b5622a94ecf9f44a93550c1d3b 100644 (file)
@@ -32,6 +32,17 @@ struct event_category event_category_push_notification = {
        .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)
 {
index 1d88ba71e499df799c585b358ef5e8ae16f86d92..7db53971bf3b965a447c682d75f04e4874812c01 100644 (file)
@@ -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);