1 /* 2 This file is part of Deadbeef Player source code 3 http://deadbeef.sourceforge.net 4 5 config file manager 6 7 Copyright (C) 2009-2013 Alexey Yakovenko 8 9 This software is provided 'as-is', without any express or implied 10 warranty. In no event will the authors be held liable for any damages 11 arising from the use of this software. 12 13 Permission is granted to anyone to use this software for any purpose, 14 including commercial applications, and to alter it and redistribute it 15 freely, subject to the following restrictions: 16 17 1. The origin of this software must not be misrepresented; you must not 18 claim that you wrote the original software. If you use this software 19 in a product, an acknowledgment in the product documentation would be 20 appreciated but is not required. 21 2. Altered source versions must be plainly marked as such, and must not be 22 misrepresented as being the original software. 23 3. This notice may not be removed or altered from any source distribution. 24 25 Alexey Yakovenko waker@users.sourceforge.net 26 */ 27 #ifndef __CONF_H 28 #define __CONF_H 29 30 #include "deadbeef.h" 31 32 int 33 conf_load (void); 34 35 int 36 conf_save (void); 37 38 void 39 conf_init (void); 40 41 void 42 conf_free (void); 43 44 void 45 conf_lock (void); 46 47 void 48 conf_unlock (void); 49 50 int 51 conf_ischanged (void); 52 53 void 54 conf_setchanged (int c); 55 56 void 57 conf_get_str (const char *key, const char *def, char *buffer, int buffer_size); 58 59 const char * 60 conf_get_str_fast (const char *key, const char *def); 61 62 float 63 conf_get_float (const char *key, float def); 64 65 int 66 conf_get_int (const char *key, int def); 67 68 int64_t 69 conf_get_int64 (const char *key, int64_t def); 70 71 void 72 conf_set_str (const char *key, const char *val); 73 74 void 75 conf_set_int (const char *key, int val); 76 77 void 78 conf_set_int64 (const char *key, int64_t val); 79 80 void 81 conf_set_float (const char *key, float val); 82 83 DB_conf_item_t * 84 conf_find (const char *group, DB_conf_item_t *prev); 85 86 // remove all items starting with key 87 void 88 conf_remove_items (const char *key); 89 90 void 91 conf_item_free (DB_conf_item_t *it); 92 93 #endif // __CONF_H 94