]> jfr.im git - solanum.git/blobdiff - include/hook.h
wsproc: call rb_clear_cloexec on child fds
[solanum.git] / include / hook.h
index 7cc3bd54340a1ad5afeda6e99945ee7114cca3e7..c9dcf93e207eb2eb9c16a74f439462cf786089e1 100644 (file)
@@ -11,6 +11,16 @@ typedef struct
        rb_dlink_list hooks;
 } hook;
 
+enum hook_priority
+{
+       HOOK_LOWEST = 10,
+       HOOK_LOW = 20,
+       HOOK_NORMAL = 30,
+       HOOK_HIGH = 40,
+       HOOK_HIGHEST = 50,
+       HOOK_MONITOR = 100
+};
+
 typedef void (*hookfn) (void *data);
 
 extern int h_iosend_id;
@@ -35,10 +45,12 @@ extern int h_conf_read_start;
 extern int h_conf_read_end;
 extern int h_outbound_msgbuf;
 extern int h_rehash;
+extern int h_cap_change;
 
 void init_hook(void);
 int register_hook(const char *name);
 void add_hook(const char *name, hookfn fn);
+void add_hook_prio(const char *name, hookfn fn, enum hook_priority priority);
 void remove_hook(const char *name, hookfn fn);
 void call_hook(int id, void *arg);
 
@@ -68,8 +80,6 @@ typedef struct
 {
        struct Client *client;
        struct Client *target;
-       struct Channel *chptr;
-       int approved;
 } hook_data_client;
 
 typedef struct
@@ -98,6 +108,16 @@ typedef struct
        const char *error;
 } hook_data_channel_approval;
 
+typedef struct
+{
+       struct Client *client;
+       struct Client *target;
+       struct Channel *chptr;
+       struct membership *clientms;
+       struct membership *targetms;
+       int approved;
+} hook_data_channel_visibility;
+
 typedef struct
 {
        struct Client *client;
@@ -127,6 +147,14 @@ typedef struct
        unsigned int oldsnomask;
 } hook_data_umode_changed;
 
+typedef struct
+{
+       struct Client *client;
+       int oldcaps;
+       int add;
+       int del;
+} hook_data_cap_change;
+
 enum message_type {
        MESSAGE_TYPE_NOTICE,
        MESSAGE_TYPE_PRIVMSG,