root/src/noit_conf.h

Revision 0709063b3450834a1a3164c31b31e8dc95b7880d, 2.9 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

compile error

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