forked from cjacker/Hugs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.c
55 lines (47 loc) · 1.67 KB
/
plugin.c
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
/* --------------------------------------------------------------------------
* Statically linked plugins
*
* The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the
* Yale Haskell Group, and the OGI School of Science & Engineering at OHSU,
* 1994-2003, All rights reserved. It is distributed as free software under
* the license in the file "License", which is included in the distribution.
*
* ------------------------------------------------------------------------*/
#include "prelude.h"
#include "storage.h"
#include "connect.h"
/* This file is often compiled with a command-line argument such as
* '-DPLUGINS={"Xlib",initXlib},'
* default to empty if not present.
*/
#ifndef PLUGINS
# define PLUGINS
#endif
struct pluginInfo {
String nm; /* Name of plugin module */
InitModuleFun5 initModule; /* Initialisation code for the plugin */
};
static struct pluginInfo pluginList[] = { /* hardwired list of all plugins */
/* {"Test", initTest}, */
/* {"Xlib", initXlib}, */
PLUGINS
{0,0}
};
Bool havePlugin(mod) /* can we statically link this plugin? */
String mod; { /* (called when each module is loaded) */
Int i;
for(i=0; pluginList[i].nm; ++i) {
if (0 == strcmp(mod, pluginList[i].nm)) {
(*pluginList[i].initModule)(hugsAPI5());
return TRUE;
}
}
return FALSE;
}
/* --------------------------------------------------------------------------
* Plugins control:
* ------------------------------------------------------------------------*/
Void plugins(what)
Int what; {
}
/*-------------------------------------------------------------------------*/