Haka: include/haka/module.h Source File

Haka

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

module.h
Go to the documentation of this file.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
10 #ifndef HAKA_MODULE_H
11 #define HAKA_MODULE_H
12
13 #include <wchar.h>
14 #include <haka/thread.h>
15 #include <haka/version.h>
16 #include <haka/parameters.h>
17
18
22 enum module_type {
23 MODULE_UNKNOWN,
24 MODULE_PACKET,
25 MODULE_LOG,
26 MODULE_ALERT,
27 MODULE_REGEXP,
28 MODULE_EXTENSION,
29 };
30
34 struct module {
35 void *handle;
36 atomic_t ref;
38 enum module_type type;
40 const char *name;
41 const char *description;
42 const char *author;
43 int api_version;
51 int (*init)(struct parameters *args);
52
57 void (*cleanup)();
58 };
59
66 struct module *module_load(const char *module_name, struct parameters *args);
67
73 void module_addref(struct module *module);
74
78 void module_release(struct module *module);
79
84 void module_set_path(const char *path, bool c);
85
89 bool module_set_default_path();
90
94 void module_add_path(const char *path, bool c);
95
99 const char *module_get_path(bool c);
100
101 #endif /* HAKA_MODULE_H */
module::api_version
int api_version
Definition: module.h:43
module::cleanup
void(* cleanup)()
Definition: module.h:57
module_get_path
const char * module_get_path(bool c)
Definition: module.c:260
module
Definition: module.h:34
module::init
int(* init)(struct parameters *args)
Definition: module.h:51
MODULE_REGEXP
Definition: module.h:27
module::type
enum module_type type
Definition: module.h:38
MODULE_PACKET
Definition: module.h:24
module_addref
void module_addref(struct module *module)
Definition: module.c:136
module::author
const char * author
Definition: module.h:42
module_set_path
void module_set_path(const char *path, bool c)
Definition: module.c:208
module_set_default_path
bool module_set_default_path()
Definition: module.c:151
MODULE_EXTENSION
Definition: module.h:28
module_load
struct module * module_load(const char *module_name, struct parameters *args)
Definition: module.c:31
module_add_path
void module_add_path(const char *path, bool c)
Definition: module.c:227
atomic_t
volatile uint32 atomic_t
Definition: thread.h:267
module::name
const char * name
Definition: module.h:40
MODULE_UNKNOWN
Definition: module.h:23
MODULE_ALERT
Definition: module.h:26
MODULE_LOG
Definition: module.h:25
module::description
const char * description
Definition: module.h:41
parameters.h
module_type
module_type
Definition: module.h:22
module_release
void module_release(struct module *module)
Definition: module.c:141