root/src/noit_module.h

Revision 6e90b3f8072e3e74ee6b01f01b9b1be2e207738f, 1.3 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

support 'no check' on console to delete checks as well as 'reload' on console (currently only reloads checks)

  • 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_check.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                         int once, noit_check_t *cause);
26   void (*cleanup)(struct _noit_module *, noit_check_t *);
27   void *opaque_handle;
28 } noit_module_t;
29
30 #define MODULE_MAGIC(a)          ((a)->magic)
31 #define MODULE_VERSION(a)        ((a)->version)
32
33 #define noit_module_validate_magic(a) \
34   ((MODULE_MAGIC(a) == NOIT_MODULE_MAGIC)?0:-1)
35
36 API_EXPORT(void)
37   noit_module_init();
38 API_EXPORT(int)
39   noit_module_load(const char *file, const char *name);
40 API_EXPORT(noit_module_t *)
41   noit_module_lookup(const char *name);
42
43 API_EXPORT(void *)
44   noit_module_get_userdata(noit_module_t *mod);
45 API_EXPORT(void)
46   noit_module_set_userdata(noit_module_t *mod, void *newdata);
47
48 #endif
Note: See TracBrowser for help on using the browser.