root/src/noit_module.h

Revision 2ff4db5a6730270eb30827e23883ed354c42ddf6, 3.0 kB (checked in by Phil Maddox <philip.maddox@circonus.com>, 1 year ago)

Explicitly Initialize Mtev Hash Tables

Rather than using MTEV_HASH_EMPTY or not calling any initialization at
all, explicitly initialize hash tables.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, 2008, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  * Copyright (c) 2015, Circonus, Inc. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above
13  *       copyright notice, this list of conditions and the following
14  *       disclaimer in the documentation and/or other materials provided
15  *       with the distribution.
16  *     * Neither the name OmniTI Computer Consulting, Inc. nor the names
17  *       of its contributors may be used to endorse or promote products
18  *       derived from this software without specific prior written
19  *       permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef _NOIT_MODULE_H
35 #define _NOIT_MODULE_H
36
37 #include <mtev_defines.h>
38 #include <mtev_dso.h>
39 #include "noit_check.h"
40
41 #define NOIT_MODULE_MAGIC         0x4017DA7A
42 #define NOIT_MODULE_ABI_VERSION   5
43
44 typedef struct _noit_module {
45   mtev_image_t hdr;
46   int (*config)(struct _noit_module *, mtev_hash_table *options);
47   int (*init)(struct _noit_module *);
48   int (*initiate_check)(struct _noit_module *, noit_check_t *check,
49                         int once, noit_check_t *cause);
50   void (*cleanup)(struct _noit_module *, noit_check_t *);
51   unsigned thread_unsafe :1;
52 } noit_module_t;
53
54 /*         config: is called to pass the config into the module.
55  *           init: is called once to initialize the module
56  * initiate_check: is called so start the module against checks
57  *        cleanup: is called if a particular check is stopped
58  */
59
60 API_EXPORT(void)
61   noit_module_init();
62 API_EXPORT(int)
63   noit_module_load_failures();
64 API_EXPORT(int)
65   noit_module_list_modules(const char ***f);
66 API_EXPORT(noit_module_t *)
67   noit_module_lookup(const char *name);
68 API_EXPORT(noit_module_t *)
69   noit_blank_module();
70 API_EXPORT(int)
71   noit_register_module(noit_module_t *mod);
72
73 API_EXPORT(void *)
74   noit_module_get_userdata(noit_module_t *mod);
75 API_EXPORT(void)
76   noit_module_set_userdata(noit_module_t *mod, void *);
77 API_EXPORT(void)
78   noit_module_init_globals(void);
79
80 #endif
Note: See TracBrowser for help on using the browser.