-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugins.h
60 lines (48 loc) · 1.74 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
/*******************************************************************************
* Copyright (c) 2009 Philippe Proulx, École Polytechnique de Montréal
* Michael Sills-Lavoie, École Polytechnique de Montréal
* and others. All rights reserved.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Philippe Proulx - initial plugins system
* Michael Sills-Lavoie - deterministic plugins loading order
* Michael Sills-Lavoie - plugin's shared functions
*******************************************************************************/
/*
* Plugins system.
*/
#ifndef D_plugins
#define D_plugins
#include "protocol.h"
#define _QUOTEME(x) #x
#define QUOTE(x) _QUOTEME(x)
#define PLUGINS_DEF_EXT "so" /* Default plugins' extension */
/*
* Loads ALL plugins from the directory PATH_Plugins (from `config.h') in
* alphabetical order.
*/
int plugins_load(Protocol *, TCFBroadcastGroup *, TCFSuspendGroup *);
/*
* Initializes a particular plugin according to its path.
*/
int plugin_init(const char *, Protocol *, TCFBroadcastGroup *, TCFSuspendGroup *);
/*
* Add a new public plugin function for the other plugins to see.
*/
int plugin_add_function(const char *, void *);
/*
* Get a public function from its name.
*/
void * plugin_get_function(const char *);
/*
* Destroys loaded plugins.
*/
int plugins_destroy(void);
#endif /* D_plugins */