root/src/noit_check_tools.h

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

svn merge -r 327:330 https://labs.omniti.com/reconnoiter/branches/dev/udns .

closes #38

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_CHECK_TOOLS_H
7 #define _NOIT_CHECK_TOOLS_H
8
9 #include "noit_defines.h"
10 #include "eventer/eventer.h"
11 #include "noit_module.h"
12 #include "noit_check.h"
13 #include "utils/noit_hash.h"
14
15 typedef int (*dispatch_func_t)(noit_module_t *, noit_check_t *);
16
17 typedef int (*intperpolate_oper_fn)(char *, int len, const char *replacement);
18
19 API_EXPORT(int)
20   noit_check_interpolate_register_oper_fn(const char *name,
21                                           intperpolate_oper_fn f);
22
23 API_EXPORT(int)
24   noit_check_interpolate(char *buff, int len, const char *fmt,
25                          noit_hash_table *attrs,
26                          noit_hash_table *config);
27
28 API_EXPORT(int)
29   noit_check_schedule_next(noit_module_t *self,
30                            struct timeval *last_check, noit_check_t *check,
31                            struct timeval *now, dispatch_func_t recur);
32
33 API_EXPORT(void)
34   noit_check_run_full_asynch(noit_check_t *check, eventer_func_t callback);
35
36 #define INITIATE_CHECK(func, self, check) do { \
37   if(once) { \
38     func(self, check); \
39   } \
40   else if(!check->fire_event) { \
41     struct timeval epoch = { 0L, 0L }; \
42     noit_check_fake_last_check(check, &epoch, NULL); \
43     noit_check_schedule_next(self, &epoch, check, NULL, func); \
44   } \
45 } while(0)
46
47 API_EXPORT(void)
48   noit_check_make_attrs(noit_check_t *check, noit_hash_table *attrs);
49 API_EXPORT(void)
50   noit_check_release_attrs(noit_hash_table *attrs);
51
52
53 #endif
54
Note: See TracBrowser for help on using the browser.