forked from APE-Project/APE_Server
/
plugins.h
executable file
·92 lines (74 loc) · 2.34 KB
/
plugins.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
Copyright (C) 2006, 2007, 2008, 2009 Anthony Catel <a.catel@weelya.com>
This file is part of APE Server.
APE is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
APE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with APE ; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ace.h */
#ifndef _MODULES_APE_H
#define _MODULES_APE_H
#if __cplusplus
extern "C" {
#endif
#include "../src/main.h"
#include "../src/channel.h"
#include "../src/cmd.h"
#include "../src/extend.h"
#include "../src/users.h"
#include "../src/utils.h"
#include "../src/plugins.h"
#include "../src/ticks.h"
#include "../src/pipe.h"
#include "../src/raw.h"
#include "../src/base64.h"
#include "../src/sha1.h"
#include <stdarg.h>
#define READ_CONF(key) plugin_get_conf(infos_module.conf, key)
typedef struct _ace_callbacks ace_callbacks;
struct _ace_callbacks
{
USERS *(*c_adduser)(USERS *, acetables *);
void (*c_deluser)(USERS *, int istmp, acetables *);
CHANNEL *(*c_mkchan)(char *, acetables *);
void (*c_rmchan)(CHANNEL *, acetables *);
void (*c_join)(USERS *, CHANNEL *, acetables *);
void (*c_left)(USERS *, CHANNEL *, acetables *);
void (*c_tickuser)(subuser *, acetables *);
void (*c_post_raw_sub)(RAW *, subuser *, acetables *);
USERS *(*c_allocateuser)(ape_socket *, char *, char *, acetables *);
// TODO : delchan
};
typedef struct _plug_config plug_config;
struct _plug_config
{
char *key;
char *value;
struct _plug_config *next;
};
#if __cplusplus
#define APE_PLUGIN_ENTRY_POINT extern "C"
#else
#define APE_PLUGIN_ENTRY_POINT
#endif
#define APE_INIT_PLUGIN(modname, initfunc, modcallbacks) \
APE_PLUGIN_ENTRY_POINT void ape_module_init(ace_plugins *module) \
{ \
infos_module.conf = NULL; \
module->cb = &modcallbacks; \
module->infos = &infos_module; \
module->loader = initfunc; \
module->modulename = modname; \
}
#if __cplusplus
}
#endif
#endif