1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32
33 #include "appsettings.h"
34
35
36 const char *flags_crypto_on =
"c";
37 const char *flags_crypto_off =
"";
38 const char *flags_locked =
"L";
39 const char *flags_unlocked =
"";
40 const char *flags_exec_on =
"";
41 const char *flags_exec_off =
"";
42
43
44 void appsettings_init(
void) {
45
46 flags_crypto_on = ui_set_default_property(
"idav.ui.flags.encrypted", flags_crypto_on);
47 flags_crypto_off = ui_set_default_property(
"idav.ui.flags.unencrypted", flags_crypto_off);
48 flags_locked = ui_set_default_property(
"idav.ui.flags.locked", flags_locked);
49 flags_unlocked = ui_set_default_property(
"idav.ui.flags.unlocked", flags_unlocked);
50 flags_exec_on = ui_set_default_property(
"idav.ui.flags.executable", flags_exec_on);
51 flags_exec_off = ui_set_default_property(
"idav.ui.flags.noexec", flags_exec_off);
52 }
53
54
55 const char* appsettings_get_cryptoflag(UiBool encrypted) {
56 return encrypted ? flags_crypto_on : flags_crypto_off;
57 }
58
59 const char* appsettings_get_lockflag(UiBool locked) {
60 return locked ? flags_locked : flags_unlocked;
61 }
62
63 const char* appsettings_get_execflag(UiBool executable) {
64 return executable ? flags_exec_on : flags_exec_off;
65 }
66
67