Subversion Repositories freemyipod

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
828 theseven 1
//
2
//
3
//    Copyright 2011 TheSeven
4
//
5
//
6
//    This file is part of emCORE.
7
//
8
//    emCORE is free software: you can redistribute it and/or
9
//    modify it under the terms of the GNU General Public License as
10
//    published by the Free Software Foundation, either version 2 of the
11
//    License, or (at your option) any later version.
12
//
13
//    emCORE is distributed in the hope that it will be useful,
14
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
//    See the GNU General Public License for more details.
17
//
18
//    You should have received a copy of the GNU General Public License along
19
//    with emCORE.  If not, see <http://www.gnu.org/licenses/>.
20
//
21
//
22
 
23
 
24
#ifndef __APP_SETTINGS_H__
25
#define __APP_SETTINGS_H__
26
 
27
 
28
#include "emcoreapp.h"
29
 
30
 
31
#define SETTINGS_VERSION 1
32
struct settingdata
33
{
34
    char magic[8];
35
    char app[8];
36
    uint32_t version;
37
    long timeout_initial;
38
    long timeout_idle;
39
    int timeout_item;
40
    int default_item;
41
    int fastboot_item;
42
};
43
 
44
#define SETTINGS_TIMEOUT_INITIAL_MIN 0
45
#define SETTINGS_TIMEOUT_INITIAL_MAX 2000000000
46
#define SETTINGS_TIMEOUT_INITIAL_STEP 1000000
47
#define SETTINGS_TIMEOUT_IDLE_MIN 0
48
#define SETTINGS_TIMEOUT_IDLE_MAX 2000000000
49
#define SETTINGS_TIMEOUT_IDLE_STEP 1000000
50
#define SETTINGS_TIMEOUT_ITEM_MIN 0
51
#define SETTINGS_TIMEOUT_ITEM_MAX 5
52
#define SETTINGS_DEFAULT_ITEM_MIN 0
53
#define SETTINGS_DEFAULT_ITEM_MAX 5
54
#define SETTINGS_FASTBOOT_ITEM_MIN 0
55
#define SETTINGS_FASTBOOT_ITEM_MAX 5
56
 
57
#define SETTINGS_TIMEOUT_CUTOFF 3000000
58
 
59
 
60
extern struct settingdata settings_default;
61
extern struct settingdata settings;
62
 
63
 
64
extern void settings_init();
65
extern void settings_reset();
66
extern void setting_validate(void* setting);
67
extern void settings_validate_all();
68
extern void settings_apply();
69
extern void settings_save();
70
 
71
 
72
#endif