1 | /****************************************************************************** |
---|
2 | * $Id: conf.h 3206 2007-09-27 20:57:58Z charles $ |
---|
3 | * |
---|
4 | * Copyright (c) 2005-2007 Transmission authors and contributors |
---|
5 | * |
---|
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
---|
7 | * copy of this software and associated documentation files (the "Software"), |
---|
8 | * to deal in the Software without restriction, including without limitation |
---|
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
---|
10 | * and/or sell copies of the Software, and to permit persons to whom the |
---|
11 | * Software is furnished to do so, subject to the following conditions: |
---|
12 | * |
---|
13 | * The above copyright notice and this permission notice shall be included in |
---|
14 | * all copies or substantial portions of the Software. |
---|
15 | * |
---|
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
---|
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
---|
22 | * DEALINGS IN THE SOFTWARE. |
---|
23 | *****************************************************************************/ |
---|
24 | |
---|
25 | /** |
---|
26 | *** |
---|
27 | **/ |
---|
28 | |
---|
29 | #ifndef TG_CONF_H |
---|
30 | #define TG_CONF_H |
---|
31 | |
---|
32 | int pref_int_get ( const char * key ); |
---|
33 | void pref_int_set ( const char * key, int value ); |
---|
34 | void pref_int_set_default ( const char * key, int default_value ); |
---|
35 | |
---|
36 | gboolean pref_flag_get ( const char * key ); |
---|
37 | void pref_flag_set ( const char * key, gboolean value ); |
---|
38 | void pref_flag_set_default ( const char * key, gboolean default_value ); |
---|
39 | |
---|
40 | char* pref_string_get ( const char * key ); |
---|
41 | void pref_string_set ( const char * key, const char * value ); |
---|
42 | void pref_string_set_default ( const char * key, const char * default_value ); |
---|
43 | |
---|
44 | void pref_save ( char **errstr ); |
---|
45 | |
---|
46 | /** |
---|
47 | *** |
---|
48 | **/ |
---|
49 | |
---|
50 | struct benc_val_s; |
---|
51 | |
---|
52 | gboolean |
---|
53 | cf_init(const char *confdir, char **errstr); |
---|
54 | gboolean |
---|
55 | cf_lock(char **errstr); |
---|
56 | char * |
---|
57 | cf_sockname(void); |
---|
58 | void |
---|
59 | cf_loadprefs(char **errstr); |
---|
60 | struct benc_val_s * |
---|
61 | cf_loadstate(char **errstr); |
---|
62 | void |
---|
63 | cf_savestate(struct benc_val_s *state, char **errstr); |
---|
64 | void |
---|
65 | cf_freestate(struct benc_val_s *state); |
---|
66 | |
---|
67 | #endif /* TG_CONF_H */ |
---|