root/src/noit_conf.h

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

online editing of attributes

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