source: trunk/gtk/conf.h @ 7367

Last change on this file since 7367 was 7367, checked in by charles, 12 years ago

(trunk) #1559: Simplify tr_sessionInitFull

  • Property svn:keywords set to Date Rev Author Id
File size: 2.6 KB
Line 
1/******************************************************************************
2 * $Id: conf.h 7367 2008-12-13 23:17:36Z charles $
3 *
4 * Copyright (c) 2005-2008 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
25struct tr_benc;
26struct tr_handle;
27
28/**
29***
30**/
31
32#ifndef TG_CONF_H
33#define TG_CONF_H
34
35int64_t          pref_int_get           ( const char * key );
36void             pref_int_set           ( const char * key, int64_t value );
37void             pref_int_set_default   ( const char * key, int64_t value );
38
39gboolean         pref_flag_get          ( const char * key );
40void             pref_flag_set          ( const char * key, gboolean value );
41void             pref_flag_set_default  ( const char * key, gboolean value );
42
43const char*      pref_string_get        ( const char * key );
44void             pref_string_set        ( const char * key, const char * value );
45void             pref_string_set_default( const char * key, const char * value );
46
47void             pref_save              ( struct tr_handle * );
48struct tr_benc*  pref_get_all           ( void );
49
50/**
51***
52**/
53
54enum
55{
56    PREF_FLAG_DEFAULT = 0,
57    PREF_FLAG_FALSE = 1,
58    PREF_FLAG_TRUE = 2
59};
60
61typedef int pref_flag_t;
62
63gboolean pref_flag_eval( pref_flag_t  val,
64                         const char * key );
65
66
67/**
68***
69**/
70
71gboolean cf_init( const char *confdir,
72                  char **     errstr );
73
74gboolean cf_lock( tr_lockfile_state_t *tr_state,
75                  char **              errstr );
76
77void     cf_check_older_configs( void );
78
79#endif /* TG_CONF_H */
Note: See TracBrowser for help on using the repository browser.