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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
use libc::c_uint;
use loadorder::GameId;
use loadorder::LoadOrderMethod;
#[no_mangle]
pub static LIBLO_OK: c_uint = 0;
#[no_mangle]
pub static LIBLO_WARN_LO_MISMATCH: c_uint = 2;
#[no_mangle]
pub static LIBLO_ERROR_FILE_NOT_UTF8: c_uint = 5;
#[no_mangle]
pub static LIBLO_ERROR_FILE_NOT_FOUND: c_uint = 6;
#[no_mangle]
pub static LIBLO_ERROR_FILE_RENAME_FAIL: c_uint = 7;
#[no_mangle]
pub static LIBLO_ERROR_TIMESTAMP_WRITE_FAIL: c_uint = 9;
#[no_mangle]
pub static LIBLO_ERROR_FILE_PARSE_FAIL: c_uint = 10;
#[no_mangle]
pub static LIBLO_ERROR_INVALID_ARGS: c_uint = 12;
#[no_mangle]
pub static LIBLO_ERROR_POISONED_THREAD_LOCK: c_uint = 14;
#[no_mangle]
pub static LIBLO_ERROR_IO_ERROR: c_uint = 15;
#[no_mangle]
pub static LIBLO_ERROR_IO_PERMISSION_DENIED: c_uint = 16;
#[no_mangle]
pub static LIBLO_ERROR_TEXT_ENCODE_FAIL: c_uint = 17;
#[no_mangle]
pub static LIBLO_ERROR_TEXT_DECODE_FAIL: c_uint = 18;
#[no_mangle]
pub static LIBLO_ERROR_INTERNAL_LOGIC_ERROR: c_uint = 19;
#[no_mangle]
pub static LIBLO_ERROR_PANICKED: c_uint = 20;
#[no_mangle]
pub static LIBLO_RETURN_MAX: c_uint = 20;
#[no_mangle]
pub static LIBLO_METHOD_TIMESTAMP: c_uint = LoadOrderMethod::Timestamp as c_uint;
#[no_mangle]
pub static LIBLO_METHOD_TEXTFILE: c_uint = LoadOrderMethod::Textfile as c_uint;
#[no_mangle]
pub static LIBLO_METHOD_ASTERISK: c_uint = LoadOrderMethod::Asterisk as c_uint;
#[no_mangle]
pub static LIBLO_GAME_TES3: c_uint = GameId::Morrowind as c_uint;
#[no_mangle]
pub static LIBLO_GAME_TES4: c_uint = GameId::Oblivion as c_uint;
#[no_mangle]
pub static LIBLO_GAME_TES5: c_uint = GameId::Skyrim as c_uint;
#[no_mangle]
pub static LIBLO_GAME_FO3: c_uint = GameId::Fallout3 as c_uint;
#[no_mangle]
pub static LIBLO_GAME_FNV: c_uint = GameId::FalloutNV as c_uint;
#[no_mangle]
pub static LIBLO_GAME_FO4: c_uint = GameId::Fallout4 as c_uint;
#[no_mangle]
pub static LIBLO_GAME_TES5SE: c_uint = GameId::SkyrimSE as c_uint;
#[no_mangle]
pub static LIBLO_GAME_TES5VR: c_uint = GameId::SkyrimVR as c_uint;
#[no_mangle]
pub static LIBLO_GAME_FO4VR: c_uint = GameId::Fallout4VR as c_uint;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn game_constants_should_have_expected_integer_values() {
assert_eq!(1, LIBLO_GAME_TES3);
assert_eq!(2, LIBLO_GAME_TES4);
assert_eq!(3, LIBLO_GAME_TES5);
assert_eq!(4, LIBLO_GAME_FO3);
assert_eq!(5, LIBLO_GAME_FNV);
assert_eq!(6, LIBLO_GAME_FO4);
assert_eq!(7, LIBLO_GAME_TES5SE);
assert_eq!(8, LIBLO_GAME_FO4VR);
assert_eq!(9, LIBLO_GAME_TES5VR);
}
}