Debian Codegraph @

third_party/rust/winreg/src/enums.rs

raw
1 // Copyright 2015, Igor Shaula
2 // Licensed under the MIT License <LICENSE or
3 // http://opensource.org/licenses/MIT>. This file
4 // may not be copied, modified, or distributed
5 // except according to those terms.
6
7 //! `use winreg::enums::*;` to import all needed enumerations and constants
8 use super::winapi;
9 pub use winapi::um::winnt::{
10 KEY_ALL_ACCESS, KEY_CREATE_LINK, KEY_CREATE_SUB_KEY, KEY_ENUMERATE_SUB_KEYS, KEY_EXECUTE,
11 KEY_NOTIFY, KEY_QUERY_VALUE, KEY_READ, KEY_SET_VALUE, KEY_WOW64_32KEY, KEY_WOW64_64KEY,
12 KEY_WOW64_RES, KEY_WRITE,
13 };
14 pub use winapi::um::winreg::{
15 HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_CURRENT_USER_LOCAL_SETTINGS,
16 HKEY_DYN_DATA, HKEY_LOCAL_MACHINE, HKEY_PERFORMANCE_DATA, HKEY_PERFORMANCE_NLSTEXT,
17 HKEY_PERFORMANCE_TEXT, HKEY_USERS, REG_PROCESS_APPKEY,
18 };
19
20 macro_rules! winapi_enum{
21 ($t:ident, $doc:expr => [$($v:ident),*]) => (
22 #[doc=$doc]
23 #[allow(non_camel_case_types)]
24 #[derive(Debug,Clone,PartialEq)]
25 pub enum $t {
26 $( $v = winapi::um::winnt::$v as isize ),*
27 }
28 )
29 }
30
31 winapi_enum!(RegType, "Enumeration of possible registry value types" => [
32 REG_NONE,
33 REG_SZ,
34 REG_EXPAND_SZ,
35 REG_BINARY,
36 REG_DWORD,
37 REG_DWORD_BIG_ENDIAN,
38 REG_LINK,
39 REG_MULTI_SZ,
40 REG_RESOURCE_LIST,
41 REG_FULL_RESOURCE_DESCRIPTOR,
42 REG_RESOURCE_REQUIREMENTS_LIST,
43 REG_QWORD
44 ]);
45 pub use self::RegType::*;
46
47 winapi_enum!(RegDisposition, "Enumeration of possible disposition values" => [
48 REG_CREATED_NEW_KEY,
49 REG_OPENED_EXISTING_KEY
50 ]);
51 pub use self::RegDisposition::*;