root/src/noit_module.h

Revision e102af344eb4afacdeeb549fb60d77715f815a53, 1.0 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 10 years ago)

modules actually load now.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, 2008, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_MODULE_H
7 #define _NOIT_MODULE_H
8
9 #include "noit_defines.h"
10 #include "utils/noit_hash.h"
11 #include "noit_poller.h"
12
13 #define NOIT_MODULE_MAGIC         0x4017DA7A
14 #define NOIT_MODULE_ABI_VERSION   1
15
16 typedef struct _noit_module {
17   uint32_t magic;
18   uint32_t version;
19   char *name;
20   char *description;
21   int (*onload)(struct _noit_module *);
22   int (*config)(struct _noit_module *, noit_hash_table *options);
23   int (*init)(struct _noit_module *);
24   int (*initiate_check)(struct _noit_module *, noit_check_t check);
25 } noit_module_t;
26
27 #define MODULE_MAGIC(a)          ((a)->magic)
28 #define MODULE_VERSION(a)        ((a)->version)
29
30 #define noit_module_validate_magic(a) \
31   ((MODULE_MAGIC(a) == NOIT_MODULE_MAGIC)?0:-1)
32
33 API_EXPORT(void)
34   noit_module_init();
35 API_EXPORT(int)
36   noit_module_load(const char *file, const char *name);
37 API_EXPORT(noit_module_t *)
38   noit_module_lookup(const char *name);
39
40 #endif
Note: See TracBrowser for help on using the browser.