SmartPDF - lightweight pdf viewer app for rosapps
[reactos.git] / rosapps / smartpdf / baseutils / prefs_util.h
1 /* Written by Krzysztof Kowalczyk (http://blog.kowalczyk.info)
2 The author disclaims copyright to this source code. */
3 #ifndef PREFS_H_
4 #define PREFS_H_
5
6 #ifdef __cplusplus
7 extern "C"
8 {
9 #endif
10
11 typedef enum pref_type pref_type;
12 enum pref_type {
13 PT_INVALID = 0,
14 PT_INT,
15 PT_STRING
16 };
17
18 typedef struct prefs_data prefs_data;
19
20 /* describes all preferences in a program */
21 struct prefs_data {
22 const TCHAR * name;
23 pref_type type;
24 union {
25 void * data_void;
26 int * data_int;
27 TCHAR ** data_str;
28 } data;
29 };
30
31 TCHAR *prefs_to_tstr(prefs_data *prefs, size_t *tstr_len_cb_ptr);
32 int prefs_from_tstr(prefs_data *prefs, const TCHAR *str, size_t str_len_cb);
33
34 #ifdef __cplusplus
35 }
36 #endif
37
38 #endif