From b74bcc9d76c25d6ae0f872f36f8c390dcd985bec Mon Sep 17 00:00:00 2001 From: emekoi Date: Wed, 5 Jun 2019 14:42:36 -0500 Subject: [PATCH 1/4] windows.unexpectedError prints a human friendly string --- std/os/windows.zig | 10 +- std/os/windows/bits.zig | 15 ++ std/os/windows/kernel32.zig | 4 + std/os/windows/lang.zig | 384 ++++++++++++++++++++++++++++++++++++ 4 files changed, 412 insertions(+), 1 deletion(-) create mode 100644 std/os/windows/lang.zig diff --git a/std/os/windows.zig b/std/os/windows.zig index 1d5900401..0757d9924 100644 --- a/std/os/windows.zig +++ b/std/os/windows.zig @@ -756,11 +756,19 @@ pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16) return result; } +inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID { + return (s << 10) | p; +} + /// Call this when you made a windows DLL call or something that does SetLastError /// and you get an unexpected error. pub fn unexpectedError(err: DWORD) std.os.UnexpectedError { if (std.os.unexpected_error_tracing) { - std.debug.warn("unexpected GetLastError(): {}\n", err); + var buf: LPSTR = undefined; + const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), buf, 0, null); + defer _ = kernel32.LocalFree(@ptrCast(HLOCAL, buf)); + std.debug.warn("error.Unexpected: {}: {}\n", err, buf[0..len]); + std.debug.dumpCurrentStackTrace(null); } return error.Unexpected; diff --git a/std/os/windows/bits.zig b/std/os/windows/bits.zig index 0bf299190..d05266c9f 100644 --- a/std/os/windows/bits.zig +++ b/std/os/windows/bits.zig @@ -6,6 +6,7 @@ const assert = std.debug.assert; const maxInt = std.math.maxInt; pub const ERROR = @import("error.zig"); +pub const LANG = @import("lang.zig"); /// The standard input device. Initially, this is the console input buffer, CONIN$. pub const STD_INPUT_HANDLE = maxInt(DWORD) - 10 + 1; @@ -55,6 +56,10 @@ pub const ULONG = u32; pub const LONG = i32; pub const ULONGLONG = u64; pub const LONGLONG = i64; +pub const HLOCAL = HANDLE; +pub const LANGID = c_ushort; + +pub const va_list = *@OpaqueType(); pub const TRUE = 1; pub const FALSE = 0; @@ -525,3 +530,13 @@ pub const COINIT = extern enum { /// > this expansion applies to the total length. /// from https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation pub const PATH_MAX_WIDE = 32767; + +pub const FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100; +pub const FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; +pub const FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; +pub const FORMAT_MESSAGE_FROM_STRING = 0x00000400; +pub const FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; +pub const FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; +pub const FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF; +pub const FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; +pub const FORMAT_MESSAGE_FROM_STRING = 0x00000400; diff --git a/std/os/windows/kernel32.zig b/std/os/windows/kernel32.zig index 852369df2..bee1b8254 100644 --- a/std/os/windows/kernel32.zig +++ b/std/os/windows/kernel32.zig @@ -50,6 +50,8 @@ pub extern "kernel32" stdcallcc fn FindFirstFileW(lpFileName: [*]const u16, lpFi pub extern "kernel32" stdcallcc fn FindClose(hFindFile: HANDLE) BOOL; pub extern "kernel32" stdcallcc fn FindNextFileW(hFindFile: HANDLE, lpFindFileData: *WIN32_FIND_DATAW) BOOL; +pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; + pub extern "kernel32" stdcallcc fn FreeEnvironmentStringsW(penv: [*]u16) BOOL; pub extern "kernel32" stdcallcc fn GetCommandLineA() LPSTR; @@ -116,6 +118,8 @@ pub extern "kernel32" stdcallcc fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem pub extern "kernel32" stdcallcc fn HeapValidate(hHeap: HANDLE, dwFlags: DWORD, lpMem: ?*const c_void) BOOL; +pub extern "kernel32" stdcallcc fn LocalFree(hMem: HLOCAL) ?HLOCAL; + pub extern "kernel32" stdcallcc fn VirtualAlloc(lpAddress: ?LPVOID, dwSize: SIZE_T, flAllocationType: DWORD, flProtect: DWORD) ?LPVOID; pub extern "kernel32" stdcallcc fn VirtualFree(lpAddress: ?LPVOID, dwSize: SIZE_T, dwFreeType: DWORD) BOOL; diff --git a/std/os/windows/lang.zig b/std/os/windows/lang.zig new file mode 100644 index 000000000..7e6e2d1a7 --- /dev/null +++ b/std/os/windows/lang.zig @@ -0,0 +1,384 @@ +pub const LANG_NEUTRAL = 0x00; +pub const LANG_INVARIANT = 0x7f; +pub const LANG_AFRIKAANS = 0x36; +pub const LANG_ALBANIAN = 0x1c; +pub const LANG_ALSATIAN = 0x84; +pub const LANG_AMHARIC = 0x5e; +pub const LANG_ARABIC = 0x01; +pub const LANG_ARMENIAN = 0x2b; +pub const LANG_ASSAMESE = 0x4d; +pub const LANG_AZERI = 0x2c; +pub const LANG_AZERBAIJANI = 0x2c; +pub const LANG_BANGLA = 0x45; +pub const LANG_BASHKIR = 0x6d; +pub const LANG_BASQUE = 0x2d; +pub const LANG_BELARUSIAN = 0x23; +pub const LANG_BENGALI = 0x45; +pub const LANG_BRETON = 0x7e; +pub const LANG_BOSNIAN = 0x1a; +pub const LANG_BOSNIAN_NEUTRAL = 0x781a; +pub const LANG_BULGARIAN = 0x02; +pub const LANG_CATALAN = 0x03; +pub const LANG_CENTRAL_KURDISH = 0x92; +pub const LANG_CHEROKEE = 0x5c; +pub const LANG_CHINESE = 0x04; +pub const LANG_CHINESE_SIMPLIFIED = 0x04; +pub const LANG_CHINESE_TRADITIONAL = 0x7c04; +pub const LANG_CORSICAN = 0x83; +pub const LANG_CROATIAN = 0x1a; +pub const LANG_CZECH = 0x05; +pub const LANG_DANISH = 0x06; +pub const LANG_DARI = 0x8c; +pub const LANG_DIVEHI = 0x65; +pub const LANG_DUTCH = 0x13; +pub const LANG_ENGLISH = 0x09; +pub const LANG_ESTONIAN = 0x25; +pub const LANG_FAEROESE = 0x38; +pub const LANG_FARSI = 0x29; +pub const LANG_FILIPINO = 0x64; +pub const LANG_FINNISH = 0x0b; +pub const LANG_FRENCH = 0x0c; +pub const LANG_FRISIAN = 0x62; +pub const LANG_FULAH = 0x67; +pub const LANG_GALICIAN = 0x56; +pub const LANG_GEORGIAN = 0x37; +pub const LANG_GERMAN = 0x07; +pub const LANG_GREEK = 0x08; +pub const LANG_GREENLANDIC = 0x6f; +pub const LANG_GUJARATI = 0x47; +pub const LANG_HAUSA = 0x68; +pub const LANG_HAWAIIAN = 0x75; +pub const LANG_HEBREW = 0x0d; +pub const LANG_HINDI = 0x39; +pub const LANG_HUNGARIAN = 0x0e; +pub const LANG_ICELANDIC = 0x0f; +pub const LANG_IGBO = 0x70; +pub const LANG_INDONESIAN = 0x21; +pub const LANG_INUKTITUT = 0x5d; +pub const LANG_IRISH = 0x3c; +pub const LANG_ITALIAN = 0x10; +pub const LANG_JAPANESE = 0x11; +pub const LANG_KANNADA = 0x4b; +pub const LANG_KASHMIRI = 0x60; +pub const LANG_KAZAK = 0x3f; +pub const LANG_KHMER = 0x53; +pub const LANG_KICHE = 0x86; +pub const LANG_KINYARWANDA = 0x87; +pub const LANG_KONKANI = 0x57; +pub const LANG_KOREAN = 0x12; +pub const LANG_KYRGYZ = 0x40; +pub const LANG_LAO = 0x54; +pub const LANG_LATVIAN = 0x26; +pub const LANG_LITHUANIAN = 0x27; +pub const LANG_LOWER_SORBIAN = 0x2e; +pub const LANG_LUXEMBOURGISH = 0x6e; +pub const LANG_MACEDONIAN = 0x2f; +pub const LANG_MALAY = 0x3e; +pub const LANG_MALAYALAM = 0x4c; +pub const LANG_MALTESE = 0x3a; +pub const LANG_MANIPURI = 0x58; +pub const LANG_MAORI = 0x81; +pub const LANG_MAPUDUNGUN = 0x7a; +pub const LANG_MARATHI = 0x4e; +pub const LANG_MOHAWK = 0x7c; +pub const LANG_MONGOLIAN = 0x50; +pub const LANG_NEPALI = 0x61; +pub const LANG_NORWEGIAN = 0x14; +pub const LANG_OCCITAN = 0x82; +pub const LANG_ODIA = 0x48; +pub const LANG_ORIYA = 0x48; +pub const LANG_PASHTO = 0x63; +pub const LANG_PERSIAN = 0x29; +pub const LANG_POLISH = 0x15; +pub const LANG_PORTUGUESE = 0x16; +pub const LANG_PULAR = 0x67; +pub const LANG_PUNJABI = 0x46; +pub const LANG_QUECHUA = 0x6b; +pub const LANG_ROMANIAN = 0x18; +pub const LANG_ROMANSH = 0x17; +pub const LANG_RUSSIAN = 0x19; +pub const LANG_SAKHA = 0x85; +pub const LANG_SAMI = 0x3b; +pub const LANG_SANSKRIT = 0x4f; +pub const LANG_SCOTTISH_GAELIC = 0x91; +pub const LANG_SERBIAN = 0x1a; +pub const LANG_SERBIAN_NEUTRAL = 0x7c1a; +pub const LANG_SINDHI = 0x59; +pub const LANG_SINHALESE = 0x5b; +pub const LANG_SLOVAK = 0x1b; +pub const LANG_SLOVENIAN = 0x24; +pub const LANG_SOTHO = 0x6c; +pub const LANG_SPANISH = 0x0a; +pub const LANG_SWAHILI = 0x41; +pub const LANG_SWEDISH = 0x1d; +pub const LANG_SYRIAC = 0x5a; +pub const LANG_TAJIK = 0x28; +pub const LANG_TAMAZIGHT = 0x5f; +pub const LANG_TAMIL = 0x49; +pub const LANG_TATAR = 0x44; +pub const LANG_TELUGU = 0x4a; +pub const LANG_THAI = 0x1e; +pub const LANG_TIBETAN = 0x51; +pub const LANG_TIGRIGNA = 0x73; +pub const LANG_TIGRINYA = 0x73; +pub const LANG_TSWANA = 0x32; +pub const LANG_TURKISH = 0x1f; +pub const LANG_TURKMEN = 0x42; +pub const LANG_UIGHUR = 0x80; +pub const LANG_UKRAINIAN = 0x22; +pub const LANG_UPPER_SORBIAN = 0x2e; +pub const LANG_URDU = 0x20; +pub const LANG_UZBEK = 0x43; +pub const LANG_VALENCIAN = 0x03; +pub const LANG_VIETNAMESE = 0x2a; +pub const LANG_WELSH = 0x52; +pub const LANG_WOLOF = 0x88; +pub const LANG_XHOSA = 0x34; +pub const LANG_YAKUT = 0x85; +pub const LANG_YI = 0x78; +pub const LANG_YORUBA = 0x6a; +pub const LANG_ZULU = 0x35; +pub const SUBLANG_NEUTRAL = 0x00; +pub const SUBLANG_DEFAULT = 0x01; +pub const SUBLANG_SYS_DEFAULT = 0x02; +pub const SUBLANG_CUSTOM_DEFAULT = 0x03; +pub const SUBLANG_CUSTOM_UNSPECIFIED = 0x04; +pub const SUBLANG_UI_CUSTOM_DEFAULT = 0x05; +pub const SUBLANG_AFRIKAANS_SOUTH_AFRICA = 0x01; +pub const SUBLANG_ALBANIAN_ALBANIA = 0x01; +pub const SUBLANG_ALSATIAN_FRANCE = 0x01; +pub const SUBLANG_AMHARIC_ETHIOPIA = 0x01; +pub const SUBLANG_ARABIC_SAUDI_ARABIA = 0x01; +pub const SUBLANG_ARABIC_IRAQ = 0x02; +pub const SUBLANG_ARABIC_EGYPT = 0x03; +pub const SUBLANG_ARABIC_LIBYA = 0x04; +pub const SUBLANG_ARABIC_ALGERIA = 0x05; +pub const SUBLANG_ARABIC_MOROCCO = 0x06; +pub const SUBLANG_ARABIC_TUNISIA = 0x07; +pub const SUBLANG_ARABIC_OMAN = 0x08; +pub const SUBLANG_ARABIC_YEMEN = 0x09; +pub const SUBLANG_ARABIC_SYRIA = 0x0a; +pub const SUBLANG_ARABIC_JORDAN = 0x0b; +pub const SUBLANG_ARABIC_LEBANON = 0x0c; +pub const SUBLANG_ARABIC_KUWAIT = 0x0d; +pub const SUBLANG_ARABIC_UAE = 0x0e; +pub const SUBLANG_ARABIC_BAHRAIN = 0x0f; +pub const SUBLANG_ARABIC_QATAR = 0x10; +pub const SUBLANG_ARMENIAN_ARMENIA = 0x01; +pub const SUBLANG_ASSAMESE_INDIA = 0x01; +pub const SUBLANG_AZERI_LATIN = 0x01; +pub const SUBLANG_AZERI_CYRILLIC = 0x02; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN = 0x01; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC = 0x02; +pub const SUBLANG_BANGLA_INDIA = 0x01; +pub const SUBLANG_BANGLA_BANGLADESH = 0x02; +pub const SUBLANG_BASHKIR_RUSSIA = 0x01; +pub const SUBLANG_BASQUE_BASQUE = 0x01; +pub const SUBLANG_BELARUSIAN_BELARUS = 0x01; +pub const SUBLANG_BENGALI_INDIA = 0x01; +pub const SUBLANG_BENGALI_BANGLADESH = 0x02; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = 0x05; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x08; +pub const SUBLANG_BRETON_FRANCE = 0x01; +pub const SUBLANG_BULGARIAN_BULGARIA = 0x01; +pub const SUBLANG_CATALAN_CATALAN = 0x01; +pub const SUBLANG_CENTRAL_KURDISH_IRAQ = 0x01; +pub const SUBLANG_CHEROKEE_CHEROKEE = 0x01; +pub const SUBLANG_CHINESE_TRADITIONAL = 0x01; +pub const SUBLANG_CHINESE_SIMPLIFIED = 0x02; +pub const SUBLANG_CHINESE_HONGKONG = 0x03; +pub const SUBLANG_CHINESE_SINGAPORE = 0x04; +pub const SUBLANG_CHINESE_MACAU = 0x05; +pub const SUBLANG_CORSICAN_FRANCE = 0x01; +pub const SUBLANG_CZECH_CZECH_REPUBLIC = 0x01; +pub const SUBLANG_CROATIAN_CROATIA = 0x01; +pub const SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN = 0x04; +pub const SUBLANG_DANISH_DENMARK = 0x01; +pub const SUBLANG_DARI_AFGHANISTAN = 0x01; +pub const SUBLANG_DIVEHI_MALDIVES = 0x01; +pub const SUBLANG_DUTCH = 0x01; +pub const SUBLANG_DUTCH_BELGIAN = 0x02; +pub const SUBLANG_ENGLISH_US = 0x01; +pub const SUBLANG_ENGLISH_UK = 0x02; +pub const SUBLANG_ENGLISH_AUS = 0x03; +pub const SUBLANG_ENGLISH_CAN = 0x04; +pub const SUBLANG_ENGLISH_NZ = 0x05; +pub const SUBLANG_ENGLISH_EIRE = 0x06; +pub const SUBLANG_ENGLISH_SOUTH_AFRICA = 0x07; +pub const SUBLANG_ENGLISH_JAMAICA = 0x08; +pub const SUBLANG_ENGLISH_CARIBBEAN = 0x09; +pub const SUBLANG_ENGLISH_BELIZE = 0x0a; +pub const SUBLANG_ENGLISH_TRINIDAD = 0x0b; +pub const SUBLANG_ENGLISH_ZIMBABWE = 0x0c; +pub const SUBLANG_ENGLISH_PHILIPPINES = 0x0d; +pub const SUBLANG_ENGLISH_INDIA = 0x10; +pub const SUBLANG_ENGLISH_MALAYSIA = 0x11; +pub const SUBLANG_ENGLISH_SINGAPORE = 0x12; +pub const SUBLANG_ESTONIAN_ESTONIA = 0x01; +pub const SUBLANG_FAEROESE_FAROE_ISLANDS = 0x01; +pub const SUBLANG_FILIPINO_PHILIPPINES = 0x01; +pub const SUBLANG_FINNISH_FINLAND = 0x01; +pub const SUBLANG_FRENCH = 0x01; +pub const SUBLANG_FRENCH_BELGIAN = 0x02; +pub const SUBLANG_FRENCH_CANADIAN = 0x03; +pub const SUBLANG_FRENCH_SWISS = 0x04; +pub const SUBLANG_FRENCH_LUXEMBOURG = 0x05; +pub const SUBLANG_FRENCH_MONACO = 0x06; +pub const SUBLANG_FRISIAN_NETHERLANDS = 0x01; +pub const SUBLANG_FULAH_SENEGAL = 0x02; +pub const SUBLANG_GALICIAN_GALICIAN = 0x01; +pub const SUBLANG_GEORGIAN_GEORGIA = 0x01; +pub const SUBLANG_GERMAN = 0x01; +pub const SUBLANG_GERMAN_SWISS = 0x02; +pub const SUBLANG_GERMAN_AUSTRIAN = 0x03; +pub const SUBLANG_GERMAN_LUXEMBOURG = 0x04; +pub const SUBLANG_GERMAN_LIECHTENSTEIN = 0x05; +pub const SUBLANG_GREEK_GREECE = 0x01; +pub const SUBLANG_GREENLANDIC_GREENLAND = 0x01; +pub const SUBLANG_GUJARATI_INDIA = 0x01; +pub const SUBLANG_HAUSA_NIGERIA_LATIN = 0x01; +pub const SUBLANG_HAWAIIAN_US = 0x01; +pub const SUBLANG_HEBREW_ISRAEL = 0x01; +pub const SUBLANG_HINDI_INDIA = 0x01; +pub const SUBLANG_HUNGARIAN_HUNGARY = 0x01; +pub const SUBLANG_ICELANDIC_ICELAND = 0x01; +pub const SUBLANG_IGBO_NIGERIA = 0x01; +pub const SUBLANG_INDONESIAN_INDONESIA = 0x01; +pub const SUBLANG_INUKTITUT_CANADA = 0x01; +pub const SUBLANG_INUKTITUT_CANADA_LATIN = 0x02; +pub const SUBLANG_IRISH_IRELAND = 0x02; +pub const SUBLANG_ITALIAN = 0x01; +pub const SUBLANG_ITALIAN_SWISS = 0x02; +pub const SUBLANG_JAPANESE_JAPAN = 0x01; +pub const SUBLANG_KANNADA_INDIA = 0x01; +pub const SUBLANG_KASHMIRI_SASIA = 0x02; +pub const SUBLANG_KASHMIRI_INDIA = 0x02; +pub const SUBLANG_KAZAK_KAZAKHSTAN = 0x01; +pub const SUBLANG_KHMER_CAMBODIA = 0x01; +pub const SUBLANG_KICHE_GUATEMALA = 0x01; +pub const SUBLANG_KINYARWANDA_RWANDA = 0x01; +pub const SUBLANG_KONKANI_INDIA = 0x01; +pub const SUBLANG_KOREAN = 0x01; +pub const SUBLANG_KYRGYZ_KYRGYZSTAN = 0x01; +pub const SUBLANG_LAO_LAO = 0x01; +pub const SUBLANG_LATVIAN_LATVIA = 0x01; +pub const SUBLANG_LITHUANIAN = 0x01; +pub const SUBLANG_LOWER_SORBIAN_GERMANY = 0x02; +pub const SUBLANG_LUXEMBOURGISH_LUXEMBOURG = 0x01; +pub const SUBLANG_MACEDONIAN_MACEDONIA = 0x01; +pub const SUBLANG_MALAY_MALAYSIA = 0x01; +pub const SUBLANG_MALAY_BRUNEI_DARUSSALAM = 0x02; +pub const SUBLANG_MALAYALAM_INDIA = 0x01; +pub const SUBLANG_MALTESE_MALTA = 0x01; +pub const SUBLANG_MAORI_NEW_ZEALAND = 0x01; +pub const SUBLANG_MAPUDUNGUN_CHILE = 0x01; +pub const SUBLANG_MARATHI_INDIA = 0x01; +pub const SUBLANG_MOHAWK_MOHAWK = 0x01; +pub const SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA = 0x01; +pub const SUBLANG_MONGOLIAN_PRC = 0x02; +pub const SUBLANG_NEPALI_INDIA = 0x02; +pub const SUBLANG_NEPALI_NEPAL = 0x01; +pub const SUBLANG_NORWEGIAN_BOKMAL = 0x01; +pub const SUBLANG_NORWEGIAN_NYNORSK = 0x02; +pub const SUBLANG_OCCITAN_FRANCE = 0x01; +pub const SUBLANG_ODIA_INDIA = 0x01; +pub const SUBLANG_ORIYA_INDIA = 0x01; +pub const SUBLANG_PASHTO_AFGHANISTAN = 0x01; +pub const SUBLANG_PERSIAN_IRAN = 0x01; +pub const SUBLANG_POLISH_POLAND = 0x01; +pub const SUBLANG_PORTUGUESE = 0x02; +pub const SUBLANG_PORTUGUESE_BRAZILIAN = 0x01; +pub const SUBLANG_PULAR_SENEGAL = 0x02; +pub const SUBLANG_PUNJABI_INDIA = 0x01; +pub const SUBLANG_PUNJABI_PAKISTAN = 0x02; +pub const SUBLANG_QUECHUA_BOLIVIA = 0x01; +pub const SUBLANG_QUECHUA_ECUADOR = 0x02; +pub const SUBLANG_QUECHUA_PERU = 0x03; +pub const SUBLANG_ROMANIAN_ROMANIA = 0x01; +pub const SUBLANG_ROMANSH_SWITZERLAND = 0x01; +pub const SUBLANG_RUSSIAN_RUSSIA = 0x01; +pub const SUBLANG_SAKHA_RUSSIA = 0x01; +pub const SUBLANG_SAMI_NORTHERN_NORWAY = 0x01; +pub const SUBLANG_SAMI_NORTHERN_SWEDEN = 0x02; +pub const SUBLANG_SAMI_NORTHERN_FINLAND = 0x03; +pub const SUBLANG_SAMI_LULE_NORWAY = 0x04; +pub const SUBLANG_SAMI_LULE_SWEDEN = 0x05; +pub const SUBLANG_SAMI_SOUTHERN_NORWAY = 0x06; +pub const SUBLANG_SAMI_SOUTHERN_SWEDEN = 0x07; +pub const SUBLANG_SAMI_SKOLT_FINLAND = 0x08; +pub const SUBLANG_SAMI_INARI_FINLAND = 0x09; +pub const SUBLANG_SANSKRIT_INDIA = 0x01; +pub const SUBLANG_SCOTTISH_GAELIC = 0x01; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN = 0x06; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x07; +pub const SUBLANG_SERBIAN_MONTENEGRO_LATIN = 0x0b; +pub const SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC = 0x0c; +pub const SUBLANG_SERBIAN_SERBIA_LATIN = 0x09; +pub const SUBLANG_SERBIAN_SERBIA_CYRILLIC = 0x0a; +pub const SUBLANG_SERBIAN_CROATIA = 0x01; +pub const SUBLANG_SERBIAN_LATIN = 0x02; +pub const SUBLANG_SERBIAN_CYRILLIC = 0x03; +pub const SUBLANG_SINDHI_INDIA = 0x01; +pub const SUBLANG_SINDHI_PAKISTAN = 0x02; +pub const SUBLANG_SINDHI_AFGHANISTAN = 0x02; +pub const SUBLANG_SINHALESE_SRI_LANKA = 0x01; +pub const SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA = 0x01; +pub const SUBLANG_SLOVAK_SLOVAKIA = 0x01; +pub const SUBLANG_SLOVENIAN_SLOVENIA = 0x01; +pub const SUBLANG_SPANISH = 0x01; +pub const SUBLANG_SPANISH_MEXICAN = 0x02; +pub const SUBLANG_SPANISH_MODERN = 0x03; +pub const SUBLANG_SPANISH_GUATEMALA = 0x04; +pub const SUBLANG_SPANISH_COSTA_RICA = 0x05; +pub const SUBLANG_SPANISH_PANAMA = 0x06; +pub const SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 0x07; +pub const SUBLANG_SPANISH_VENEZUELA = 0x08; +pub const SUBLANG_SPANISH_COLOMBIA = 0x09; +pub const SUBLANG_SPANISH_PERU = 0x0a; +pub const SUBLANG_SPANISH_ARGENTINA = 0x0b; +pub const SUBLANG_SPANISH_ECUADOR = 0x0c; +pub const SUBLANG_SPANISH_CHILE = 0x0d; +pub const SUBLANG_SPANISH_URUGUAY = 0x0e; +pub const SUBLANG_SPANISH_PARAGUAY = 0x0f; +pub const SUBLANG_SPANISH_BOLIVIA = 0x10; +pub const SUBLANG_SPANISH_EL_SALVADOR = 0x11; +pub const SUBLANG_SPANISH_HONDURAS = 0x12; +pub const SUBLANG_SPANISH_NICARAGUA = 0x13; +pub const SUBLANG_SPANISH_PUERTO_RICO = 0x14; +pub const SUBLANG_SPANISH_US = 0x15; +pub const SUBLANG_SWAHILI_KENYA = 0x01; +pub const SUBLANG_SWEDISH = 0x01; +pub const SUBLANG_SWEDISH_FINLAND = 0x02; +pub const SUBLANG_SYRIAC_SYRIA = 0x01; +pub const SUBLANG_TAJIK_TAJIKISTAN = 0x01; +pub const SUBLANG_TAMAZIGHT_ALGERIA_LATIN = 0x02; +pub const SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH = 0x04; +pub const SUBLANG_TAMIL_INDIA = 0x01; +pub const SUBLANG_TAMIL_SRI_LANKA = 0x02; +pub const SUBLANG_TATAR_RUSSIA = 0x01; +pub const SUBLANG_TELUGU_INDIA = 0x01; +pub const SUBLANG_THAI_THAILAND = 0x01; +pub const SUBLANG_TIBETAN_PRC = 0x01; +pub const SUBLANG_TIGRIGNA_ERITREA = 0x02; +pub const SUBLANG_TIGRINYA_ERITREA = 0x02; +pub const SUBLANG_TIGRINYA_ETHIOPIA = 0x01; +pub const SUBLANG_TSWANA_BOTSWANA = 0x02; +pub const SUBLANG_TSWANA_SOUTH_AFRICA = 0x01; +pub const SUBLANG_TURKISH_TURKEY = 0x01; +pub const SUBLANG_TURKMEN_TURKMENISTAN = 0x01; +pub const SUBLANG_UIGHUR_PRC = 0x01; +pub const SUBLANG_UKRAINIAN_UKRAINE = 0x01; +pub const SUBLANG_UPPER_SORBIAN_GERMANY = 0x01; +pub const SUBLANG_URDU_PAKISTAN = 0x01; +pub const SUBLANG_URDU_INDIA = 0x02; +pub const SUBLANG_UZBEK_LATIN = 0x01; +pub const SUBLANG_UZBEK_CYRILLIC = 0x02; +pub const SUBLANG_VALENCIAN_VALENCIA = 0x02; +pub const SUBLANG_VIETNAMESE_VIETNAM = 0x01; +pub const SUBLANG_WELSH_UNITED_KINGDOM = 0x01; +pub const SUBLANG_WOLOF_SENEGAL = 0x01; +pub const SUBLANG_XHOSA_SOUTH_AFRICA = 0x01; +pub const SUBLANG_YAKUT_RUSSIA = 0x01; +pub const SUBLANG_YI_PRC = 0x01; +pub const SUBLANG_YORUBA_NIGERIA = 0x01; +pub const SUBLANG_ZULU_SOUTH_AFRICA = 0x01; From 0aabfb09f9a33f7199e53996a0baa9b5eb8b1e50 Mon Sep 17 00:00:00 2001 From: emekoi Date: Wed, 5 Jun 2019 14:57:20 -0500 Subject: [PATCH 2/4] removed duplicate definitions --- std/os/windows/bits.zig | 2 -- 1 file changed, 2 deletions(-) diff --git a/std/os/windows/bits.zig b/std/os/windows/bits.zig index d05266c9f..b463ef4c6 100644 --- a/std/os/windows/bits.zig +++ b/std/os/windows/bits.zig @@ -538,5 +538,3 @@ pub const FORMAT_MESSAGE_FROM_STRING = 0x00000400; pub const FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; pub const FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; pub const FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF; -pub const FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; -pub const FORMAT_MESSAGE_FROM_STRING = 0x00000400; From 0288034c2f2d158970cd481e1810a2301ab0b50a Mon Sep 17 00:00:00 2001 From: emekoi Date: Wed, 5 Jun 2019 15:30:01 -0500 Subject: [PATCH 3/4] fixed mismatched types --- CMakeLists.txt | 1 + std/os/windows.zig | 4 ++-- std/os/windows/kernel32.zig | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ff4cebf4..206e2ccf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -630,6 +630,7 @@ set(ZIG_STD_FILES "os/windows/bits.zig" "os/windows/error.zig" "os/windows/kernel32.zig" + "os/windows/lang.zig" "os/windows/ntdll.zig" "os/windows/ole32.zig" "os/windows/shell32.zig" diff --git a/std/os/windows.zig b/std/os/windows.zig index 0757d9924..4d5dda014 100644 --- a/std/os/windows.zig +++ b/std/os/windows.zig @@ -756,7 +756,7 @@ pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16) return result; } -inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID { +inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID { return (s << 10) | p; } @@ -765,7 +765,7 @@ inline fn MAKELANGID(p: USHORT, s: USHORT) LANGID { pub fn unexpectedError(err: DWORD) std.os.UnexpectedError { if (std.os.unexpected_error_tracing) { var buf: LPSTR = undefined; - const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), buf, 0, null); + const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), @ptrCast(LPSTR, &buf), 0, null); defer _ = kernel32.LocalFree(@ptrCast(HLOCAL, buf)); std.debug.warn("error.Unexpected: {}: {}\n", err, buf[0..len]); diff --git a/std/os/windows/kernel32.zig b/std/os/windows/kernel32.zig index bee1b8254..fb1cff00f 100644 --- a/std/os/windows/kernel32.zig +++ b/std/os/windows/kernel32.zig @@ -50,7 +50,7 @@ pub extern "kernel32" stdcallcc fn FindFirstFileW(lpFileName: [*]const u16, lpFi pub extern "kernel32" stdcallcc fn FindClose(hFindFile: HANDLE) BOOL; pub extern "kernel32" stdcallcc fn FindNextFileW(hFindFile: HANDLE, lpFindFileData: *WIN32_FIND_DATAW) BOOL; -pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; +pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: ?LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; pub extern "kernel32" stdcallcc fn FreeEnvironmentStringsW(penv: [*]u16) BOOL; From 26613bfa011ec63b1f3a141e0201223853cc04e6 Mon Sep 17 00:00:00 2001 From: emekoi Date: Wed, 5 Jun 2019 17:18:56 -0500 Subject: [PATCH 4/4] switched to fixed-length buffer for error messages --- CMakeLists.txt | 1 + std/os/windows.zig | 14 +- std/os/windows/bits.zig | 1 + std/os/windows/kernel32.zig | 4 +- std/os/windows/lang.zig | 524 ++++++++++-------------------------- std/os/windows/sublang.zig | 244 +++++++++++++++++ 6 files changed, 396 insertions(+), 392 deletions(-) create mode 100644 std/os/windows/sublang.zig diff --git a/CMakeLists.txt b/CMakeLists.txt index 206e2ccf9..d77b6f09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -634,6 +634,7 @@ set(ZIG_STD_FILES "os/windows/ntdll.zig" "os/windows/ole32.zig" "os/windows/shell32.zig" + "os/windows/sublang.zig" "os/zen.zig" "packed_int_array.zig" "pdb.zig" diff --git a/std/os/windows.zig b/std/os/windows.zig index 4d5dda014..1b25f59a5 100644 --- a/std/os/windows.zig +++ b/std/os/windows.zig @@ -764,11 +764,15 @@ inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID { /// and you get an unexpected error. pub fn unexpectedError(err: DWORD) std.os.UnexpectedError { if (std.os.unexpected_error_tracing) { - var buf: LPSTR = undefined; - const len = kernel32.FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, null, err, MAKELANGID(LANG.LANG_NEUTRAL, LANG.SUBLANG_DEFAULT), @ptrCast(LPSTR, &buf), 0, null); - defer _ = kernel32.LocalFree(@ptrCast(HLOCAL, buf)); - std.debug.warn("error.Unexpected: {}: {}\n", err, buf[0..len]); - + // 614 is the length of the longest windows error desciption + var buf_u16: [614]u16 = undefined; + var buf_u8: [614]u8 = undefined; + var len = kernel32.FormatMessageW( + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + null, err, MAKELANGID(LANG.NEUTRAL, SUBLANG.DEFAULT), + buf_u16[0..].ptr, buf_u16.len / @sizeOf(TCHAR), null); + _ = std.unicode.utf16leToUtf8(&buf_u8, buf_u16[0..len]) catch unreachable; + std.debug.warn("error.Unexpected: GetLastError({}): {}\n", err, buf_u8[0..len]); std.debug.dumpCurrentStackTrace(null); } return error.Unexpected; diff --git a/std/os/windows/bits.zig b/std/os/windows/bits.zig index b463ef4c6..c99f3ae46 100644 --- a/std/os/windows/bits.zig +++ b/std/os/windows/bits.zig @@ -7,6 +7,7 @@ const maxInt = std.math.maxInt; pub const ERROR = @import("error.zig"); pub const LANG = @import("lang.zig"); +pub const SUBLANG = @import("sublang.zig"); /// The standard input device. Initially, this is the console input buffer, CONIN$. pub const STD_INPUT_HANDLE = maxInt(DWORD) - 10 + 1; diff --git a/std/os/windows/kernel32.zig b/std/os/windows/kernel32.zig index fb1cff00f..27516342a 100644 --- a/std/os/windows/kernel32.zig +++ b/std/os/windows/kernel32.zig @@ -50,7 +50,7 @@ pub extern "kernel32" stdcallcc fn FindFirstFileW(lpFileName: [*]const u16, lpFi pub extern "kernel32" stdcallcc fn FindClose(hFindFile: HANDLE) BOOL; pub extern "kernel32" stdcallcc fn FindNextFileW(hFindFile: HANDLE, lpFindFileData: *WIN32_FIND_DATAW) BOOL; -pub extern "kernel32" stdcallcc fn FormatMessageA(dwFlags: DWORD, lpSource: ?LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; +pub extern "kernel32" stdcallcc fn FormatMessageW(dwFlags: DWORD, lpSource: ?LPVOID, dwMessageId: DWORD, dwLanguageId: DWORD, lpBuffer: LPWSTR, nSize: DWORD, Arguments: ?*va_list) DWORD; pub extern "kernel32" stdcallcc fn FreeEnvironmentStringsW(penv: [*]u16) BOOL; @@ -118,8 +118,6 @@ pub extern "kernel32" stdcallcc fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem pub extern "kernel32" stdcallcc fn HeapValidate(hHeap: HANDLE, dwFlags: DWORD, lpMem: ?*const c_void) BOOL; -pub extern "kernel32" stdcallcc fn LocalFree(hMem: HLOCAL) ?HLOCAL; - pub extern "kernel32" stdcallcc fn VirtualAlloc(lpAddress: ?LPVOID, dwSize: SIZE_T, flAllocationType: DWORD, flProtect: DWORD) ?LPVOID; pub extern "kernel32" stdcallcc fn VirtualFree(lpAddress: ?LPVOID, dwSize: SIZE_T, dwFreeType: DWORD) BOOL; diff --git a/std/os/windows/lang.zig b/std/os/windows/lang.zig index 7e6e2d1a7..b173a62a7 100644 --- a/std/os/windows/lang.zig +++ b/std/os/windows/lang.zig @@ -1,384 +1,140 @@ -pub const LANG_NEUTRAL = 0x00; -pub const LANG_INVARIANT = 0x7f; -pub const LANG_AFRIKAANS = 0x36; -pub const LANG_ALBANIAN = 0x1c; -pub const LANG_ALSATIAN = 0x84; -pub const LANG_AMHARIC = 0x5e; -pub const LANG_ARABIC = 0x01; -pub const LANG_ARMENIAN = 0x2b; -pub const LANG_ASSAMESE = 0x4d; -pub const LANG_AZERI = 0x2c; -pub const LANG_AZERBAIJANI = 0x2c; -pub const LANG_BANGLA = 0x45; -pub const LANG_BASHKIR = 0x6d; -pub const LANG_BASQUE = 0x2d; -pub const LANG_BELARUSIAN = 0x23; -pub const LANG_BENGALI = 0x45; -pub const LANG_BRETON = 0x7e; -pub const LANG_BOSNIAN = 0x1a; -pub const LANG_BOSNIAN_NEUTRAL = 0x781a; -pub const LANG_BULGARIAN = 0x02; -pub const LANG_CATALAN = 0x03; -pub const LANG_CENTRAL_KURDISH = 0x92; -pub const LANG_CHEROKEE = 0x5c; -pub const LANG_CHINESE = 0x04; -pub const LANG_CHINESE_SIMPLIFIED = 0x04; -pub const LANG_CHINESE_TRADITIONAL = 0x7c04; -pub const LANG_CORSICAN = 0x83; -pub const LANG_CROATIAN = 0x1a; -pub const LANG_CZECH = 0x05; -pub const LANG_DANISH = 0x06; -pub const LANG_DARI = 0x8c; -pub const LANG_DIVEHI = 0x65; -pub const LANG_DUTCH = 0x13; -pub const LANG_ENGLISH = 0x09; -pub const LANG_ESTONIAN = 0x25; -pub const LANG_FAEROESE = 0x38; -pub const LANG_FARSI = 0x29; -pub const LANG_FILIPINO = 0x64; -pub const LANG_FINNISH = 0x0b; -pub const LANG_FRENCH = 0x0c; -pub const LANG_FRISIAN = 0x62; -pub const LANG_FULAH = 0x67; -pub const LANG_GALICIAN = 0x56; -pub const LANG_GEORGIAN = 0x37; -pub const LANG_GERMAN = 0x07; -pub const LANG_GREEK = 0x08; -pub const LANG_GREENLANDIC = 0x6f; -pub const LANG_GUJARATI = 0x47; -pub const LANG_HAUSA = 0x68; -pub const LANG_HAWAIIAN = 0x75; -pub const LANG_HEBREW = 0x0d; -pub const LANG_HINDI = 0x39; -pub const LANG_HUNGARIAN = 0x0e; -pub const LANG_ICELANDIC = 0x0f; -pub const LANG_IGBO = 0x70; -pub const LANG_INDONESIAN = 0x21; -pub const LANG_INUKTITUT = 0x5d; -pub const LANG_IRISH = 0x3c; -pub const LANG_ITALIAN = 0x10; -pub const LANG_JAPANESE = 0x11; -pub const LANG_KANNADA = 0x4b; -pub const LANG_KASHMIRI = 0x60; -pub const LANG_KAZAK = 0x3f; -pub const LANG_KHMER = 0x53; -pub const LANG_KICHE = 0x86; -pub const LANG_KINYARWANDA = 0x87; -pub const LANG_KONKANI = 0x57; -pub const LANG_KOREAN = 0x12; -pub const LANG_KYRGYZ = 0x40; -pub const LANG_LAO = 0x54; -pub const LANG_LATVIAN = 0x26; -pub const LANG_LITHUANIAN = 0x27; -pub const LANG_LOWER_SORBIAN = 0x2e; -pub const LANG_LUXEMBOURGISH = 0x6e; -pub const LANG_MACEDONIAN = 0x2f; -pub const LANG_MALAY = 0x3e; -pub const LANG_MALAYALAM = 0x4c; -pub const LANG_MALTESE = 0x3a; -pub const LANG_MANIPURI = 0x58; -pub const LANG_MAORI = 0x81; -pub const LANG_MAPUDUNGUN = 0x7a; -pub const LANG_MARATHI = 0x4e; -pub const LANG_MOHAWK = 0x7c; -pub const LANG_MONGOLIAN = 0x50; -pub const LANG_NEPALI = 0x61; -pub const LANG_NORWEGIAN = 0x14; -pub const LANG_OCCITAN = 0x82; -pub const LANG_ODIA = 0x48; -pub const LANG_ORIYA = 0x48; -pub const LANG_PASHTO = 0x63; -pub const LANG_PERSIAN = 0x29; -pub const LANG_POLISH = 0x15; -pub const LANG_PORTUGUESE = 0x16; -pub const LANG_PULAR = 0x67; -pub const LANG_PUNJABI = 0x46; -pub const LANG_QUECHUA = 0x6b; -pub const LANG_ROMANIAN = 0x18; -pub const LANG_ROMANSH = 0x17; -pub const LANG_RUSSIAN = 0x19; -pub const LANG_SAKHA = 0x85; -pub const LANG_SAMI = 0x3b; -pub const LANG_SANSKRIT = 0x4f; -pub const LANG_SCOTTISH_GAELIC = 0x91; -pub const LANG_SERBIAN = 0x1a; -pub const LANG_SERBIAN_NEUTRAL = 0x7c1a; -pub const LANG_SINDHI = 0x59; -pub const LANG_SINHALESE = 0x5b; -pub const LANG_SLOVAK = 0x1b; -pub const LANG_SLOVENIAN = 0x24; -pub const LANG_SOTHO = 0x6c; -pub const LANG_SPANISH = 0x0a; -pub const LANG_SWAHILI = 0x41; -pub const LANG_SWEDISH = 0x1d; -pub const LANG_SYRIAC = 0x5a; -pub const LANG_TAJIK = 0x28; -pub const LANG_TAMAZIGHT = 0x5f; -pub const LANG_TAMIL = 0x49; -pub const LANG_TATAR = 0x44; -pub const LANG_TELUGU = 0x4a; -pub const LANG_THAI = 0x1e; -pub const LANG_TIBETAN = 0x51; -pub const LANG_TIGRIGNA = 0x73; -pub const LANG_TIGRINYA = 0x73; -pub const LANG_TSWANA = 0x32; -pub const LANG_TURKISH = 0x1f; -pub const LANG_TURKMEN = 0x42; -pub const LANG_UIGHUR = 0x80; -pub const LANG_UKRAINIAN = 0x22; -pub const LANG_UPPER_SORBIAN = 0x2e; -pub const LANG_URDU = 0x20; -pub const LANG_UZBEK = 0x43; -pub const LANG_VALENCIAN = 0x03; -pub const LANG_VIETNAMESE = 0x2a; -pub const LANG_WELSH = 0x52; -pub const LANG_WOLOF = 0x88; -pub const LANG_XHOSA = 0x34; -pub const LANG_YAKUT = 0x85; -pub const LANG_YI = 0x78; -pub const LANG_YORUBA = 0x6a; -pub const LANG_ZULU = 0x35; -pub const SUBLANG_NEUTRAL = 0x00; -pub const SUBLANG_DEFAULT = 0x01; -pub const SUBLANG_SYS_DEFAULT = 0x02; -pub const SUBLANG_CUSTOM_DEFAULT = 0x03; -pub const SUBLANG_CUSTOM_UNSPECIFIED = 0x04; -pub const SUBLANG_UI_CUSTOM_DEFAULT = 0x05; -pub const SUBLANG_AFRIKAANS_SOUTH_AFRICA = 0x01; -pub const SUBLANG_ALBANIAN_ALBANIA = 0x01; -pub const SUBLANG_ALSATIAN_FRANCE = 0x01; -pub const SUBLANG_AMHARIC_ETHIOPIA = 0x01; -pub const SUBLANG_ARABIC_SAUDI_ARABIA = 0x01; -pub const SUBLANG_ARABIC_IRAQ = 0x02; -pub const SUBLANG_ARABIC_EGYPT = 0x03; -pub const SUBLANG_ARABIC_LIBYA = 0x04; -pub const SUBLANG_ARABIC_ALGERIA = 0x05; -pub const SUBLANG_ARABIC_MOROCCO = 0x06; -pub const SUBLANG_ARABIC_TUNISIA = 0x07; -pub const SUBLANG_ARABIC_OMAN = 0x08; -pub const SUBLANG_ARABIC_YEMEN = 0x09; -pub const SUBLANG_ARABIC_SYRIA = 0x0a; -pub const SUBLANG_ARABIC_JORDAN = 0x0b; -pub const SUBLANG_ARABIC_LEBANON = 0x0c; -pub const SUBLANG_ARABIC_KUWAIT = 0x0d; -pub const SUBLANG_ARABIC_UAE = 0x0e; -pub const SUBLANG_ARABIC_BAHRAIN = 0x0f; -pub const SUBLANG_ARABIC_QATAR = 0x10; -pub const SUBLANG_ARMENIAN_ARMENIA = 0x01; -pub const SUBLANG_ASSAMESE_INDIA = 0x01; -pub const SUBLANG_AZERI_LATIN = 0x01; -pub const SUBLANG_AZERI_CYRILLIC = 0x02; -pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN = 0x01; -pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC = 0x02; -pub const SUBLANG_BANGLA_INDIA = 0x01; -pub const SUBLANG_BANGLA_BANGLADESH = 0x02; -pub const SUBLANG_BASHKIR_RUSSIA = 0x01; -pub const SUBLANG_BASQUE_BASQUE = 0x01; -pub const SUBLANG_BELARUSIAN_BELARUS = 0x01; -pub const SUBLANG_BENGALI_INDIA = 0x01; -pub const SUBLANG_BENGALI_BANGLADESH = 0x02; -pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = 0x05; -pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x08; -pub const SUBLANG_BRETON_FRANCE = 0x01; -pub const SUBLANG_BULGARIAN_BULGARIA = 0x01; -pub const SUBLANG_CATALAN_CATALAN = 0x01; -pub const SUBLANG_CENTRAL_KURDISH_IRAQ = 0x01; -pub const SUBLANG_CHEROKEE_CHEROKEE = 0x01; -pub const SUBLANG_CHINESE_TRADITIONAL = 0x01; -pub const SUBLANG_CHINESE_SIMPLIFIED = 0x02; -pub const SUBLANG_CHINESE_HONGKONG = 0x03; -pub const SUBLANG_CHINESE_SINGAPORE = 0x04; -pub const SUBLANG_CHINESE_MACAU = 0x05; -pub const SUBLANG_CORSICAN_FRANCE = 0x01; -pub const SUBLANG_CZECH_CZECH_REPUBLIC = 0x01; -pub const SUBLANG_CROATIAN_CROATIA = 0x01; -pub const SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN = 0x04; -pub const SUBLANG_DANISH_DENMARK = 0x01; -pub const SUBLANG_DARI_AFGHANISTAN = 0x01; -pub const SUBLANG_DIVEHI_MALDIVES = 0x01; -pub const SUBLANG_DUTCH = 0x01; -pub const SUBLANG_DUTCH_BELGIAN = 0x02; -pub const SUBLANG_ENGLISH_US = 0x01; -pub const SUBLANG_ENGLISH_UK = 0x02; -pub const SUBLANG_ENGLISH_AUS = 0x03; -pub const SUBLANG_ENGLISH_CAN = 0x04; -pub const SUBLANG_ENGLISH_NZ = 0x05; -pub const SUBLANG_ENGLISH_EIRE = 0x06; -pub const SUBLANG_ENGLISH_SOUTH_AFRICA = 0x07; -pub const SUBLANG_ENGLISH_JAMAICA = 0x08; -pub const SUBLANG_ENGLISH_CARIBBEAN = 0x09; -pub const SUBLANG_ENGLISH_BELIZE = 0x0a; -pub const SUBLANG_ENGLISH_TRINIDAD = 0x0b; -pub const SUBLANG_ENGLISH_ZIMBABWE = 0x0c; -pub const SUBLANG_ENGLISH_PHILIPPINES = 0x0d; -pub const SUBLANG_ENGLISH_INDIA = 0x10; -pub const SUBLANG_ENGLISH_MALAYSIA = 0x11; -pub const SUBLANG_ENGLISH_SINGAPORE = 0x12; -pub const SUBLANG_ESTONIAN_ESTONIA = 0x01; -pub const SUBLANG_FAEROESE_FAROE_ISLANDS = 0x01; -pub const SUBLANG_FILIPINO_PHILIPPINES = 0x01; -pub const SUBLANG_FINNISH_FINLAND = 0x01; -pub const SUBLANG_FRENCH = 0x01; -pub const SUBLANG_FRENCH_BELGIAN = 0x02; -pub const SUBLANG_FRENCH_CANADIAN = 0x03; -pub const SUBLANG_FRENCH_SWISS = 0x04; -pub const SUBLANG_FRENCH_LUXEMBOURG = 0x05; -pub const SUBLANG_FRENCH_MONACO = 0x06; -pub const SUBLANG_FRISIAN_NETHERLANDS = 0x01; -pub const SUBLANG_FULAH_SENEGAL = 0x02; -pub const SUBLANG_GALICIAN_GALICIAN = 0x01; -pub const SUBLANG_GEORGIAN_GEORGIA = 0x01; -pub const SUBLANG_GERMAN = 0x01; -pub const SUBLANG_GERMAN_SWISS = 0x02; -pub const SUBLANG_GERMAN_AUSTRIAN = 0x03; -pub const SUBLANG_GERMAN_LUXEMBOURG = 0x04; -pub const SUBLANG_GERMAN_LIECHTENSTEIN = 0x05; -pub const SUBLANG_GREEK_GREECE = 0x01; -pub const SUBLANG_GREENLANDIC_GREENLAND = 0x01; -pub const SUBLANG_GUJARATI_INDIA = 0x01; -pub const SUBLANG_HAUSA_NIGERIA_LATIN = 0x01; -pub const SUBLANG_HAWAIIAN_US = 0x01; -pub const SUBLANG_HEBREW_ISRAEL = 0x01; -pub const SUBLANG_HINDI_INDIA = 0x01; -pub const SUBLANG_HUNGARIAN_HUNGARY = 0x01; -pub const SUBLANG_ICELANDIC_ICELAND = 0x01; -pub const SUBLANG_IGBO_NIGERIA = 0x01; -pub const SUBLANG_INDONESIAN_INDONESIA = 0x01; -pub const SUBLANG_INUKTITUT_CANADA = 0x01; -pub const SUBLANG_INUKTITUT_CANADA_LATIN = 0x02; -pub const SUBLANG_IRISH_IRELAND = 0x02; -pub const SUBLANG_ITALIAN = 0x01; -pub const SUBLANG_ITALIAN_SWISS = 0x02; -pub const SUBLANG_JAPANESE_JAPAN = 0x01; -pub const SUBLANG_KANNADA_INDIA = 0x01; -pub const SUBLANG_KASHMIRI_SASIA = 0x02; -pub const SUBLANG_KASHMIRI_INDIA = 0x02; -pub const SUBLANG_KAZAK_KAZAKHSTAN = 0x01; -pub const SUBLANG_KHMER_CAMBODIA = 0x01; -pub const SUBLANG_KICHE_GUATEMALA = 0x01; -pub const SUBLANG_KINYARWANDA_RWANDA = 0x01; -pub const SUBLANG_KONKANI_INDIA = 0x01; -pub const SUBLANG_KOREAN = 0x01; -pub const SUBLANG_KYRGYZ_KYRGYZSTAN = 0x01; -pub const SUBLANG_LAO_LAO = 0x01; -pub const SUBLANG_LATVIAN_LATVIA = 0x01; -pub const SUBLANG_LITHUANIAN = 0x01; -pub const SUBLANG_LOWER_SORBIAN_GERMANY = 0x02; -pub const SUBLANG_LUXEMBOURGISH_LUXEMBOURG = 0x01; -pub const SUBLANG_MACEDONIAN_MACEDONIA = 0x01; -pub const SUBLANG_MALAY_MALAYSIA = 0x01; -pub const SUBLANG_MALAY_BRUNEI_DARUSSALAM = 0x02; -pub const SUBLANG_MALAYALAM_INDIA = 0x01; -pub const SUBLANG_MALTESE_MALTA = 0x01; -pub const SUBLANG_MAORI_NEW_ZEALAND = 0x01; -pub const SUBLANG_MAPUDUNGUN_CHILE = 0x01; -pub const SUBLANG_MARATHI_INDIA = 0x01; -pub const SUBLANG_MOHAWK_MOHAWK = 0x01; -pub const SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA = 0x01; -pub const SUBLANG_MONGOLIAN_PRC = 0x02; -pub const SUBLANG_NEPALI_INDIA = 0x02; -pub const SUBLANG_NEPALI_NEPAL = 0x01; -pub const SUBLANG_NORWEGIAN_BOKMAL = 0x01; -pub const SUBLANG_NORWEGIAN_NYNORSK = 0x02; -pub const SUBLANG_OCCITAN_FRANCE = 0x01; -pub const SUBLANG_ODIA_INDIA = 0x01; -pub const SUBLANG_ORIYA_INDIA = 0x01; -pub const SUBLANG_PASHTO_AFGHANISTAN = 0x01; -pub const SUBLANG_PERSIAN_IRAN = 0x01; -pub const SUBLANG_POLISH_POLAND = 0x01; -pub const SUBLANG_PORTUGUESE = 0x02; -pub const SUBLANG_PORTUGUESE_BRAZILIAN = 0x01; -pub const SUBLANG_PULAR_SENEGAL = 0x02; -pub const SUBLANG_PUNJABI_INDIA = 0x01; -pub const SUBLANG_PUNJABI_PAKISTAN = 0x02; -pub const SUBLANG_QUECHUA_BOLIVIA = 0x01; -pub const SUBLANG_QUECHUA_ECUADOR = 0x02; -pub const SUBLANG_QUECHUA_PERU = 0x03; -pub const SUBLANG_ROMANIAN_ROMANIA = 0x01; -pub const SUBLANG_ROMANSH_SWITZERLAND = 0x01; -pub const SUBLANG_RUSSIAN_RUSSIA = 0x01; -pub const SUBLANG_SAKHA_RUSSIA = 0x01; -pub const SUBLANG_SAMI_NORTHERN_NORWAY = 0x01; -pub const SUBLANG_SAMI_NORTHERN_SWEDEN = 0x02; -pub const SUBLANG_SAMI_NORTHERN_FINLAND = 0x03; -pub const SUBLANG_SAMI_LULE_NORWAY = 0x04; -pub const SUBLANG_SAMI_LULE_SWEDEN = 0x05; -pub const SUBLANG_SAMI_SOUTHERN_NORWAY = 0x06; -pub const SUBLANG_SAMI_SOUTHERN_SWEDEN = 0x07; -pub const SUBLANG_SAMI_SKOLT_FINLAND = 0x08; -pub const SUBLANG_SAMI_INARI_FINLAND = 0x09; -pub const SUBLANG_SANSKRIT_INDIA = 0x01; -pub const SUBLANG_SCOTTISH_GAELIC = 0x01; -pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN = 0x06; -pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x07; -pub const SUBLANG_SERBIAN_MONTENEGRO_LATIN = 0x0b; -pub const SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC = 0x0c; -pub const SUBLANG_SERBIAN_SERBIA_LATIN = 0x09; -pub const SUBLANG_SERBIAN_SERBIA_CYRILLIC = 0x0a; -pub const SUBLANG_SERBIAN_CROATIA = 0x01; -pub const SUBLANG_SERBIAN_LATIN = 0x02; -pub const SUBLANG_SERBIAN_CYRILLIC = 0x03; -pub const SUBLANG_SINDHI_INDIA = 0x01; -pub const SUBLANG_SINDHI_PAKISTAN = 0x02; -pub const SUBLANG_SINDHI_AFGHANISTAN = 0x02; -pub const SUBLANG_SINHALESE_SRI_LANKA = 0x01; -pub const SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA = 0x01; -pub const SUBLANG_SLOVAK_SLOVAKIA = 0x01; -pub const SUBLANG_SLOVENIAN_SLOVENIA = 0x01; -pub const SUBLANG_SPANISH = 0x01; -pub const SUBLANG_SPANISH_MEXICAN = 0x02; -pub const SUBLANG_SPANISH_MODERN = 0x03; -pub const SUBLANG_SPANISH_GUATEMALA = 0x04; -pub const SUBLANG_SPANISH_COSTA_RICA = 0x05; -pub const SUBLANG_SPANISH_PANAMA = 0x06; -pub const SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 0x07; -pub const SUBLANG_SPANISH_VENEZUELA = 0x08; -pub const SUBLANG_SPANISH_COLOMBIA = 0x09; -pub const SUBLANG_SPANISH_PERU = 0x0a; -pub const SUBLANG_SPANISH_ARGENTINA = 0x0b; -pub const SUBLANG_SPANISH_ECUADOR = 0x0c; -pub const SUBLANG_SPANISH_CHILE = 0x0d; -pub const SUBLANG_SPANISH_URUGUAY = 0x0e; -pub const SUBLANG_SPANISH_PARAGUAY = 0x0f; -pub const SUBLANG_SPANISH_BOLIVIA = 0x10; -pub const SUBLANG_SPANISH_EL_SALVADOR = 0x11; -pub const SUBLANG_SPANISH_HONDURAS = 0x12; -pub const SUBLANG_SPANISH_NICARAGUA = 0x13; -pub const SUBLANG_SPANISH_PUERTO_RICO = 0x14; -pub const SUBLANG_SPANISH_US = 0x15; -pub const SUBLANG_SWAHILI_KENYA = 0x01; -pub const SUBLANG_SWEDISH = 0x01; -pub const SUBLANG_SWEDISH_FINLAND = 0x02; -pub const SUBLANG_SYRIAC_SYRIA = 0x01; -pub const SUBLANG_TAJIK_TAJIKISTAN = 0x01; -pub const SUBLANG_TAMAZIGHT_ALGERIA_LATIN = 0x02; -pub const SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH = 0x04; -pub const SUBLANG_TAMIL_INDIA = 0x01; -pub const SUBLANG_TAMIL_SRI_LANKA = 0x02; -pub const SUBLANG_TATAR_RUSSIA = 0x01; -pub const SUBLANG_TELUGU_INDIA = 0x01; -pub const SUBLANG_THAI_THAILAND = 0x01; -pub const SUBLANG_TIBETAN_PRC = 0x01; -pub const SUBLANG_TIGRIGNA_ERITREA = 0x02; -pub const SUBLANG_TIGRINYA_ERITREA = 0x02; -pub const SUBLANG_TIGRINYA_ETHIOPIA = 0x01; -pub const SUBLANG_TSWANA_BOTSWANA = 0x02; -pub const SUBLANG_TSWANA_SOUTH_AFRICA = 0x01; -pub const SUBLANG_TURKISH_TURKEY = 0x01; -pub const SUBLANG_TURKMEN_TURKMENISTAN = 0x01; -pub const SUBLANG_UIGHUR_PRC = 0x01; -pub const SUBLANG_UKRAINIAN_UKRAINE = 0x01; -pub const SUBLANG_UPPER_SORBIAN_GERMANY = 0x01; -pub const SUBLANG_URDU_PAKISTAN = 0x01; -pub const SUBLANG_URDU_INDIA = 0x02; -pub const SUBLANG_UZBEK_LATIN = 0x01; -pub const SUBLANG_UZBEK_CYRILLIC = 0x02; -pub const SUBLANG_VALENCIAN_VALENCIA = 0x02; -pub const SUBLANG_VIETNAMESE_VIETNAM = 0x01; -pub const SUBLANG_WELSH_UNITED_KINGDOM = 0x01; -pub const SUBLANG_WOLOF_SENEGAL = 0x01; -pub const SUBLANG_XHOSA_SOUTH_AFRICA = 0x01; -pub const SUBLANG_YAKUT_RUSSIA = 0x01; -pub const SUBLANG_YI_PRC = 0x01; -pub const SUBLANG_YORUBA_NIGERIA = 0x01; -pub const SUBLANG_ZULU_SOUTH_AFRICA = 0x01; +pub const NEUTRAL = 0x00; +pub const INVARIANT = 0x7f; +pub const AFRIKAANS = 0x36; +pub const ALBANIAN = 0x1c; +pub const ALSATIAN = 0x84; +pub const AMHARIC = 0x5e; +pub const ARABIC = 0x01; +pub const ARMENIAN = 0x2b; +pub const ASSAMESE = 0x4d; +pub const AZERI = 0x2c; +pub const AZERBAIJANI = 0x2c; +pub const BANGLA = 0x45; +pub const BASHKIR = 0x6d; +pub const BASQUE = 0x2d; +pub const BELARUSIAN = 0x23; +pub const BENGALI = 0x45; +pub const BRETON = 0x7e; +pub const BOSNIAN = 0x1a; +pub const BOSNIAN_NEUTRAL = 0x781a; +pub const BULGARIAN = 0x02; +pub const CATALAN = 0x03; +pub const CENTRAL_KURDISH = 0x92; +pub const CHEROKEE = 0x5c; +pub const CHINESE = 0x04; +pub const CHINESE_SIMPLIFIED = 0x04; +pub const CHINESE_TRADITIONAL = 0x7c04; +pub const CORSICAN = 0x83; +pub const CROATIAN = 0x1a; +pub const CZECH = 0x05; +pub const DANISH = 0x06; +pub const DARI = 0x8c; +pub const DIVEHI = 0x65; +pub const DUTCH = 0x13; +pub const ENGLISH = 0x09; +pub const ESTONIAN = 0x25; +pub const FAEROESE = 0x38; +pub const FARSI = 0x29; +pub const FILIPINO = 0x64; +pub const FINNISH = 0x0b; +pub const FRENCH = 0x0c; +pub const FRISIAN = 0x62; +pub const FULAH = 0x67; +pub const GALICIAN = 0x56; +pub const GEORGIAN = 0x37; +pub const GERMAN = 0x07; +pub const GREEK = 0x08; +pub const GREENLANDIC = 0x6f; +pub const GUJARATI = 0x47; +pub const HAUSA = 0x68; +pub const HAWAIIAN = 0x75; +pub const HEBREW = 0x0d; +pub const HINDI = 0x39; +pub const HUNGARIAN = 0x0e; +pub const ICELANDIC = 0x0f; +pub const IGBO = 0x70; +pub const INDONESIAN = 0x21; +pub const INUKTITUT = 0x5d; +pub const IRISH = 0x3c; +pub const ITALIAN = 0x10; +pub const JAPANESE = 0x11; +pub const KANNADA = 0x4b; +pub const KASHMIRI = 0x60; +pub const KAZAK = 0x3f; +pub const KHMER = 0x53; +pub const KICHE = 0x86; +pub const KINYARWANDA = 0x87; +pub const KONKANI = 0x57; +pub const KOREAN = 0x12; +pub const KYRGYZ = 0x40; +pub const LAO = 0x54; +pub const LATVIAN = 0x26; +pub const LITHUANIAN = 0x27; +pub const LOWER_SORBIAN = 0x2e; +pub const LUXEMBOURGISH = 0x6e; +pub const MACEDONIAN = 0x2f; +pub const MALAY = 0x3e; +pub const MALAYALAM = 0x4c; +pub const MALTESE = 0x3a; +pub const MANIPURI = 0x58; +pub const MAORI = 0x81; +pub const MAPUDUNGUN = 0x7a; +pub const MARATHI = 0x4e; +pub const MOHAWK = 0x7c; +pub const MONGOLIAN = 0x50; +pub const NEPALI = 0x61; +pub const NORWEGIAN = 0x14; +pub const OCCITAN = 0x82; +pub const ODIA = 0x48; +pub const ORIYA = 0x48; +pub const PASHTO = 0x63; +pub const PERSIAN = 0x29; +pub const POLISH = 0x15; +pub const PORTUGUESE = 0x16; +pub const PULAR = 0x67; +pub const PUNJABI = 0x46; +pub const QUECHUA = 0x6b; +pub const ROMANIAN = 0x18; +pub const ROMANSH = 0x17; +pub const RUSSIAN = 0x19; +pub const SAKHA = 0x85; +pub const SAMI = 0x3b; +pub const SANSKRIT = 0x4f; +pub const SCOTTISH_GAELIC = 0x91; +pub const SERBIAN = 0x1a; +pub const SERBIAN_NEUTRAL = 0x7c1a; +pub const SINDHI = 0x59; +pub const SINHALESE = 0x5b; +pub const SLOVAK = 0x1b; +pub const SLOVENIAN = 0x24; +pub const SOTHO = 0x6c; +pub const SPANISH = 0x0a; +pub const SWAHILI = 0x41; +pub const SWEDISH = 0x1d; +pub const SYRIAC = 0x5a; +pub const TAJIK = 0x28; +pub const TAMAZIGHT = 0x5f; +pub const TAMIL = 0x49; +pub const TATAR = 0x44; +pub const TELUGU = 0x4a; +pub const THAI = 0x1e; +pub const TIBETAN = 0x51; +pub const TIGRIGNA = 0x73; +pub const TIGRINYA = 0x73; +pub const TSWANA = 0x32; +pub const TURKISH = 0x1f; +pub const TURKMEN = 0x42; +pub const UIGHUR = 0x80; +pub const UKRAINIAN = 0x22; +pub const UPPER_SORBIAN = 0x2e; +pub const URDU = 0x20; +pub const UZBEK = 0x43; +pub const VALENCIAN = 0x03; +pub const VIETNAMESE = 0x2a; +pub const WELSH = 0x52; +pub const WOLOF = 0x88; +pub const XHOSA = 0x34; +pub const YAKUT = 0x85; +pub const YI = 0x78; +pub const YORUBA = 0x6a; +pub const ZULU = 0x35; diff --git a/std/os/windows/sublang.zig b/std/os/windows/sublang.zig new file mode 100644 index 000000000..e9929c6d7 --- /dev/null +++ b/std/os/windows/sublang.zig @@ -0,0 +1,244 @@ +pub const NEUTRAL = 0x00; +pub const DEFAULT = 0x01; +pub const SYS_DEFAULT = 0x02; +pub const CUSTOM_DEFAULT = 0x03; +pub const CUSTOM_UNSPECIFIED = 0x04; +pub const UI_CUSTOM_DEFAULT = 0x05; +pub const AFRIKAANS_SOUTH_AFRICA = 0x01; +pub const ALBANIAN_ALBANIA = 0x01; +pub const ALSATIAN_FRANCE = 0x01; +pub const AMHARIC_ETHIOPIA = 0x01; +pub const ARABIC_SAUDI_ARABIA = 0x01; +pub const ARABIC_IRAQ = 0x02; +pub const ARABIC_EGYPT = 0x03; +pub const ARABIC_LIBYA = 0x04; +pub const ARABIC_ALGERIA = 0x05; +pub const ARABIC_MOROCCO = 0x06; +pub const ARABIC_TUNISIA = 0x07; +pub const ARABIC_OMAN = 0x08; +pub const ARABIC_YEMEN = 0x09; +pub const ARABIC_SYRIA = 0x0a; +pub const ARABIC_JORDAN = 0x0b; +pub const ARABIC_LEBANON = 0x0c; +pub const ARABIC_KUWAIT = 0x0d; +pub const ARABIC_UAE = 0x0e; +pub const ARABIC_BAHRAIN = 0x0f; +pub const ARABIC_QATAR = 0x10; +pub const ARMENIAN_ARMENIA = 0x01; +pub const ASSAMESE_INDIA = 0x01; +pub const AZERI_LATIN = 0x01; +pub const AZERI_CYRILLIC = 0x02; +pub const AZERBAIJANI_AZERBAIJAN_LATIN = 0x01; +pub const AZERBAIJANI_AZERBAIJAN_CYRILLIC = 0x02; +pub const BANGLA_INDIA = 0x01; +pub const BANGLA_BANGLADESH = 0x02; +pub const BASHKIR_RUSSIA = 0x01; +pub const BASQUE_BASQUE = 0x01; +pub const BELARUSIAN_BELARUS = 0x01; +pub const BENGALI_INDIA = 0x01; +pub const BENGALI_BANGLADESH = 0x02; +pub const BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = 0x05; +pub const BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x08; +pub const BRETON_FRANCE = 0x01; +pub const BULGARIAN_BULGARIA = 0x01; +pub const CATALAN_CATALAN = 0x01; +pub const CENTRAL_KURDISH_IRAQ = 0x01; +pub const CHEROKEE_CHEROKEE = 0x01; +pub const CHINESE_TRADITIONAL = 0x01; +pub const CHINESE_SIMPLIFIED = 0x02; +pub const CHINESE_HONGKONG = 0x03; +pub const CHINESE_SINGAPORE = 0x04; +pub const CHINESE_MACAU = 0x05; +pub const CORSICAN_FRANCE = 0x01; +pub const CZECH_CZECH_REPUBLIC = 0x01; +pub const CROATIAN_CROATIA = 0x01; +pub const CROATIAN_BOSNIA_HERZEGOVINA_LATIN = 0x04; +pub const DANISH_DENMARK = 0x01; +pub const DARI_AFGHANISTAN = 0x01; +pub const DIVEHI_MALDIVES = 0x01; +pub const DUTCH = 0x01; +pub const DUTCH_BELGIAN = 0x02; +pub const ENGLISH_US = 0x01; +pub const ENGLISH_UK = 0x02; +pub const ENGLISH_AUS = 0x03; +pub const ENGLISH_CAN = 0x04; +pub const ENGLISH_NZ = 0x05; +pub const ENGLISH_EIRE = 0x06; +pub const ENGLISH_SOUTH_AFRICA = 0x07; +pub const ENGLISH_JAMAICA = 0x08; +pub const ENGLISH_CARIBBEAN = 0x09; +pub const ENGLISH_BELIZE = 0x0a; +pub const ENGLISH_TRINIDAD = 0x0b; +pub const ENGLISH_ZIMBABWE = 0x0c; +pub const ENGLISH_PHILIPPINES = 0x0d; +pub const ENGLISH_INDIA = 0x10; +pub const ENGLISH_MALAYSIA = 0x11; +pub const ENGLISH_SINGAPORE = 0x12; +pub const ESTONIAN_ESTONIA = 0x01; +pub const FAEROESE_FAROE_ISLANDS = 0x01; +pub const FILIPINO_PHILIPPINES = 0x01; +pub const FINNISH_FINLAND = 0x01; +pub const FRENCH = 0x01; +pub const FRENCH_BELGIAN = 0x02; +pub const FRENCH_CANADIAN = 0x03; +pub const FRENCH_SWISS = 0x04; +pub const FRENCH_LUXEMBOURG = 0x05; +pub const FRENCH_MONACO = 0x06; +pub const FRISIAN_NETHERLANDS = 0x01; +pub const FULAH_SENEGAL = 0x02; +pub const GALICIAN_GALICIAN = 0x01; +pub const GEORGIAN_GEORGIA = 0x01; +pub const GERMAN = 0x01; +pub const GERMAN_SWISS = 0x02; +pub const GERMAN_AUSTRIAN = 0x03; +pub const GERMAN_LUXEMBOURG = 0x04; +pub const GERMAN_LIECHTENSTEIN = 0x05; +pub const GREEK_GREECE = 0x01; +pub const GREENLANDIC_GREENLAND = 0x01; +pub const GUJARATI_INDIA = 0x01; +pub const HAUSA_NIGERIA_LATIN = 0x01; +pub const HAWAIIAN_US = 0x01; +pub const HEBREW_ISRAEL = 0x01; +pub const HINDI_INDIA = 0x01; +pub const HUNGARIAN_HUNGARY = 0x01; +pub const ICELANDIC_ICELAND = 0x01; +pub const IGBO_NIGERIA = 0x01; +pub const INDONESIAN_INDONESIA = 0x01; +pub const INUKTITUT_CANADA = 0x01; +pub const INUKTITUT_CANADA_LATIN = 0x02; +pub const IRISH_IRELAND = 0x02; +pub const ITALIAN = 0x01; +pub const ITALIAN_SWISS = 0x02; +pub const JAPANESE_JAPAN = 0x01; +pub const KANNADA_INDIA = 0x01; +pub const KASHMIRI_SASIA = 0x02; +pub const KASHMIRI_INDIA = 0x02; +pub const KAZAK_KAZAKHSTAN = 0x01; +pub const KHMER_CAMBODIA = 0x01; +pub const KICHE_GUATEMALA = 0x01; +pub const KINYARWANDA_RWANDA = 0x01; +pub const KONKANI_INDIA = 0x01; +pub const KOREAN = 0x01; +pub const KYRGYZ_KYRGYZSTAN = 0x01; +pub const LAO_LAO = 0x01; +pub const LATVIAN_LATVIA = 0x01; +pub const LITHUANIAN = 0x01; +pub const LOWER_SORBIAN_GERMANY = 0x02; +pub const LUXEMBOURGISH_LUXEMBOURG = 0x01; +pub const MACEDONIAN_MACEDONIA = 0x01; +pub const MALAY_MALAYSIA = 0x01; +pub const MALAY_BRUNEI_DARUSSALAM = 0x02; +pub const MALAYALAM_INDIA = 0x01; +pub const MALTESE_MALTA = 0x01; +pub const MAORI_NEW_ZEALAND = 0x01; +pub const MAPUDUNGUN_CHILE = 0x01; +pub const MARATHI_INDIA = 0x01; +pub const MOHAWK_MOHAWK = 0x01; +pub const MONGOLIAN_CYRILLIC_MONGOLIA = 0x01; +pub const MONGOLIAN_PRC = 0x02; +pub const NEPALI_INDIA = 0x02; +pub const NEPALI_NEPAL = 0x01; +pub const NORWEGIAN_BOKMAL = 0x01; +pub const NORWEGIAN_NYNORSK = 0x02; +pub const OCCITAN_FRANCE = 0x01; +pub const ODIA_INDIA = 0x01; +pub const ORIYA_INDIA = 0x01; +pub const PASHTO_AFGHANISTAN = 0x01; +pub const PERSIAN_IRAN = 0x01; +pub const POLISH_POLAND = 0x01; +pub const PORTUGUESE = 0x02; +pub const PORTUGUESE_BRAZILIAN = 0x01; +pub const PULAR_SENEGAL = 0x02; +pub const PUNJABI_INDIA = 0x01; +pub const PUNJABI_PAKISTAN = 0x02; +pub const QUECHUA_BOLIVIA = 0x01; +pub const QUECHUA_ECUADOR = 0x02; +pub const QUECHUA_PERU = 0x03; +pub const ROMANIAN_ROMANIA = 0x01; +pub const ROMANSH_SWITZERLAND = 0x01; +pub const RUSSIAN_RUSSIA = 0x01; +pub const SAKHA_RUSSIA = 0x01; +pub const SAMI_NORTHERN_NORWAY = 0x01; +pub const SAMI_NORTHERN_SWEDEN = 0x02; +pub const SAMI_NORTHERN_FINLAND = 0x03; +pub const SAMI_LULE_NORWAY = 0x04; +pub const SAMI_LULE_SWEDEN = 0x05; +pub const SAMI_SOUTHERN_NORWAY = 0x06; +pub const SAMI_SOUTHERN_SWEDEN = 0x07; +pub const SAMI_SKOLT_FINLAND = 0x08; +pub const SAMI_INARI_FINLAND = 0x09; +pub const SANSKRIT_INDIA = 0x01; +pub const SCOTTISH_GAELIC = 0x01; +pub const SERBIAN_BOSNIA_HERZEGOVINA_LATIN = 0x06; +pub const SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x07; +pub const SERBIAN_MONTENEGRO_LATIN = 0x0b; +pub const SERBIAN_MONTENEGRO_CYRILLIC = 0x0c; +pub const SERBIAN_SERBIA_LATIN = 0x09; +pub const SERBIAN_SERBIA_CYRILLIC = 0x0a; +pub const SERBIAN_CROATIA = 0x01; +pub const SERBIAN_LATIN = 0x02; +pub const SERBIAN_CYRILLIC = 0x03; +pub const SINDHI_INDIA = 0x01; +pub const SINDHI_PAKISTAN = 0x02; +pub const SINDHI_AFGHANISTAN = 0x02; +pub const SINHALESE_SRI_LANKA = 0x01; +pub const SOTHO_NORTHERN_SOUTH_AFRICA = 0x01; +pub const SLOVAK_SLOVAKIA = 0x01; +pub const SLOVENIAN_SLOVENIA = 0x01; +pub const SPANISH = 0x01; +pub const SPANISH_MEXICAN = 0x02; +pub const SPANISH_MODERN = 0x03; +pub const SPANISH_GUATEMALA = 0x04; +pub const SPANISH_COSTA_RICA = 0x05; +pub const SPANISH_PANAMA = 0x06; +pub const SPANISH_DOMINICAN_REPUBLIC = 0x07; +pub const SPANISH_VENEZUELA = 0x08; +pub const SPANISH_COLOMBIA = 0x09; +pub const SPANISH_PERU = 0x0a; +pub const SPANISH_ARGENTINA = 0x0b; +pub const SPANISH_ECUADOR = 0x0c; +pub const SPANISH_CHILE = 0x0d; +pub const SPANISH_URUGUAY = 0x0e; +pub const SPANISH_PARAGUAY = 0x0f; +pub const SPANISH_BOLIVIA = 0x10; +pub const SPANISH_EL_SALVADOR = 0x11; +pub const SPANISH_HONDURAS = 0x12; +pub const SPANISH_NICARAGUA = 0x13; +pub const SPANISH_PUERTO_RICO = 0x14; +pub const SPANISH_US = 0x15; +pub const SWAHILI_KENYA = 0x01; +pub const SWEDISH = 0x01; +pub const SWEDISH_FINLAND = 0x02; +pub const SYRIAC_SYRIA = 0x01; +pub const TAJIK_TAJIKISTAN = 0x01; +pub const TAMAZIGHT_ALGERIA_LATIN = 0x02; +pub const TAMAZIGHT_MOROCCO_TIFINAGH = 0x04; +pub const TAMIL_INDIA = 0x01; +pub const TAMIL_SRI_LANKA = 0x02; +pub const TATAR_RUSSIA = 0x01; +pub const TELUGU_INDIA = 0x01; +pub const THAI_THAILAND = 0x01; +pub const TIBETAN_PRC = 0x01; +pub const TIGRIGNA_ERITREA = 0x02; +pub const TIGRINYA_ERITREA = 0x02; +pub const TIGRINYA_ETHIOPIA = 0x01; +pub const TSWANA_BOTSWANA = 0x02; +pub const TSWANA_SOUTH_AFRICA = 0x01; +pub const TURKISH_TURKEY = 0x01; +pub const TURKMEN_TURKMENISTAN = 0x01; +pub const UIGHUR_PRC = 0x01; +pub const UKRAINIAN_UKRAINE = 0x01; +pub const UPPER_SORBIAN_GERMANY = 0x01; +pub const URDU_PAKISTAN = 0x01; +pub const URDU_INDIA = 0x02; +pub const UZBEK_LATIN = 0x01; +pub const UZBEK_CYRILLIC = 0x02; +pub const VALENCIAN_VALENCIA = 0x02; +pub const VIETNAMESE_VIETNAM = 0x01; +pub const WELSH_UNITED_KINGDOM = 0x01; +pub const WOLOF_SENEGAL = 0x01; +pub const XHOSA_SOUTH_AFRICA = 0x01; +pub const YAKUT_RUSSIA = 0x01; +pub const YI_PRC = 0x01; +pub const YORUBA_NIGERIA = 0x01; +pub const ZULU_SOUTH_AFRICA = 0x01;