aboutsummaryrefslogtreecommitdiff
path: root/plugin_client_header.h
blob: d1be0b57f209da435896185e69b45ebbc737dccc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <stdint.h>


enum plugin_event_type{
	PLUGIN_EVENT_MESSAGE,  // message, user, room
	PLUGIN_EVENT_ONLINE,  // user, num
	PLUGIN_EVENT_JOIN,  // user, room
};

struct plugin_event{
	enum plugin_event_type type;
	int64_t timestamp;  // always set
	char *message,*user,*room;
	int64_t num;
};


typedef void plugin_event_func_t(const struct plugin_event *event);


// All plugins should export a function of the following signature with
// name "plugin_init_func" that returns a pointer to a function that
// receives all events.
plugin_event_func_t* plugin_init_func(void);