Package locale_config
Nikos Tsipinakis
4 years ago
0 | rust-locale-config (0.2.2-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium | |
1 | ||
2 | * Package locale_config 0.2.2 from crates.io using debcargo 2.2.10 | |
3 | ||
4 | -- Nikos Tsipinakis <nikos@tsipinakis.com> Sat, 6 Jul 2019 13:51:58 +0300 |
0 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | |
1 | Upstream-Name: locale_config | |
2 | Upstream-Contact: Jan Hudec <bulb@ucw.cz> | |
3 | Source: https://github.com/rust-locale/locale_config/ | |
4 | ||
5 | Files: * | |
6 | Copyright: 2016 Jan Hudec <bulb@ucw.cz>, | |
7 | 2016 A.J. Gardner <aaron.j.gardner@gmail.com> | |
8 | License: MIT | |
9 | ||
10 | Files: debian/* | |
11 | Copyright: | |
12 | 2019 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> | |
13 | License: MIT | |
14 | ||
15 | License: MIT | |
16 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
17 | of this software and associated documentation files (the "Software"), to deal | |
18 | in the Software without restriction, including without limitation the rights | |
19 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
20 | copies of the Software, and to permit persons to whom the Software is | |
21 | furnished to do so, subject to the following conditions: | |
22 | . | |
23 | The above copyright notice and this permission notice shall be included in all | |
24 | copies or substantial portions of the Software. | |
25 | . | |
26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
28 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
29 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
30 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
31 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
32 | SOFTWARE. |
0 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | |
1 | Upstream-Name: locale_config | |
2 | Upstream-Contact: Jan Hudec <bulb@ucw.cz> | |
3 | Source: https://github.com/rust-locale/locale_config/ | |
4 | ||
5 | Files: * | |
6 | Copyright: FIXME (overlay) UNKNOWN-YEARS Jan Hudec <bulb@ucw.cz> | |
7 | License: MIT | |
8 | Comment: | |
9 | FIXME (overlay): Since upstream copyright years are not available in | |
10 | Cargo.toml, they were extracted from the upstream Git repository. This may not | |
11 | be correct information so you should review and fix this before uploading to | |
12 | the archive. | |
13 | ||
14 | Files: ./LICENSE | |
15 | Copyright: | |
16 | 2016 Jan Hudec <bulb@ucw.cz> | |
17 | 2016 A.J. Gardner <aaron.j.gardner@gmail.com> | |
18 | License: UNKNOWN-LICENSE; FIXME (overlay) | |
19 | Comment: | |
20 | FIXME (overlay): These notices are extracted from files. Please review them | |
21 | before uploading to the archive. | |
22 | ||
23 | Files: debian/* | |
24 | Copyright: | |
25 | 2019 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> | |
26 | 2019 Nikos Tsipinakis <nikos@tsipinakis.com> | |
27 | License: MIT | |
28 | ||
29 | License: MIT | |
30 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
31 | of this software and associated documentation files (the "Software"), to deal | |
32 | in the Software without restriction, including without limitation the rights | |
33 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
34 | copies of the Software, and to permit persons to whom the Software is | |
35 | furnished to do so, subject to the following conditions: | |
36 | . | |
37 | The above copyright notice and this permission notice shall be included in all | |
38 | copies or substantial portions of the Software. | |
39 | . | |
40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
41 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
42 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
43 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
44 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
45 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
46 | SOFTWARE. |
0 | From 98edc0b98a3ce69f6c7e01e1baed4740153c4c38 Mon Sep 17 00:00:00 2001 | |
1 | From: Bastien Orivel <eijebong@bananium.fr> | |
2 | Date: Wed, 29 May 2019 00:37:41 +0200 | |
3 | Subject: [PATCH] Update winapi to 0.3 | |
4 | ||
5 | --- | |
6 | Cargo.toml | 3 +-- | |
7 | src/win32.rs | 25 ++++++++++++------------- | |
8 | 2 files changed, 13 insertions(+), 15 deletions(-) | |
9 | ||
10 | --- a/Cargo.toml | |
11 | +++ b/Cargo.toml | |
12 | @@ -28,11 +28,9 @@ | |
13 | ||
14 | [dependencies.regex] | |
15 | version = "1" | |
16 | -[target."cfg(windows)".dependencies.kernel32-sys] | |
17 | -version = "0.2.2" | |
18 | ||
19 | [target."cfg(windows)".dependencies.winapi] | |
20 | -version = "0.2.8" | |
21 | +version = "0.3" | |
22 | [badges.appveyor] | |
23 | repository = "rust-locale/locale_config" | |
24 | ||
25 | --- a/src/win32.rs | |
26 | +++ b/src/win32.rs | |
27 | @@ -1,23 +1,22 @@ | |
28 | extern crate winapi; | |
29 | -extern crate kernel32; | |
30 | ||
31 | use super::{LanguageRange,Locale}; | |
32 | ||
33 | use std::fmt::Write; | |
34 | ||
35 | -fn if_locale_info_differs<F: FnOnce(&str)>(lc_type: winapi::c_ulong, func: F) { | |
36 | +fn if_locale_info_differs<F: FnOnce(&str)>(lc_type: winapi::ctypes::c_ulong, func: F) { | |
37 | #[allow(non_snake_case)] // would be const if it wasn't for the fact const functions are still unstable | |
38 | let LOCALE_NAME_USER_DEFAULT: *mut u16 = ::std::ptr::null_mut(); | |
39 | - const LOCALE_NOUSEROVERRIDE: winapi::c_ulong = 0x80000000; | |
40 | + const LOCALE_NOUSEROVERRIDE: winapi::ctypes::c_ulong = 0x80000000; | |
41 | let mut buf_user = [0u16; 86]; | |
42 | let mut buf_def = [0u16; 86]; | |
43 | let len_user = unsafe { | |
44 | - kernel32::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, lc_type, | |
45 | - buf_user.as_mut_ptr(), buf_user.len() as winapi::c_long) | |
46 | + winapi::um::winnls::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, lc_type, | |
47 | + buf_user.as_mut_ptr(), buf_user.len() as winapi::ctypes::c_long) | |
48 | }; | |
49 | let len_def = unsafe { | |
50 | - kernel32::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, lc_type | LOCALE_NOUSEROVERRIDE, | |
51 | - buf_def.as_mut_ptr(), buf_user.len() as winapi::c_long) | |
52 | + winapi::um::winnls::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, lc_type | LOCALE_NOUSEROVERRIDE, | |
53 | + buf_def.as_mut_ptr(), buf_user.len() as winapi::ctypes::c_long) | |
54 | }; | |
55 | if buf_user[0..(len_user as usize - 1)] != buf_def[0..(len_def as usize - 1)] { | |
56 | let s = &*String::from_utf16_lossy(&buf_user[0..(len_user as usize - 1)]); | |
57 | @@ -27,7 +26,7 @@ | |
58 | ||
59 | #[allow(dead_code)] | |
60 | mod consts { | |
61 | - use super::winapi::c_ulong; | |
62 | + use super::winapi::ctypes::c_ulong; | |
63 | // Locale information types from winnls.h | |
64 | pub const LOCALE_ILANGUAGE: c_ulong = 0x0001; | |
65 | pub const LOCALE_SLANGUAGE: c_ulong = 0x0002; | |
66 | @@ -185,7 +184,7 @@ | |
67 | fn get_user_default_locale() -> super::Result<LanguageRange<'static>> { | |
68 | let mut buf = [0u16; 85]; | |
69 | let len = unsafe { | |
70 | - kernel32::GetUserDefaultLocaleName(buf.as_mut_ptr(), buf.len() as i32) | |
71 | + winapi::um::winnls::GetUserDefaultLocaleName(buf.as_mut_ptr(), buf.len() as i32) | |
72 | }; | |
73 | if len > 0 { | |
74 | let mut s = String::from_utf16_lossy(&buf[..(len as usize - 1)]); | |
75 | @@ -419,7 +418,7 @@ | |
76 | fn get_system_default_locale() -> super::Result<LanguageRange<'static>> { | |
77 | let mut buf = [0u16; 85]; | |
78 | let len = unsafe { | |
79 | - kernel32::GetSystemDefaultLocaleName(buf.as_mut_ptr(), buf.len() as i32) | |
80 | + winapi::um::winnls::GetSystemDefaultLocaleName(buf.as_mut_ptr(), buf.len() as i32) | |
81 | }; | |
82 | if len > 0 { | |
83 | let s = String::from_utf16_lossy(&buf[..(len as usize - 1)]); | |
84 | @@ -431,14 +430,14 @@ | |
85 | return Err(super::Error::NotWellFormed); | |
86 | } | |
87 | ||
88 | -const MUI_LANGUAGE_NAME: winapi::c_ulong = 0x8; // from winnls.h | |
89 | +const MUI_LANGUAGE_NAME: winapi::ctypes::c_ulong = 0x8; // from winnls.h | |
90 | ||
91 | fn get_user_preferred_languages() -> Vec<LanguageRange<'static>> { | |
92 | let mut buf = [0u16; 5 * 85 + 1]; | |
93 | let mut n_langs = 0; | |
94 | - let mut len = buf.len() as winapi::c_ulong; | |
95 | + let mut len = buf.len() as winapi::ctypes::c_ulong; | |
96 | let res = unsafe { | |
97 | - kernel32::GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &mut n_langs, buf.as_mut_ptr(), &mut len) | |
98 | + winapi::um::winnls::GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &mut n_langs, buf.as_mut_ptr(), &mut len) | |
99 | }; | |
100 | if res != 0 && len > 1 { | |
101 | let s = String::from_utf16_lossy(&buf[..(len as usize - 2)]); |
0 | --- a/Cargo.toml | |
1 | +++ b/Cargo.toml | |
2 | @@ -24,10 +24,10 @@ | |
3 | [package.metadata.release] | |
4 | upload-doc = true | |
5 | [dependencies.lazy_static] | |
6 | -version = "0.2" | |
7 | +version = "1" | |
8 | ||
9 | [dependencies.regex] | |
10 | -version = "0.2" | |
11 | +version = "1" | |
12 | [target."cfg(windows)".dependencies.kernel32-sys] | |
13 | version = "0.2.2" | |
14 |