root/src/noit_conf.h

Revision e781d1eba05c6dd4520aec7f96642bc77a0f9de1, 2.3 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 7 years ago)

oh dear, check creation?!

  • 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 typedef enum { noit_false = 0, noit_true } noit_conf_boolean;
14 typedef void * noit_conf_section_t;
15
16 #define NOIT_CONF_T_USERDATA "noit::state::conf_t"
17 typedef struct {
18   char *path;
19   uuid_t current_check;
20   char prompt[50];
21 } noit_conf_t_userdata_t;
22
23 API_EXPORT(void) noit_conf_init();
24 API_EXPORT(int) noit_conf_load(const char *path);
25 API_EXPORT(int) noit_conf_save(const char *path);
26
27 API_EXPORT(noit_conf_section_t)
28   noit_conf_get_section(noit_conf_section_t section, const char *path);
29 API_EXPORT(noit_conf_section_t *)
30   noit_conf_get_sections(noit_conf_section_t section, const char *path,
31                          int *cnt);
32
33 API_EXPORT(noit_hash_table *)
34   noit_conf_get_hash(noit_conf_section_t section, const char *path);
35
36 API_EXPORT(int) noit_conf_get_string(noit_conf_section_t section,
37                                      const char *path, char **value);
38 API_EXPORT(int) noit_conf_get_stringbuf(noit_conf_section_t section,
39                                         const char *path, char *value, int len);
40 API_EXPORT(int) noit_conf_get_int(noit_conf_section_t section,
41                                   const char *path, int *value);
42 API_EXPORT(int) noit_conf_get_float(noit_conf_section_t section,
43                                     const char *path, float *value);
44 API_EXPORT(int) noit_conf_get_boolean(noit_conf_section_t section,
45                                       const char *path, noit_conf_boolean *value);
46
47 API_EXPORT(int) noit_conf_set_string(noit_conf_section_t section,
48                                      const char *path, const char *value);
49 API_EXPORT(int) noit_conf_set_int(noit_conf_section_t section,
50                                   const char *path, int value);
51 API_EXPORT(int) noit_conf_set_float(noit_conf_section_t section,
52                                     const char *path, float value);
53 API_EXPORT(int) noit_conf_set_boolean(noit_conf_section_t section,
54                                       const char *path, noit_conf_boolean value);
55
56 API_EXPORT(int)
57   noit_conf_check_set_attr(noit_console_closure_t ncct,
58                            int argc, char **argv,
59                            noit_console_state_t *state, void *closure);
60
61 #endif
Note: See TracBrowser for help on using the browser.