]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - libs/profile/profile.h
ecd8b2b2ee8fc855604def1febb1df3f55f603e9
[xonotic/netradiant.git] / libs / profile / profile.h
1 /*
2 Copyright (c) 2001, Loki software, inc.
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without modification, 
6 are permitted provided that the following conditions are met:
7
8 Redistributions of source code must retain the above copyright notice, this list 
9 of conditions and the following disclaimer.
10
11 Redistributions in binary form must reproduce the above copyright notice, this
12 list of conditions and the following disclaimer in the documentation and/or
13 other materials provided with the distribution.
14
15 Neither the name of Loki software nor the names of its contributors may be used 
16 to endorse or promote products derived from this software without specific prior 
17 written permission. 
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
22 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 
23 DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
29 */
30
31 #if !defined(INCLUDED_PROFILE_PROFILE_H)
32 #define INCLUDED_PROFILE_PROFILE_H
33
34 // profile functions - kind of utility lib
35 // they are kind of dumb, they expect to get the path to the .ini file or to the prefs directory when called
36 // load_buffer and save_buffer expect the path only, theyll build a $(pszName).bin file
37 bool profile_save_int (const char *filename, const char *section, const char *key, int value);
38 bool profile_save_float (const char *filename, const char *section, const char *key, float value);
39 bool profile_save_string (const char *filename, const char *section, const char *key, const char *value);
40 bool profile_save_buffer (const char *rc_path, const char *pszName, void *pvBuf, unsigned int lSize);
41 bool profile_load_buffer (const char *rc_path, const char *pszName, void *pvBuf, unsigned int *plSize);
42 int profile_load_int (const char *filename, const char *section, const char *key, int default_value);
43 float profile_load_float (const char *filename, const char *section, const char *key, float default_value);
44 char* profile_load_string (const char *filename, const char *section, const char *key, const char *default_value);
45 // used in the command map code
46 bool read_var (const char *filename, const char *section, const char *key, char *value);
47
48 #endif