root/src/noit_conf.h

Revision 1fe89bbf2c59cbd0895409389eb9df047e96d692, 2.1 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

userdata for states, track a path and prompt

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