root/src/noit_conf.h

Revision 057e0c6fdd21f0c4e9158d3ae149de09dd80dfd9, 3.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 5 years ago)

change noit_conf_boolean to noit_conf... more sense. refs #34

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_CONF_H
7 #define _NOIT_CONF_H
8
9 #include "noit_defines.h"
10 #include "utils/noit_hash.h"
11 #include "noit_console.h"
12
13 #include <uuid/uuid.h>
14
15 typedef void * noit_conf_section_t;
16
17 #define NOIT_CONF_T_USERDATA "noit::state::conf_t"
18 typedef struct {
19   char *path;
20   uuid_t current_check;
21   char prompt[50];
22 } noit_conf_t_userdata_t;
23
24 /* seconds == 0 disable config journaling watchdog */
25 API_EXPORT(void) noit_conf_coalesce_changes(u_int32_t seconds);
26 /* Start the watchdog */
27 API_EXPORT(void) noit_conf_watch_and_journal_watchdog(int (*f)(void *), void *c);
28
29 /* marks the config as changed.. if you manipulate the XML tree in any way
30  * you must call this function to "let the system know."  This is used
31  * to notice changes which are in turn flushed out.
32  */
33 API_EXPORT(void) noit_conf_mark_changed();
34
35 API_EXPORT(void) noit_conf_init(const char *toplevel);
36 API_EXPORT(int) noit_conf_load(const char *path);
37 API_EXPORT(int) noit_conf_save(const char *path);
38
39 API_EXPORT(noit_conf_section_t)
40   noit_conf_get_section(noit_conf_section_t section, const char *path);
41 API_EXPORT(noit_conf_section_t *)
42   noit_conf_get_sections(noit_conf_section_t section, const char *path,
43                          int *cnt);
44
45 API_EXPORT(noit_hash_table *)
46   noit_conf_get_hash(noit_conf_section_t section, const char *path);
47
48 API_EXPORT(int) noit_conf_get_string(noit_conf_section_t section,
49                                      const char *path, char **value);
50
51 API_EXPORT(int) noit_conf_get_stringbuf(noit_conf_section_t section,
52                                         const char *path, char *value, int len);
53 API_EXPORT(int) noit_conf_get_int(noit_conf_section_t section,
54                                   const char *path, int *value);
55 API_EXPORT(int) noit_conf_get_float(noit_conf_section_t section,
56                                     const char *path, float *value);
57 API_EXPORT(int) noit_conf_get_boolean(noit_conf_section_t section,
58                                       const char *path, noit_boolean *value);
59 API_EXPORT(int)
60   noit_conf_get_uuid(noit_conf_section_t section,
61                      const char *path, uuid_t out);
62
63 API_EXPORT(int) noit_conf_set_string(noit_conf_section_t section,
64                                      const char *path, const char *value);
65 API_EXPORT(int) noit_conf_set_int(noit_conf_section_t section,
66                                   const char *path, int value);
67 API_EXPORT(int) noit_conf_set_float(noit_conf_section_t section,
68                                     const char *path, float value);
69 API_EXPORT(int) noit_conf_set_boolean(noit_conf_section_t section,
70                                       const char *path, noit_boolean value);
71
72 API_EXPORT(int)
73   noit_conf_reload(noit_console_closure_t ncct,
74                    int argc, char **argv,
75                    noit_console_state_t *state, void *closure);
76 API_EXPORT(int)
77   noit_conf_write_terminal(noit_console_closure_t ncct,
78                            int argc, char **argv,
79                            noit_console_state_t *state, void *closure);
80 API_EXPORT(int)
81   noit_conf_write_file(noit_console_closure_t ncct,
82                        int argc, char **argv,
83                        noit_console_state_t *state, void *closure);
84
85 API_EXPORT(char *)
86   noit_conf_xml_in_mem(size_t *len);
87
88 API_EXPORT(int)
89   noit_conf_write_log();
90
91 API_EXPORT(void) noit_conf_log_init(const char *toplevel);
92
93 #endif
Note: See TracBrowser for help on using the browser.