1 |
/* |
2 |
* prefs_dummy.cpp - Preferences handling, dummy implementation |
3 |
* |
4 |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#include "sysdeps.h" |
22 |
|
23 |
#include <stdio.h> |
24 |
#include <stdlib.h> |
25 |
|
26 |
#include "prefs.h" |
27 |
|
28 |
|
29 |
// Platform-specific preferences items |
30 |
prefs_desc platform_prefs_items[] = { |
31 |
{NULL, TYPE_END, false} // End of list |
32 |
}; |
33 |
|
34 |
|
35 |
// Prefs file name and path |
36 |
const char PREFS_FILE_NAME[] = "BasiliskII_Prefs"; |
37 |
|
38 |
|
39 |
/* |
40 |
* Load preferences from settings file |
41 |
*/ |
42 |
|
43 |
void LoadPrefs(void) |
44 |
{ |
45 |
// Read preferences from settings file |
46 |
FILE *f = fopen(PREFS_FILE_NAME, "r"); |
47 |
if (f != NULL) { |
48 |
|
49 |
// Prefs file found, load settings |
50 |
LoadPrefsFromStream(f); |
51 |
fclose(f); |
52 |
|
53 |
} else { |
54 |
|
55 |
// No prefs file, save defaults |
56 |
SavePrefs(); |
57 |
} |
58 |
} |
59 |
|
60 |
|
61 |
/* |
62 |
* Save preferences to settings file |
63 |
*/ |
64 |
|
65 |
void SavePrefs(void) |
66 |
{ |
67 |
FILE *f; |
68 |
if ((f = fopen(PREFS_FILE_NAME, "w")) != NULL) { |
69 |
SavePrefsToStream(f); |
70 |
fclose(f); |
71 |
} |
72 |
} |
73 |
|
74 |
|
75 |
/* |
76 |
* Add defaults of platform-specific prefs items |
77 |
* You may also override the defaults set in PrefsInit() |
78 |
*/ |
79 |
|
80 |
void AddPlatformPrefsDefaults(void) |
81 |
{ |
82 |
} |